Assign iteration in a loop as attribute

   301   2   1
User Avatar
Member
23 posts
Joined: 8月 2014
オフライン
Hi there,

I want to procedurally model dice, with the text or pips as actual geometry on the faces. In a loop, I generate the numbers based on iterations and try to set i@face to match the iteration number, but I can’t make it work. The manual method works, but it's well… manual.

So if somebody has a small hint, that would be great.

Kind regards,

Christian
---------
Update:

I made it work by switching from the Attribute Wrangle to an Attribute Create that happily accepted the iteration attribute.
Edited by Schmauch - 2025年11月20日 16:56:57

Attachments:
RD_Face_Orientation.hipnc (298.3 KB)

User Avatar
Member
9372 posts
Joined: 7月 2007
オフライン
your path in
i@face = detail("../foreach_begin", "iteration", 0) + 1;
is invalid to begin with, since the node holding the iteration metadata is called foreach_begin1
but even if it was valid, detail() VEX function expects geometry, so either input number, file path or op: string pointing to sop node
since you want to directly point to sop node you need to specify it as
i@face = detail("op:../foreach_begin1", "iteration", 0) + 1;

but it may be just easier to connect foreach_begin1 to 2nd input of wrangle and do:
i@face = detail(1, "iteration", 0) + 1;
Edited by tamte - 2025年11月20日 17:16:47
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
23 posts
Joined: 8月 2014
オフライン
Thank you for the clarification, it works with the wrangle now as expected. Using the second input.. who could have thought of that Thanks again for helping out.
  • Quick Links