Jump to content

Point Attributes to Creep SOP in Foreach point loop


Recommended Posts

Hi, 

I'm a bit stuck on how to get point attributes working per point in a creep sop inside a foreach SOP.
In the attached file I created 10 points at world origin, gave them an x_pos attribute that is the same for every point. I gave them a y_pos attribute that varies per point. 
I hooked in the attributes via a spare input on the creep sop (same behaviour observed via spare input or direct reference). The x_pos will work making all the points travel around the object but the y_pos does not. If I modify x_pos so that it is a unique value per point it stops working. 

Could someone help me to see what I'm missing please? 

 

creep_point_attrs.hipnc

Link to comment
Share on other sites

You're always just looking for the point with the point number 0 in your expression 

point("../pointwrangle1", 0, "y_pos",0)

if you replace the 0 with a reference to the iteration of the for loop via the foreach_begin1_metadata1 node you can change it to this

point("../pointwrangle1", detail("../foreach_begin1_metadata1/", "iteration", 1), "y_pos", 0)

or with the spare input

point(-1, detail("../foreach_begin1_metadata1/", "iteration", 1), "y_pos", 0)

or, what i would do, since you're already only having one point when iterating through them in the for loop, is just not accessing the pointwrangle1, where you have 10 points, but rather the creep SOP inside the loop itself, where you only have the point 0 anyway.

point(0, 0, "y_pos",0)

 

creep_point_attrs.hipnc

Edited by Gorrod
Link to comment
Share on other sites

Ahhh, many thanks. I was confused because when you set a foreach to single pass the point num will always be shown as 0 so I thought the loop would always treat each new point in the loop as 0, but I didn't reference from the right place. Over complication!

Edited by nadmai
extra detail added
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...