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
2441 2 1-
- gnisbet
- Member
- 32 posts
- Joined: 8月 2011
- オフライン
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 - 2021年6月1日 10:07:15
-
- mtucker
- スタッフ
- 4558 posts
- Joined: 7月 2005
- オフライン
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: 8月 2011
- オフライン
-
- Quick Links