Jump to content

How Does Copy/stamp Cook?


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...