For each variant?

   1454   2   2
User Avatar
Member
21 posts
Joined: 5月 2015
Offline
Hello!

I'm trying to iterate thru a prim's variants.

I expected it to work the way as SOP for each does. When I display Null1, it would show current variant being iterated. But it does not. What did I get wrong here?

And is it possible to apply different value clip to each variant?

Thanks!
Edited by NMVHS - 2023年1月11日 12:30:47

Attachments:
for_each_variant.hip (125.7 KB)
foreach_variant.png (38.1 KB)
foreach_variant_2.png (29.2 KB)

User Avatar
スタッフ
4158 posts
Joined: 9月 2007
Offline
The For Each LOP is not actually changing the variant, it's just cycling through the variant set's values (i.e. all of the "model" variants). Similarly, when iterating over primitives or numbers, those are just values filling out the context option values.

To see these values in this case, you could use a Set Variant LOP. Set the prim path to "/model" and variant set name to "model". Then you can use `@VARIANTNAME` set the variant. If you don't want to author the setting of this variant, append a Layer Break after the Set Variant node.

To edit the variants via For Each LOP, you'll also need an Add Variants LOP. You just need to make sure all of your additions/modifications are children of the variant primitive (i.e. "/test" in this case).

This is a workflow we want to improve in future releases. Hopefully this example helps in the meantime.

Attachments:
for_each_variant_modified.hip (200.5 KB)
screenshot_2023-01-11_13.26.21_img.png (303.0 KB)

I'm o.d.d.
User Avatar
Member
21 posts
Joined: 5月 2015
Offline
goldleaf
The For Each LOP is not actually changing the variant, it's just cycling through the variant set's values (i.e. all of the "model" variants). Similarly, when iterating over primitives or numbers, those are just values filling out the context option values.

To see these values in this case, you could use a Set Variant LOP. Set the prim path to "/model" and variant set name to "model". Then you can use `@VARIANTNAME` set the variant. If you don't want to author the setting of this variant, append a Layer Break after the Set Variant node.

To edit the variants via For Each LOP, you'll also need an Add Variants LOP. You just need to make sure all of your additions/modifications are children of the variant primitive (i.e. "/test" in this case).

This is a workflow we want to improve in future releases. Hopefully this example helps in the meantime.
This is very helpful. Thanks!
  • Quick Links