Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Houdini Shelf Tool - Transform point selection into a Curve SOP
import toolutils
# Works in Houdini 16.5, assumes points are selected inside /obj/geo1.
selection = toolutils.sceneViewer().currentGeometrySelection()
node = selection.nodes()[0]
points = node.geometry().globPoints(selection.mergedSelectionString())
curve = hou.node('/obj/geo1/').createNode('curve')
pstr = ''
for i in range(len(points)):
pstr += str(points[i].position()[0]) + ',' + str(points[i].position()[1]) + ',' + str(points[i].position()[2])
pstr += ' '
curve.parm('coords').set(pstr)
curve.moveToGoodPosition()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment