forked from ColinKennedy/USD-Cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
application_a.py
executable file
·36 lines (22 loc) · 917 Bytes
/
application_a.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Show how to print variant selection export policies."""
# IMPORT FUTURE LIBRARIES
from __future__ import print_function
# IMPORT THIRD-PARTY LIBRARIES
from pxr import Usd, UsdUtils
def main():
"""Run the main execution of the current script."""
print('Printing the export policies')
for variant in UsdUtils.GetRegisteredVariantSets():
print(variant.name, variant.selectionExportPolicy)
print('Done')
stage = Usd.Stage.CreateInMemory()
prim = stage.DefinePrim("/Foo")
variant_set = prim.GetVariantSets().AddVariantSet("some_variant_set")
variant_set.AddVariant("foo")
variant_set.SetVariantSelection("foo")
print('Notice that, unless we actually check the variant selections ourselves, they still get written to-disk.')
print(stage.GetRootLayer().ExportToString())
if __name__ == "__main__":
main()