Hi guys,
I am working on a python script that bakes the hand movement of geometry with mouse in the viewport over the time and creates keys on each frame. In other word, I want to move my object with mouse in the view port and get the Transform/Rotation/Scale keyed on each frame.
Currently I am using hou.selectedNode() and the hou.parm() to access the specific parameters that I want to bake.
Then I use a for loop to generate keyframe on each frame. Immediately after pushing the bake button it bakes the parameters value on the first frame for entire time line. I have tried using while loop with time.sleep() to wait for a bit after setting key on each frame, but it freeze the view port and I cant move my geometry. Is there anyway to make my code somehow that constantly check the new values of object parameters on each frame and allow me to work on the view port while it does its job in the background? Is this related to multi threading?
Here is my for loop
for f in timeline:
setKey = hou.Keyframe()
setKey.setFrame(f)
setKey.setValue( keyValue[f] )
ParmList.setKeyframe(setKey)
hou.setFrame(f)
Thanks,