Jump to content

detail string append


Supersaqib

Recommended Posts

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

Link to comment
Share on other sites

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))
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...