-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGetSingleSided.py
More file actions
29 lines (23 loc) · 865 Bytes
/
GetSingleSided.py
File metadata and controls
29 lines (23 loc) · 865 Bytes
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
import omni.usd
# Get stage.
stage = omni.usd.get_context().get_stage()
# Get selection.
selection = omni.usd.get_context().get_selection()
paths = selection.get_selected_prim_paths()
for path in paths:
# Get prim.
prim = stage.GetPrimAtPath(path)
if not prim.IsValid():
continue
try:
singleSidedAttr = prim.GetAttribute("singleSided")
if singleSidedAttr != None and singleSidedAttr.IsValid():
# Get singleSided (True/False).
if singleSidedAttr.Get() != None:
print(f"[{prim.GetName()}] singleSided : {singleSidedAttr.Get()}")
# Set singleSided.
#if prim.GetTypeName() == 'Mesh':
# singleSidedAttr = prim.CreateAttribute("singleSided", Sdf.ValueTypeNames.Bool)
# singleSidedAttr.Set(True)
except Exception as e:
print(e)