Jump to content

Storing Data In A Sop


Recommended Posts

Sorry for the flood of questions.

I'm sure I read somewhere that you can save your own snippets of data in a sop that are then stored in the hip file, but I can't find where I read that now.

Basically I want to store a matrix that I don't want to get recalculated when the sop cooks. Any ideas?

Link to comment
Share on other sites

Ok that's worth knowing.

just thinking out loud...

Maybe I can store what I need in some hidden parameters instead?

Can I fire off a callback to stuff the values I need into these hidden parameters?

When you parent one object to another with keep position when parenting on how does the transform data for the node get updated and stored?

I basically want to mimick this at sop level, so I can parent points to objects. What is the most elegant solution?

Link to comment
Share on other sites

Objects override OP_Node functions to change parameters when inputs are changed. If you look in OBJ_Node.h, note it overrides these 3 functions from OP_Node: setInput, setInputReference, and setIndirectInput.

In each function, it computes some data before the input is changed, calls the base class function to change the input, and then does some munging afterwards before returning.

Link to comment
Share on other sites

hmmm that sounds a little complex for me at the moment.

Is there a way to update parameter values on a button click event?

There must be I guess since there are initialise buttons on various sops that do this already.

That would be the simplest way for me I think.

So, user hits initialise button and the parameters get set to the values I want to keep. That way they are scriptable and storable.

Link to comment
Share on other sites

That's looking good, do you know how the help is done for the CHOP_Puppet node, it's the first HDK example I've tried where the help actually works but I can't see how it is done.

Hey I seem to have become a Houdini master again, hoorah.

Funny how asking lots of dumb question can make you a master... :P

Edited by sibarrick
Link to comment
Share on other sites

Heh ... the help works because it comes with the default distribution. And that's because the puppet chop is one of the proto_install items as well. :) Anyhow, I believe that SOP_Star.C has been updated with a good help example in H8.

What do you mean by "lock" the parameter. You mean make it "hidden"? To make a parameter hidden, you just need to bitwise-or in the PRM_TYPE_INVISIBLE bit into the parameter type (see PRM_Type.h).

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