I have no evidence that any of those metadata flags are really working. Do you ? 🙂
For example I have a custom array that std::cout when its dtor is called .. so I should see that output every time a parameter flagged with _triggers_reinitialize is changed because also the node_finish has to be called before a new node_initialize (and there things are deleted).. but I don't see any output until I explicitely use the 'Update Full Scene' in the Arnold renderview.
I'm simply using it in this way :
AiMetaDataSetBool(nentry, NULL, "force_update", true); // and/or ..
AiMetaDataSetBool(nentry, "gMode", "_triggers_reinitialize", true);
Btw, the :
AiMetaDataSetBool(nentry, "gMode", "linkable", false);
is not reflected in the Maya AE.. there's still a button where to link a node..
Solved! Go to Solution.
Solved by Stephen.Blair. Go to Solution.
_triggers_reinitialize
force_update
Ok for the force_update but for the _triggers_reinitialize it is stated in the docs ..that it will trigger a node init/finish when the parameter is modified. I expect this to work also on custom shader parameters (ie. a shader is a node and a param is a param).. because I have a parameter that belongs to the node_initialize method and as such when it is modified the shader needs to rebuild a certain data structure based on the new param value in the init method. This said also the force_update even if it does not belong to parameters it should reload the shader on a camera move but it does not
Also, in the next release of arnold we'll likely have the documentation fixed so that it's clear this metadata was only for shape nodes and not any type of node. Sorry about that confusion.
Holy poly ! 🙂 That works.. I mean to move stuff to node_update.
I was confused by the fact that I thought.. if there's an ad-hoc mtd for param re-init then it must be done like that. Instead now in node_init I just init ptrs to null then in the node_update I preventively delete them before building new ones, in node_finish I still delete them together with all the remaing data.
Too nice shader to have it broken.. it does micro normal lookups based on Gabor kernels and wave optics, that's why I need to preprocess stuff. Thanks !