Houdini Pushing overrides
- April 19th, 2017
- Posted in Uncategorized
- Write comment
A python script to “push” take values back to the root take. If you have an override you want to make global, right click and send it back to the main take.
You’ll need to save this into a “PARMmenu.xml” file somewhere on your houdini path (eg C:\Users\XXX\Documents\houdini15.5\PARMmenu.xml).
When you restart houdini, you *should* get a “push override” item in the parameter right-click menu when you’re in a take.
<?xml version="1.0" encoding="UTF-8"?> <menuDocument> <menu> <scriptItem id="pushOveride"> <label>Push Override</label> <context> <expression>hou.takes.currentTake() != hou.takes.rootTake()</expression> </context> <insertAfter>take_activate</insertAfter> <scriptCode><![CDATA[ parms = kwargs['parms'] if parms: parm = parms[0] pt = parm.tuple() ctake = hou.takes.currentTake() for p in ctake.parmTuples(): if p == pt: keyframes = {} for parm in p: if parm.keyframes(): keyframes[parm.path()] = parm.keyframes() else: if parm.parmTemplate().type().name() == 'String': if parm.unexpandedString(): keyframes[parm.path()] = parm.unexpandedString() else: keyframes[parm.path()] = parm.eval() else: keyframes[parm.path()] = parm.eval() rootTake = hou.takes.rootTake() updateMode = hou.updateModeSetting() hou.setUpdateMode(hou.updateMode.Manual) hou.takes.setCurrentTake(rootTake) for k in keyframes: hou.parm(k).deleteAllKeyframes() if type(keyframes[k]) is tuple: for key in keyframes[k]: hou.parm(k).setKeyframe(key) else: hou.parm(k).set(keyframes[k]) hou.takes.setCurrentTake(ctake) ctake.removeParmTuple(p) hou.setUpdateMode(updateMode) ]]></scriptCode> </scriptItem> </menu> </menuDocument>