Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Are mtd force_update and _triggers_reinitialize working at all ?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
maxtarpini
281 Views, 6 Replies

Are mtd force_update and _triggers_reinitialize working at all ?

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..

Tags (1)
Labels (1)
  • wtf
6 REPLIES 6
Message 2 of 7
Stephen.Blair
in reply to: maxtarpini

_triggers_reinitialize

  • Are you using this on a shape? I think_triggers_reinitialize is for when a shape node is modified with AiNodeSet. The code has a debug message, so if you render with Debug-level logging, there will be a message

force_update

  • force_update=true means that when the camera moves, your node will have node_update called even if Arnold thinks that node didn't need to be updated



// Stephen Blair
// Arnold Renderer Support
Message 3 of 7
maxtarpini
in reply to: Stephen.Blair

Ok for the force_update but for the _triggers_reinitialize it is stated in the docs ..node-triggers.pngthat 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

Message 4 of 7
maxtarpini
in reply to: maxtarpini

Let's put it in this way.. I have a parameter that when modified it needs to trigger the reload of the whole shader .. is there a way to do this without reloading manually the whole scene ? (Will try that debug logging in the while to see if something is triggered; thanks!)
Message 5 of 7
thiago.ize
in reply to: maxtarpini

Usually this type of behavior is handled by node_update. Can you move the logic in the node_init and node_finish into node_update?


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.


Message 6 of 7
maxtarpini
in reply to: thiago.ize

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 !

gabor-brushed.jpg

Message 7 of 7
thiago.ize
in reply to: maxtarpini

Looks nice and glad this worked!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report