Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions palletjack_sdg/standalone_palletjack_sdg.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,17 @@ def update_semantics(stage, keep_semantics=[]):
sem = Semantics.SemanticsAPI.Get(prim, instance_name)
type_attr = sem.GetSemanticTypeAttr()
data_attr = sem.GetSemanticDataAttr()

if data_attr.Get() in keep_semantics:
print(f"Semantic class {data_attr.Get()} will be kept!")
break

print(f"Removing semantic class {data_attr.Get()}!")

for semantic_class in keep_semantics:
# Check for our data classes needed for the model
if data_attr.Get() == semantic_class:
continue
else:
# remove semantics of all other prims
prim.RemoveProperty(type_attr.GetName())
prim.RemoveProperty(data_attr.GetName())
prim.RemoveAPI(Semantics.SemanticsAPI, instance_name)
# remove semantics for this prim
prim.RemoveProperty(type_attr.GetName())
prim.RemoveProperty(data_attr.GetName())
prim.RemoveAPI(Semantics.SemanticsAPI, instance_name)


# needed for loading textures correctly
Expand Down