However when I do it inside the loop, it doesn't update the naming correctly, if I rename my python node then only the next 3 iterations are correctly named, and not the first one. Sometimes it only loads in 3 of my 4 assets. I know for loops can update a little incorrectly sometimes. Does anyone know how to get around this, or how to set a variant name through python/vex?
Procedurally creating variants in loop - Updates incorrectly
2497 2 1-
- gnisbet
- Member
- 32 posts
- Joined: Aug. 2011
- Offline
So I'm trying to loop through a few assets, and procedurally name them based on the input. I can't figure out how to set the variant name in python, so I'm doing a it a little bit badly and renaming my input python node with what I need, and using the name of the input node as the name of the variant. This works fine outside the loop.
However when I do it inside the loop, it doesn't update the naming correctly, if I rename my python node then only the next 3 iterations are correctly named, and not the first one. Sometimes it only loads in 3 of my 4 assets. I know for loops can update a little incorrectly sometimes. Does anyone know how to get around this, or how to set a variant name through python/vex?
However when I do it inside the loop, it doesn't update the naming correctly, if I rename my python node then only the next 3 iterations are correctly named, and not the first one. Sometimes it only loads in 3 of my 4 assets. I know for loops can update a little incorrectly sometimes. Does anyone know how to get around this, or how to set a variant name through python/vex?
Edited by gnisbet - June 1, 2021 10:07:15
-
- mtucker
- Staff
- 4560 posts
- Joined: July 2005
- Offline
On the Add Variant LOP, the "Variant Name Default" parameter controls the variant name. So just change it to an expression based on the value of `@ITERATION` rather than using the input node's name. I'm a bit surprised you don't end up in some sort of infinite cooking loop by changing the node name during the cook process...
-
- gnisbet
- Member
- 32 posts
- Joined: Aug. 2011
- Offline
-
- Quick Links