Notifications
Clear all

[Closed] Custom Attributes Delete Handler

Hey guys,
Im writting a modifier that has a custom attribute, when that modifier is deleted along with the CA i would like it to run some code.

I cant seem to figure out if there is a handler for this?

Thanks for reading!
Lukas

6 Replies

Within the custom attribute itself, add an “on deleted” event. Check out the “Scripted Plug-in Clauses” page in the help document. The same things apply to custom attributes.

 PEN

Check what is says aboutthat however. It isn’t called right away as it could still be held in the undo stack. You can also use callBacks but they have to be running all the time.

#preModifierDeleted
#postModifierDeleted

THanks, I tried that earlier but with no luck for me

my code is
ca=attributes splineData
(
parameters main rollout: params
(

)
rollout params “spline”
(

)
on created do
(
print “Created”
)

     on deleted do
 (
     print "Deleted"
 )

)

But Created or Deleted are not printed when I create CA or delete it…

 PEN

I don’t think that will work with a CA

It would have to be a modifier

Ill give it a shot, probably just extending the empty modifier will do, thanks

Interesting, it is held in the undo as you say because now that i converted it to a plugin it prints created but not deleted. When I do a gc() thought they alot of deleted prints, so it is as you say!

Cheers,
Lukas