Jump to content

Setting keyframe with Python


Mikal

Recommended Posts

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 by Mikal
Link to comment
Share on other sites

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.

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