Jump to content

adding new parameter and action button with python


martinkindl83

Recommended Posts

hi guys, im stuck with creating action button with the python
anyone has experience with that?

With python im creating extra parameter on node
newparam = hou.StringParmTemplate("group2", "Group from viewport", 1)

and i need to add the Action button to this parameter with extra python script


import soputils
kwargs['geometrytype'] = (hou.geometryType.Primitives,)
kwargs['inputindex'] = 0
soputils.selectGroupParm(kwargs)


Any ideas how to do that?

Link to comment
Share on other sites

  • 1 month later...

would you please know how to:

enable Use Menu on menu tab

change it to Toggle (Field + Multiple)

set it to Python Script

and use this script inside?

node = hou.pwd()
geo = node.geometry()
res = list()
groups = geo.primGroups()
for i in range(len(groups)):
    name = groups[i].name()
    res.append(name)
    if name in (kwargs['parm'].eval().split(' ')):
        name += ' *'
    res.append(name)
    

return res

thats the last piece im missing

  • Thanks 1
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...