Question about unique names in loops for each.
3792 3 4- Nicolas Heluani
- Member
- 280 posts
- Joined: 12月 2015
- Offline
Hi everyone,
Anyone knows how to reach the iteration number in a for each loop to use it as a name in objects I create inside it?
Basically I am trying to give unique names to pieces from a voronoid fracture that runs multiple times inside a for each loop.
Like piece_Iteration01_01, piece_Iteration01_02 and next iteration (part processed) will be piece_Iteration02_01, piece_Iteration02_02 I hope I am making sense here.
I attached a simple hip file to focus on what I meant. As you can see all pieces out of the for each loop have same Piece0,piece1,piece2,piece4 name. I assume this is an issue with wathever we create in the for each loop. so there must be a way to add a unique id to each iteration right?
Any help will be greatly appreciated.
Nico.
Anyone knows how to reach the iteration number in a for each loop to use it as a name in objects I create inside it?
Basically I am trying to give unique names to pieces from a voronoid fracture that runs multiple times inside a for each loop.
Like piece_Iteration01_01, piece_Iteration01_02 and next iteration (part processed) will be piece_Iteration02_01, piece_Iteration02_02 I hope I am making sense here.
I attached a simple hip file to focus on what I meant. As you can see all pieces out of the for each loop have same Piece0,piece1,piece2,piece4 name. I assume this is an issue with wathever we create in the for each loop. so there must be a way to add a unique id to each iteration right?
Any help will be greatly appreciated.
Nico.
- tamte
- Member
- 8583 posts
- Joined: 7月 2007
- Offline
you need to create new Block Begin SOP in Metadata mode and point it to your foreach_end1, there you will find detail attribute called iteration
the easiest way to create it is to select your foreach_begin1 node and click on Create Meta Import Node button
then you can reference that detail attribute wherever you want, in case of example file in voronoifracture2/Attributes/NamePrefix
the easiest way to create it is to select your foreach_begin1 node and click on Create Meta Import Node button
then you can reference that detail attribute wherever you want, in case of example file in voronoifracture2/Attributes/NamePrefix
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- mestela
- Member
- 1743 posts
- Joined: 5月 2006
- Offline
- Nicolas Heluani
- Member
- 280 posts
- Joined: 12月 2015
- Offline
-
- Quick Links