MaxScript:检测何时删除对象

时间:2016-03-14 20:12:16

标签: 3dsmax maxscript

如果从场景中删除对象,我将如何检测(或触发某个函数)?

1 个答案:

答案 0 :(得分:6)

使用notifications

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

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