[Sidefx-houdini-list] Python and channels
nick_p102 at hotmail.com
Mon Oct 13 09:51:20 EDT 2008
You will need to check if the parms have expressions tied to them and use setExpression. Dont forget any expressions with keys on them you will need to run node.parm('foo').deleteAllKeys()
You probably need to check if any values are animated as well. Not quite sure how that would work when storing the values as I havent tried that before. There probably is a method for grabbing animdata but if theres no support for accessing animdata as you need, you could make a list of lists with all the data you need to recreate the keyframe data then use a for loop to set the keys back again. If possible it might be easier to save the animData to a temp clip file and import it back again.
And dont forget theres still lots of unimplemented python code. So you can use hou.hscript* todo things that arent set up yet.
Maybe you could back up the entire node setup using a temp preset and reload the preset after you do what you do, saves messing with lots of parm data.
Plenty of paths to choose from.
> Date: Mon, 13 Oct 2008 17:17:16 +1000> From: rangi at kanuka.com.au> To: sidefx-houdini-list at sidefx.com> Subject: [Sidefx-houdini-list] Python and channels> > Hey folks,> > Any suggestions on how I can efficiently back up a channel in python? > ie. a bit like> > oldval=thisnode.parm('foo').eval()> thisnode.parm('foo').set(temp_val)> > doSomeInterestingStuff> > thisnode.parm('foo').set(oldval)> > Which works unless there's expressions/channel info... in which case > this borks out even trying to do the set(). I don't want to make a > temporary take, because in doSomeInterestingStuff it'll do things like > render and that might not necessarily use the take we're currently in.> > Just forcing myself into the python tao.. but I ain't there yet!> > Thanks for your help,> r.> > _______________________________________________> Sidefx-houdini-list mailing list> Sidefx-houdini-list at sidefx.com> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
Win New York holidays with Kellogg’s & Live Search
More information about the Sidefx-houdini-list