Python - only execute hook on specific script

Python Gurus -

I have a script with a function that executes on the post_export_sequence hook. I only want to execute this function if this specific script is run, not every time the hook is triggered. Is there a way to do that?

I’m learning python via flame so I don’t know all of the ins and outs of the bigger world of python.

You can pass a dictionary with custom data between the hooks. You could fill this with something like

„trigger“ => __file__

and react only if your desired script is calling.

I’m not in front the box right now, but can post an example later if that helps.

@bryanb @claussteinmassl Claus was referring to the “userData” parameter in the export hooks.

You can pass a dict as the value and put in custom dictionary entries to communicate to the other hooks in the chain.

1 Like