lemond Posted April 13, 2010 Share Posted April 13, 2010 (edited) I'm looking for a command to return selected parameters. Example, user selects ch("obj/box_object1/rx") and ch("obj/box_object2/rx") hou.selectedParms() would return those selected parameters. What is the best way to do this? Edited April 13, 2010 by lemond Quote Link to comment Share on other sites More sharing options...
graham Posted April 13, 2010 Share Posted April 13, 2010 There is no notion of selected parameters in Houdini so I'm not sure what it is you are asking for. The only ways to interact with parms are to either have callback scripts assigned to parameters, or add some type of entry in the PARMmenu.xml file to allow you to do things to parameters from the RMB menu. I'm thinking the later is in the direction of what you are after but I can't be certain without more info. Quote Link to comment Share on other sites More sharing options...
lemond Posted April 13, 2010 Author Share Posted April 13, 2010 (edited) There is no notion of selected parameters in Houdini so I'm not sure what it is you are asking for. The only ways to interact with parms are to either have callback scripts assigned to parameters, or add some type of entry in the PARMmenu.xml file to allow you to do things to parameters from the RMB menu. I'm thinking the later is in the direction of what you are after but I can't be certain without more info. Here is my code. But, I want to avoid hard coding the parameters. I don't want to add another read input. import random min = hou.ui.readInput("Enter Min Value") max = hou.ui.readInput("Enter Max Value") min=float(min[1]) max=float(max[1]) def randomizeParmValue(node_list, parm_name, min, max): for node in node_list: value = random.uniform(min,max) print "parm to change %s at a value of %s" % (value, parm_name) node.parm(parm_name).set(value) selectedNodes = hou.selectedNodes() #hard coded parameters randomizeParmValue(selectedNodes, 'tz', min, max) randomizeParmValue(selectedNodes, 'ty', min, max) randomizeParmValue(selectedNodes, 'tx', min, max) [/code] Edited April 13, 2010 by lemond 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.