Created
January 13, 2022 19:19
-
-
Save spatial-bit/01ff05fd6e32bbe7a02347b752441c4a to your computer and use it in GitHub Desktop.
USD procedural variants #USD #OMNIVERSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# procedural variants | |
import omni.usd as _usd | |
stage = _usd.get_context().get_stage() | |
rootPrim = stage.GetPrimAtPath('/base_stage') | |
#rootPrim = stage.GetPseudoRoot() | |
vset = rootPrim.GetVariantSets() | |
print(vset.GetNames()) | |
variant_set_name = 'materialVariant' | |
print(f'Has variant set: {vset.HasVariantSet(variant_set_name)}') | |
print(f'Variant selection: {vset.GetVariantSelection(variant_set_name)}') | |
vset.SetSelection(variant_set_name, 'MDL') | |
print(f'Variant selection: {vset.GetVariantSelection(variant_set_name)}') | |
vset.SetSelection(variant_set_name, 'ARNOLD') | |
print(f'Variant selection: {vset.GetVariantSelection(variant_set_name)}') | |
#vset.GetVariantSelection(variant_set_name) | |
#vset.SetSelection(variant_set_name, variant_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment