maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

Support attribute on MayaReference prim to toggle -mergeNamespacesOnClash flag

Open ika-rporter opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. The UsdMayaTranslatorMayaReference::LoadMayaReference function is hard coded to call -mergeNamespacesOnClash false. This means that if you create an AL_usdmaya_ProxyShape node in a namespace (eg, my_asset_1:proxy), that is proxy for an asset, it is not possible for the rig to load in the same namespace. To avoid an off-by-one error (eg, my_asset_2:rig), you have to salt the namespace (eg, _my_asset_1:rig) or nest the namespace (eg, rigs:my_asset_1:rig). Either option introduces an undesired complexity in naming conventions.

Describe the solution you'd like The UsdMayaTranslatorMayaReference::LoadMayaReference function searches for an attribute on the MayaReference prim (eg, maya_mergeNamespacesOnClash), whose value is used to set the -mergeNamespacesOnClash flag as true/false.

The default is false to maintain legacy behavior.

Additional context The reason for loading the proxy asset in a namespace is so that the rig can load in the same namespace. If the asset is named "my_asset_1" in the root namespace, then it is not possible to have the rig use "my_asset_1" as a namespace since namespaces must be globally unique.

ika-rporter avatar Jul 09 '20 16:07 ika-rporter