agelosc Posted December 19, 2017 Share Posted December 19, 2017 Hi, Is there a way to set a parameter value to the result of an math operation using the current value. In maya for example, in the channel editor you can set the value to "+=10" or "*=2". This will add 10 or multiple by 2 the current value. This makes sense when multiple objects are selected and you want a common relative offset and not an absolute value or an expression. Thanks in advance Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 20, 2017 Share Posted December 20, 2017 For addition/subtraction parameter ladder will work. For more complex expressions you can type in Python Shell pane: for node in hou.selectedNodes(): node.parm('tx').set(node.evalParm('tx') * 2) Or type that in Python Source Editor window and press Apply. In that case you need to remove the code after execution, so it won't run again on file reload. 1 Quote Link to comment Share on other sites More sharing options...
agelosc Posted December 21, 2017 Author Share Posted December 21, 2017 Thank you, I was hoping for a parameter interface feature I might have missed but thanks either way. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 21, 2017 Share Posted December 21, 2017 Something like this? You can have it by installing simple script below: <?xml version="1.0" encoding="UTF-8"?> <menuDocument> <menu> <subMenu id="expression_menu"> <scriptItem id="multi_edit_values"> <label>Multi-Edit Values</label> <scriptCode> <![CDATA[ import hou choice, expression = hou.ui.readInput( 'Multi-Edit Values', initial_contents='$SELF', help='Use $SELF to reference current value.', buttons=('Accept', 'Cancel'), close_choice=1 ) if choice != 1: with hou.undos.group('Multi-Edit Values'): for p in kwargs['parms']: p.setExpression(expression.replace('$SELF', p.evalAsString())) p.deleteAllKeyframes() ]]> </scriptCode> </scriptItem> </subMenu> </menu> </menuDocument> Save this to a file called PARMmenu.xml (Windows example: C:\Users\user\Documents\houdini16.5\PARMmenu.xml). If the file exist, then merge contents under nearest common tag. 5 Quote Link to comment Share on other sites More sharing options...
agelosc Posted December 21, 2017 Author Share Posted December 21, 2017 Well, yes exactly. Awesome, thank you. Quote Link to comment Share on other sites More sharing options...
Richard Costin Posted May 22, 2019 Share Posted May 22, 2019 On 21/12/2017 at 2:12 PM, f1480187 said: Something like this? You can have it by installing simple script below: <?xml version="1.0" encoding="UTF-8"?> <menuDocument> <menu> <subMenu id="expression_menu"> <scriptItem id="multi_edit_values"> <label>Multi-Edit Values</label> <scriptCode> <![CDATA[ import hou choice, expression = hou.ui.readInput( 'Multi-Edit Values', initial_contents='$SELF', help='Use $SELF to reference current value.', buttons=('Accept', 'Cancel'), close_choice=1 ) if choice != 1: with hou.undos.group('Multi-Edit Values'): for p in kwargs['parms']: p.setExpression(expression.replace('$SELF', p.evalAsString())) p.deleteAllKeyframes() ]]> </scriptCode> </scriptItem> </subMenu> </menu> </menuDocument> Save this to a file called PARMmenu.xml (Windows example: C:\Users\user\Documents\houdini16.5\PARMmenu.xml). If the file exist, then merge contents under nearest common tag. THIS.... is fantastic! Many thanks, as an ex Softie it's super helpful to be able to do this (easily) again. Rich. 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.