Mikal Posted July 6, 2010 Share Posted July 6, 2010 (edited) Prob quite an easy one (am new to Python) but am having some trouble setting keyframes for a parameter in Python, and don't feel that enlightened after reading the help files. for example I'd like to key the 'sizex' attribute on a box sop at frame 12 - so am trying the following: myBox.parm('sizex').setKeyframe(12) - which returns me: TypeError: in method 'Parm_setKeyframe', argument 2 of type 'HOM_BaseKeyframe &' Not quite sure what that's telling me, but given the Parm class appears to have it's own setKeyframe method, hopefully on the right track? but then I also notice hou.Keyframe & hou.BaseKeyFrame classes which confuses somewhat. Any help would be appreciated! M Edited July 6, 2010 by Mikal Quote Link to comment Share on other sites More sharing options...
graham Posted July 6, 2010 Share Posted July 6, 2010 hou.Parm.setKeyframe() takes a hou.KeyFrame object. key = hou.Keyframe(12) box.parm("sizex").setKeyframe(key) Quote Link to comment Share on other sites More sharing options...
Mikal Posted July 6, 2010 Author Share Posted July 6, 2010 Cheers Graham Do you happen to know how - hou.BaseKeyframe differs or relates to the hou.Keyframe object? Quote Link to comment Share on other sites More sharing options...
graham Posted July 7, 2010 Share Posted July 7, 2010 hou.BaseKeyframe is just the abstract base class for the hou.Keyframe and hou.StringKeyframe classes. Those classes inherit a bunch of the common methods from that class. If you try and create a hou.BaseKeyframe you'll notice that it has no constructor and you can't actually create one. 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.