Jump to content
Sign in to follow this  
Supersaqib

detail string append

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

Share this post


Link to post
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))

Share this post


Link to post
Share on other sites

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;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×