Jump to content

Array contains single primitive as 0 ?


CinnamonMetal

Recommended Posts

I'm looping over all primitives but rather then primitives 5,6,7,8 being stored in a single array, each primitive is being stored in it's own array ? 

Since I'm using a primitive wrangler within a forEach SOP, I assume the reason why each primitive is being stored as primitive 0 rather then the primitive number; the iteration attribute has to be imported into the primitive wangler ?

 int oneMerge = detailattrib(0,"lopping",0,accept);

prim_Num.png

 

Link to comment
Share on other sites

Because you're iterating for each primitive. That means that there's only one primitive per iteration through the loop, so the only primitive you can see is primitive zero.

It's beating a dead horse at this point, but this is one of many reasons why you should use primitive wrangles rather than for-each loops when you want to iterate over a set of primitives.

  • Thanks 1
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...