Isotropix Forums

Drop callbacks to execute Python function

Clarisse Scripting related topics

Re: Drop callbacks to execute Python function

Unread postby sam » Thu May 09, 2019 12:41 am

Yes it's the ID 6138 (but it was submitted prior the Feature Request Tracker, so it's not visible)
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1419
Joined: Fri Jan 25, 2013 11:33 pm

Re: Drop callbacks to execute Python function

Unread postby mati » Thu May 09, 2019 7:36 pm

Thanks Sam. An item creation callback is the big one for us, but this would also be a more robust solution than what I've seen suggested on this forum for save/saveAs/import/reference hooks.

Registering a callable object like OP's example would be best, but if that's not possible, a module path + function (or callable) would be preferred over a script path like I've seen elsewhere in the API:

e.g.

python code

register_item_creation_callback('path.to.module', 'handle_item_creation')


Then in path.to.module:

python code

def handle_item_creation(item):
# Do something about the created item.


Thank you.
mati
 
Posts: 35
Joined: Fri Apr 19, 2019 8:35 pm

Previous

Return to Scripting