Last active
May 29, 2018 13:28
-
-
Save campos-rafael/30dd8b8242af4c37c5fa7baf16f8808a to your computer and use it in GitHub Desktop.
Houdini Shelf Tool - Transform point selection into a Curve SOP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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