Jump to content

Real-time recorder python script


Blacko0ps

Recommended Posts

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,

Edited by Blacko0ps
Link to comment
Share on other sites

Thanks for the reply Alex! I have seen some tutorial on mouse chop, but I am limited to use python for this project. I am still new in python and not have enough knowledge about  hdefereval module. I am going to do more research about it. Please let me know if you have any references. Thanks.

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