Drughi Posted March 11, 2019 Share Posted March 11, 2019 Hi! In Cinema there is a feature called fill selection (see gif). I really miss it in Houdini and would like to recreate it using Python. I know some Python, but I've never used it for geometry related stuff. Since I don't know the functions I'm not sure on how to find the corresponding primitives. Can someone help me getting started? How would you approach it? Any help is much appreciated! Quote Link to comment Share on other sites More sharing options...
Drughi Posted March 13, 2019 Author Share Posted March 13, 2019 (edited) I solved it myself. Did it the "easy way" and created the logic in sops. Would still be interesting to do it all in Python, but this way i could easily solve it and its "more procedural". If you are interested in the script - here you go: import toolutils selection = toolutils viewer = selection.sceneViewer() viewer.setPickGeometryType(hou.geometryType.Edges) selection = selection.sceneViewer().selectGeometry() node = selection.nodes()[0] id = node.createOutputNode("attribwrangle", "point_id", 1) id.parm("class").set("point") id.parm("snippet").set("i@point_id = i@ptnum;") id_pos = id.position() blast = id.createOutputNode("blast", "edge_blast") blast.parm("group").set(str(selection)) blast_pos = id_pos + hou.Vector2((2,-1)) blast.setPosition(blast_pos) connectivity = blast.createOutputNode("connectivity", "connectivity", 1) connectivity.parm("attribname").set("split_id") copy = id.createOutputNode("attribcopy", "attribcopy", 1) copy_pos = id_pos + hou.Vector2((0,-3)) copy.setPosition(copy_pos) copy.setInput(1, connectivity, 0) copy.parm("attribname").set("split_id") copy.parm("matchbyattribute").set(1) copy.parm("attributetomatch").set("point_id") promote = copy.createOutputNode("attribpromote", "attribpromote", 1) promote.parm("inname").set("split_id") promote.parm("outclass").set(1) promote.parm("method").set(0) promote.setSelected(1, 1) promote.setDisplayFlag(1) promote.setRenderFlag(1) viewer.setCurrentState("select") viewer.setPickGeometryType(hou.geometryType.Primitives) viewer.setGroupPicking(1) viewer.setGroupListType(hou.groupListType.Primitives) viewer.setGroupListMask("@split_id *") viewer.setGroupListColoringGeometry(1) Edited March 14, 2019 by Drughi 1 Quote Link to comment Share on other sites More sharing options...
schwungsau Posted April 20, 2019 Share Posted April 20, 2019 thanks for sharing ! Quote Link to comment Share on other sites More sharing options...
m-egger Posted September 26, 2019 Share Posted September 26, 2019 No need for a script - just hold down H. Like holding "A" to make a "shortest path" selection with left click or middle click to do a loop. This page is an awesome read: https://www.sidefx.com/docs/houdini/basics/select.html 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.