How would I detect (or fire a function) if an object is deleted from the scene?
Asked
Active
Viewed 968 times
1 Answers
6
Using notifications
fn nodeDeletedCallback =
(
deletedObj = callbacks.notificationParam()
print ("Deleting: " + (deletedObj as string))
)
Callbacks.addscript #nodePreDelete "nodeDeletedCallback()" id:#id_AStringYouCanUseLaterToIdentifyThisCallback

FrozenKiwi
- 1,362
- 13
- 26
-
It says it is unable to convert result to string. Is there a way to do that? – Jacob Mar 16 '16 at 19:47
-
Also how would I check if an object is a box? – Jacob Mar 16 '16 at 19:53
-
Compare with its class, for instance: classOf obj == Box. This returns true if the node stored in the obj variable is indeed a box, otherwise false. – Klaudikus Jan 08 '17 at 04:41