Jump to content

New For Loop and iterating index


Pancho

Recommended Posts

Thanks! I'm able to display the Iteration number like in the video as a font. But how do I use it in a transform node? I tried $ITERATION and the detail(.... approach. The node always turns red. I also tried it with a custom attribute. It doesn't work either, though $CLASS works. I ensured that the attribute is in the same context (point or primitve). Nothing. $CLASS works, but $AVGDST (avgDst is my custom attribute) doesn't. Couldn't find any tips or tricks so far. What I need to do is make transformations on a per primitive basis.

Cheers

Tom

P.S.: Thanks for the video link!

Link to comment
Share on other sites

O.k., I managed to solve my transform problem. At least with my custom attribute, since it is a primitive. Found one of Peter Quint's videos.

To use my attribute I need to type in prim("../nameOfTheNodeBeforeTheTransform", $PR, "avgDst", 0). While this might be verrrrrrry logical for a programer, it feels more than complicated, especially in the small transform entry field.

So, how do I get the iteration into the transform? Guess the formular will be similar, but what kind of object is Iteration? Definitely not a point nor prim.

Link to comment
Share on other sites

If you really need the variable name, copy the iteration attribute to your main SOP tree using an attribcopy SOP and then set the local variable in an attribwrangle node, set to "Detail" mode.  Use this code below:

// Probably set it to be "ITERATION" instead, but if you
// want to replicate the old behavior you could do this...
addvariablename(geoself(), "iteration", "FORVALUE");
Edited by jonp
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...