Autodesk / Autodesk/maya-usd

Support attribute on MayaReference prim to toggle -mergeNamespacesOnClash flag

Open
#640 0 comments 0 reactions 0 assignees View on GitHub
al enhancement schema
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 5h
Merged PRs (30d)
16

Description

**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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with UsdMayaTranslatorMayaReference::LoadMayaReference, the entry point named in the issue, and inspect how the MayaReference prim is read before the reference is loaded. Add support for the named attribute while preserving false as the default; done means the attribute controls -mergeNamespacesOnClash without changing legacy behavior.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.