Jump to content

For Each attribute


Recommended Posts

I'm running into an issue where I'm trying to assigning Prim attributes inside a "for-each count" with a wrangle. I'm aware they made changes to how for-each loops work since 16.5. but is there a way to promote the attributes some how?

I saw that some one made some example in the past... but it doesn't work for what I need. using a name mask before the loop won't work with my set up.

 

Is there a way to assign id's a in a wrangle inside the for-loop?

Thanks,

 

Link to comment
Share on other sites

1 hour ago, woodenduck said:

You can assign any attribute, id's or anything you like inside a foreach with any of the usual tools. Wrangle, attribute sop, vop sop etc...

What exactly are you trying to do? Do you have an example of it not working? 

Cheers, 

WD

 

Your right it looks like i have an error "metadata cooked outside its block, so it's not generating the expected attributes."

But in a nutshell, I'm creating attributes on incoming and out coming points, promoting to prim attributes then assigning "direction" attributes to separate pieces  to each prim.

Now I have to figure why it's cooking outside the block.

 

 

Link to comment
Share on other sites

11 hours ago, jonidunno said:

Tried to simplify as much as possible... just follow the yellow subnets.

Thanks,

ForEach_Help_JL_001.hip

I noticed you are using expression nprims(opinputpath(".", 0)) in many places on "block end" nodes inside parameter "Iterations" and in this manner you refer to node itself. I think it should be nprims(opinputpath("..", 0)), then you refer to parent node. Tray to check this and maybe it helps you resolve your problem.

  • Like 1
Link to comment
Share on other sites

4 hours ago, vicvvsh said:

I noticed you are using expression nprims(opinputpath(".", 0)) in many places on "block end" nodes inside parameter "Iterations" and in this manner you refer to node itself. I think it should be nprims(opinputpath("..", 0)), then you refer to parent node. Tray to check this and maybe it helps you resolve your problem.

lol.. derp, that's exactly what was happening thanks for the extra eyes!  

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...