Daniel Posted March 5, 2006 Share Posted March 5, 2006 I'm working on a sop and would like the ability to modify upstream parameters several times a frame and force a cook of those upstream nodes and collect the results of each iteration (much like a copy/stamp does). I've got a sop that I internally loop multiples times.. each loop I update some params on my sop using "setFloatInst". I've got other sops that depend on those attributes (just pointing to my sop with ch() funcs).. so each time I change a param on my sop I'd want the other sops to see that change and cook.. then I retereive the results (don't ask.. just a weird simulation and I'm just experimenting) All very non-standard.. any pointers? Ideally I'd like to force a recook of the upstream nodes or better yet unconnected nodes that's im interested in. Thanks daniel Quote Link to comment Share on other sites More sharing options...
edward Posted March 6, 2006 Share Posted March 6, 2006 Your users can just use the stamp() expression as per usual if you use the OP_Node::setGlobalParam() function. What that will do is set the value into the named param and then dirty all nodes that reference that param. After setting all your new values, you will need to recook your input SOP. Remember to unlock and then relock if it's one of your own inputs. By re-obtaining the result, it will recook using the new values because the stamp() expressions will now return something different. Quote Link to comment Share on other sites More sharing options...
Daniel Posted March 6, 2006 Author Share Posted March 6, 2006 Your users can just use the stamp() expression as per usual if you use the OP_Node::setGlobalParam() function. What that will do is set the value into the named param and then dirty all nodes that reference that param. After setting all your new values, you will need to recook your input SOP. Remember to unlock and then relock if it's one of your own inputs. By re-obtaining the result, it will recook using the new values because the stamp() expressions will now return something different. 25400[/snapback] Thanks Edward, that sounds much easier then I expected. I'll give her a try daniel Quote Link to comment Share on other sites More sharing options...
Daniel Posted March 6, 2006 Author Share Posted March 6, 2006 Your users can just use the stamp() expression as per usual if you use the OP_Node::setGlobalParam() function. What that will do is set the value into the named param and then dirty all nodes that reference that param. After setting all your new values, you will need to recook your input SOP. Remember to unlock and then relock if it's one of your own inputs. By re-obtaining the result, it will recook using the new values because the stamp() expressions will now return something different. 25400[/snapback] Quick question on the function bool setGlobalParam(const char *param, float value, const char *strvalue, bool *warned); I'm not clear why there is a float value and a strvalue. I'm guessing param is the var name we're setting, float value is what we want to set it too.. and strvalue? Thanks d Quote Link to comment Share on other sites More sharing options...
edward Posted March 6, 2006 Share Posted March 6, 2006 The stamps() with an extra s at the end is a function that allows you to retrieve the string value associated with your param var. The safest thing to do if you're only returning floats is to give a string representation of your float value as well. I don't know offhand if it accepts NULL pointers. Quote Link to comment Share on other sites More sharing options...
Daniel Posted March 6, 2006 Author Share Posted March 6, 2006 The stamps() with an extra s at the end is a function that allows you to retrieve the string value associated with your param var. The safest thing to do if you're only returning floats is to give a string representation of your float value as well. I don't know offhand if it accepts NULL pointers.25414[/snapback] Thanks for the help. Stamp works great! I wasn't expecting to be able to leverage off of that, very cool.. simplified the node a lot d Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.