katisss Posted May 10, 2011 Share Posted May 10, 2011 When i set keyframes in the transform channels with python it doesnt animate the object. Am i missing something? Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted May 10, 2011 Share Posted May 10, 2011 Can you see the keys in the graph editor? If not, then it probably isn't applying the keys properly. Below is a section of a script that sets key frames for reference. # Prepare keys for emission emissionKey1 = hou.Keyframe() emissionKey1.setFrame(startFrame) emissionKey1.setValue(0) emissionKey1.setExpression("linear()", hou.exprLanguage.Hscript) emissionKey2 = hou.Keyframe() emissionKey2.setFrame(startFrame + startPadding) emissionKey2.setValue(1) emissionKey2.setExpression("linear()", hou.exprLanguage.Hscript) emissionKey3 = hou.Keyframe() emissionKey3.setFrame(endFrame - endPadding) emissionKey3.setValue(1) emissionKey3.setExpression("linear()", hou.exprLanguage.Hscript) emissionKey4 = hou.Keyframe() emissionKey4.setFrame(endFrame) emissionKey4.setValue(0) emissionKey4.setExpression("linear()", hou.exprLanguage.Hscript) # Set keys for source emission amountParm = hou.parm('/obj/volumeSim/apply_source/scale') amountParm.deleteAllKeyframes() amountParm.setKeyframe(emissionKey1) amountParm.setKeyframe(emissionKey2) amountParm.setKeyframe(emissionKey3) amountParm.setKeyframe(emissionKey4) Quote Link to comment Share on other sites More sharing options...
katisss Posted May 13, 2011 Author Share Posted May 13, 2011 thanks, Luke i check Quote Link to comment Share on other sites More sharing options...
katisss Posted May 13, 2011 Author Share Posted May 13, 2011 hi, i forgot about emissionKey2.setFrame(i) thinking i could create the frame like emissionKey2 = hou.Keyframe(i) Thanks for helping 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.