Anton Posted February 17, 2012 Share Posted February 17, 2012 Hi! As you know to create chop pose from current selected controls you must choose in Motion Effects menu Create Pose and if parms are scoped everything works fine. But when I call this script from digital asset houdini gives me an error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "opdef:/Object/facial_animation_rig?PythonModule", line 4, in addPose KeyError: ('parms',) Button in digital asset by this code... hou.pwd().hdaModule().addPose() ...call this function: def addPose(): import choptoolutils parms = kwargs['parms'] choptoolutils.createPose(parms) What I'm doing wrong? Quote Link to comment Share on other sites More sharing options...
edward Posted February 18, 2012 Share Posted February 18, 2012 When the menu calls it, the UI sets up kwargs['parm'] for the script, which is a list of hou.Parm objects. If you call it yourself, then you shouldn't use kwargs['parms'], but pass choptoolutils.createPose(myparms) where myparms is the list of parms that you want to create the pose for yourself. Quote Link to comment Share on other sites More sharing options...
Anton Posted February 21, 2012 Author Share Posted February 21, 2012 Thxs, edward! It's true but I'd like to create pose from selected controls in viewport by clicking button in asset. And the problem i can't understand is how Motion Effects Create Pose Tool takes only scoped parms from selected controls(nodes). I will try to use isAutoscoped() and isLocked() functions to solve it. Quote Link to comment Share on other sites More sharing options...
edward Posted February 22, 2012 Share Posted February 22, 2012 Hmm ... perhaps you can get the list of currently scoped channels from hou.hscript("chscope") Quote Link to comment Share on other sites More sharing options...
Anton Posted February 22, 2012 Author Share Posted February 22, 2012 Very useful command, thank you! The problem solved by checking all parms of selected node and use only scoped and unlocked for creating pose. 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.