zshawchaw Posted January 27, 2015 Share Posted January 27, 2015 Hi, When I select points from the viewport, how do I get a value of point attribute in python? I wrote a beginning like this: 1 import toolutils 2 viewer = toolutils.sceneViewer() 3 selection = viewer.selectGeometry('Get Ids From Select Points',geometry_types = [hou.geometryType.Points]) but I don't know how to continue this. thanks Shawn Quote Link to comment Share on other sites More sharing options...
edward Posted January 28, 2015 Share Posted January 28, 2015 Assuming that you only selected from one node inside SOPs, then perhaps something like: (untested) node = selection.nodes()[-1] points_patt = selection.selectionStrings(False)[-1] geo = node.geometry() for pt in geo.globPoints(points_patt): print geo.pointFloatAttribValues("attribute_name") http://www.sidefx.com/docs/houdini13.0/hom/hou/GeometrySelection#nodeshttp://www.sidefx.com/docs/houdini13.0/hom/hou/Geometry#globPoints http://www.sidefx.com/docs/houdini13.0/hom/hou/Geometry#pointFloatAttribValues Quote Link to comment Share on other sites More sharing options...
bandit Posted January 11, 2017 Share Posted January 11, 2017 (edited) i have an array attribute like, i[]@my_attrib. and this has values inside. but each time i have a fatal error and crash, after geo.pointFloatAttribValues("my_attrib"). any suggestions?. generic.hip Edited January 11, 2017 by bandit 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.