[Sidefx-houdini-list] Python and channels
rangi at kanuka.com.au
Mon Oct 13 20:29:57 EDT 2008
Thanks for your help! I was (optimistically!) hoping there might be some
sort of channel class that would hold all this keyframe stuff so it
would become abstracted.. and... god forbid... easy to script! But
alas... I imagine it's something that with time and effort one create in
Out of interest, does anyone know how if Maya and python have useful
classes like this?
I think I'll try the temp preset technique... Or even for now just
assume that it's mostly going to be a single expression.
It's a shame.. all the easy work arounds I can think of, such as just
copying the node and doing renaming, could bring in some nasty side
effects where channel references get broken.
Nicholas Pliatsikas wrote:
> Hey there.
> 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.
> Nicholas Pliatsikas
>> 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
More information about the Sidefx-houdini-list