[Closed] Persistent Global Function?
I’m trying without success to store a persistent global function within a scene. It’s for auto render pathing. I will want to execute this function with a persistent pre-render and/or post file save callback/s which I know how to do fine. I’ve tried defining the variable first as a persistent global and then turning that into a function, but that doesn’t work to make a persistent global function. I know how to store variables in a scene as appdata, custom attributes (on obejcts and rootnode), custom file properties and persistent globals. But I can’t figure a way to both store the script in the scene as well have access to it from a callback. Is there even a way? I know I could just have the function initialised in a startup script but the whole reason I want to do this is because I want it to work on multiple computers without having to add scripts to startup manually.
TLDR: I want to autopath renders with a script that you only need to install in the scene once.
Cheers,
Cg.
I’ve usually used custom attributes on rootNode for that purpose; put your variables in the parameter block, add your functions and now you can call “rootNode.nameOfCA.function()” in your callbacks.
Silly thing is, I’m often both putting custom attributes on objects in rigs with built in functions and I store plenty of variables in ca’s on the root node. Feel a bit thick for not putting those ideas together. Oh well, it’s working. Thanks again