how to access the points selected in the viewport? python
6434
2
1
pelos
Member
624 posts
Joined: Aug. 2008
Offline
Nov. 25, 2013 5:15 p.m.
i want to create a line from the points i selected in the viewport.
i can select my geometry, do S+2 and select the points / vertex of the geometry.
def get_points():
import toolutils
selection = toolutils
selection = selection.sceneViewer().selectGeometry()
selection = selection.selectionStrings()
#selection is a tupple
print selection
print type(selection)
and returns a tupple where the first index is a tupple with numbers and the second index is empty that looks like this
>>>('21 32 36 40-41 ‘,)
>>><type ’tuple'>
is there a way to get the points as a class and then i can get the position of them OR???
i have to loop the point nomber agains the points in the geometry and if it match then do something with that?
is there a more elgant way to do that?
ops:
graham
Member
1925 posts
Joined: Nov. 2006
Offline
Nov. 25, 2013 5:26 p.m.
Look at hou.Geometry.globPoints().
Graham Thompson, Technical Artist @ Rockstar Games
pelos
Member
624 posts
Joined: Aug. 2008
Offline
Nov. 25, 2013 6:25 p.m.
YEI!!!…. def get_points(): import toolutils selection = toolutils selection = selection.sceneViewer().selectGeometry() node = selection.nodes() selection = selection.selectionStrings() #selection is a tupple print selection print type(selection) selection = list(selection) print selection print node list_of_points = node.geometry().globPoints(selection) print list_of_points return list_of_points get_points()