Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-123262 - Applied schemas in are broken in the AE template with U… #2368

Merged
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
14 changes: 9 additions & 5 deletions lib/mayaUsd/resources/ae/usdschemabase/ae_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ def createCustomExtraAttrs(self):
def createAppliedSchemasSection(self):
# USD version 0.21.2 is required because of
# Usd.SchemaRegistry().GetPropertyNamespacePrefix()
if Usd.GetVersion() < (0, 21, 2):
usdVer = Usd.GetVersion()
if usdVer < (0, 21, 2):
return

showAppliedSchemasSection = False
Expand All @@ -577,7 +578,7 @@ def createAppliedSchemasSection(self):
schemaAttrsDict = {}
appliedSchemas = self.prim.GetAppliedSchemas()
for schema in appliedSchemas:
if Usd.GetVersion() > (0, 21, 5):
if usdVer > (0, 21, 5):
typeAndInstance = Usd.SchemaRegistry().GetTypeNameAndInstance(schema)
else:
typeAndInstance = Usd.SchemaRegistry().GetTypeAndInstance(schema)
Expand All @@ -592,9 +593,12 @@ def createAppliedSchemasSection(self):
attrList = schemaType.pythonClass.GetSchemaAttributeNames(False, instanceName)
# build the real attr name
# By example, collection:lightLink:includeRoot
namespace = Usd.SchemaRegistry().GetPropertyNamespacePrefix(typeName)
prefix = namespace + ":" + instanceName + ":"
attrList = [prefix + i for i in attrList]
# In 0.22.3 USD will now use the fully namespaced name in the schema definition,
# so it does not need to be assembled.
if usdVer < (0, 22, 3):
namespace = Usd.SchemaRegistry().GetPropertyNamespacePrefix(typeName)
prefix = namespace + ":" + instanceName + ":"
attrList = [prefix + i for i in attrList]

if typeName in schemaAttrsDict:
schemaAttrsDict[typeName] += attrList
Expand Down