martinkindl83 Posted January 29, 2016 Share Posted January 29, 2016 hi guys, im stuck with creating action button with the pythonanyone has experience with that?With python im creating extra parameter on nodenewparam = hou.StringParmTemplate("group2", "Group from viewport", 1)and i need to add the Action button to this parameter with extra python scriptimport soputilskwargs['geometrytype'] = (hou.geometryType.Primitives,)kwargs['inputindex'] = 0soputils.selectGroupParm(kwargs)Any ideas how to do that? Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted February 4, 2016 Share Posted February 4, 2016 newparam = hou.StringParmTemplate("group2", "Group from viewport", 1) newparam.setTags({"script_action": "your script code", "script_action_icon": "path to icon"}) Quote Link to comment Share on other sites More sharing options...
martinkindl83 Posted February 4, 2016 Author Share Posted February 4, 2016 super, thank you very much, that works flawlesly and would you know how to create the "list" containing group names? What im recreating with script is the Group parameter (with list selection and viewport selection) that exists on Delete Node Quote Link to comment Share on other sites More sharing options...
martinkindl83 Posted March 16, 2016 Author Share Posted March 16, 2016 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 1 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.