Supersaqib Posted February 26, 2014 Share Posted February 26, 2014 Hey Guys, Need some help figuring something out. I have a bunch of points with an id attribute on them. I would like to create a single detail string attribute which is made of all the ids. So i'm left with a detail attribute like: 0 1 2 3 4 Python is probably the best option. I attempted a Vex approach to no avail. Any ideas Quote Link to comment Share on other sites More sharing options...
zdimaria Posted March 3, 2014 Share Posted March 3, 2014 put this in a python sop node = hou.pwd() geo = node.geometry() geo.addAttrib(hou.attribType.Global, 'ids', '') ids = [] for point in geo.points(): ids.append(str(point.attribValue('id'))) geo.setGlobalAttribValue('ids', ' '.join(ids)) Quote Link to comment Share on other sites More sharing options...
anim Posted March 3, 2014 Share Posted March 3, 2014 Attribute Wrangle Run Over: Detail(only once) string ids = ""; for(int i=0;i<@numpt;i++) { ids += itoa(point(0, "id", i)) + " "; } s@ids = ids; 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.