sibarrick Posted August 17, 2005 Share Posted August 17, 2005 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? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 17, 2005 Author Share Posted August 17, 2005 It's ok I think I found it. The BlindData.c example sop.... hopefully will do what I need Quote Link to comment Share on other sites More sharing options...
edward Posted August 17, 2005 Share Posted August 17, 2005 Yep, the only "drawback" of course is that your SOP is no longer opscriptable. The Edit SOPs do this, they save the deltas as blind data and thus are also non-opscriptable. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 17, 2005 Author Share Posted August 17, 2005 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? Quote Link to comment Share on other sites More sharing options...
edward Posted August 17, 2005 Share Posted August 17, 2005 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. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 17, 2005 Author Share Posted August 17, 2005 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. Quote Link to comment Share on other sites More sharing options...
edward Posted August 17, 2005 Share Posted August 17, 2005 The CHOP_Puppet.C in the HDK samples has an example of buttons in op parameters. Look for PRM_CALLBACK. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 18, 2005 Author Share Posted August 18, 2005 (edited) 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... Edited August 18, 2005 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 18, 2005 Author Share Posted August 18, 2005 Ok this is working now, the callback that is not the help. How do you lock a parameter, can't see anything obvious in OP_Parameters to deal with this, is it somewhere else? Quote Link to comment Share on other sites More sharing options...
edward Posted August 18, 2005 Share Posted August 18, 2005 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). Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 18, 2005 Author Share Posted August 18, 2005 I'll check out the new star.c - cheers. No I mean lock a parameter so it turns pink and users (horrible things) can't monkey with the values. Like when you RMB and do lock parameter. Quote Link to comment Share on other sites More sharing options...
edward Posted August 18, 2005 Share Posted August 18, 2005 PRM_Parm &parm = getParm("myParmName"); int i; for( i = 0; i < parm.getVectorSize(); i++ ) parm.setLockedFlag( i, true ); Quote Link to comment Share on other sites More sharing options...
sibarrick Posted August 18, 2005 Author Share Posted August 18, 2005 Fabulous works a treat, that'll fix them, damn users messing with things they shouldn't. Many many thanks edward. Keep a tally of how many I owe you and matbe one day I can buy you a beer or two. 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.