Skip to content

Instantly share code, notes, and snippets.

@jehutymax
Last active May 29, 2018 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jehutymax/30dd8b8242af4c37c5fa7baf16f8808a to your computer and use it in GitHub Desktop.
Save jehutymax/30dd8b8242af4c37c5fa7baf16f8808a to your computer and use it in GitHub Desktop.
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