Jump to content

no hou.selectedParms() ?


lemond

Recommended Posts

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 by lemond
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by lemond
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...