-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I'm using MayaUsd version 0.33.0 with Maya 2024.
This version uses USD version 22.11.
In this version of USD Usd.PrimDefinition doesn't have the GetAttributeDefinition method, it was introduced later (from version 23, maybe)
If I have a codeless schema applied to a prim, the attribute editor will report this error when I click on it:
AttributeError: file ...\Maya2024\0.33.0\MayaUSD\lib\python\ufe_ae\usd\nodes\usdschemabase\ae_template.py line 566: 'PrimDefinition' object has no attribute 'GetAttributeDefinition'
and display a "broken" widget (an attribute editor UI that is not useful and doesn't include all the elements that it is supposed to include)
The part of the code that lead to this problem is this:
...
if schemaType.pythonClass:
...
else:
schemaPrimDef = Usd.SchemaRegistry().FindAppliedAPIPrimDefinition(typeName)
attrList = schemaPrimDef.GetPropertyNames()
attrList = [name for name in attrList if schemaPrimDef.GetAttributeDefinition(name)]
if isMultipleApplyAPISchema:
instanceName = typeAndInstance[1]
attrList = [name.replace('__INSTANCE_NAME__', instanceName) for name in attrList]
schemasAttributes[typeName] = attrList
and it should be replaced by something like this
...
if schemaType.pythonClass:
...
else:
schemaPrimDef = Usd.SchemaRegistry().FindAppliedAPIPrimDefinition(typeName)
attrList = schemaPrimDef.GetPropertyNames()
if usdVer > (0, 22, 11):
attrList = [name for name in attrList if schemaPrimDef.GetAttributeDefinition(name)]
if isMultipleApplyAPISchema:
instanceName = typeAndInstance[1]
attrList = [name.replace('__INSTANCE_NAME__', instanceName) for name in attrList]
schemasAttributes[typeName] = attrList
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working