Blacko0ps Posted February 28, 2017 Share Posted February 28, 2017 (edited) 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 March 2, 2017 by Blacko0ps Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted March 3, 2017 Share Posted March 3, 2017 Python interpreter runs in the main Houdini thread, so anything you do in python will freeze Houidini UI. Depending on what are you trying to achieve, try Mouse CHOP Also, see hdefereval module which ships with Houdini. Quote Link to comment Share on other sites More sharing options...
Blacko0ps Posted March 6, 2017 Author Share Posted March 6, 2017 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. 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.