2
votes

How would I detect (or fire a function) if an object is deleted from the scene?

1

1 Answers

6
votes

Using notifications

fn nodeDeletedCallback =
(
  deletedObj = callbacks.notificationParam()
  print ("Deleting: " + (deletedObj as string))
)

Callbacks.addscript #nodePreDelete "nodeDeletedCallback()" id:#id_AStringYouCanUseLaterToIdentifyThisCallback