[EMSUSD-1949] Group an "over" prim with reference cause the reference to be flattened and the prim to become a "def"
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Describe the bug**
When a proxy node session layer has an "over" prim referencing an external USD layer, when users group that prim using ctrl+g, the prim becomes a "def" and the reference is flattened in the session layer.
**Steps to reproduce**
1. Have a USD file saved somewhere on disk with a default prim (mesh for instance).
2. Run the following code in ScriptEditor:
```
import mayaUsd
usd_filepath = # replace with an actual value
proxy_node = cmds.createNode("mayaUsdProxyShape", name="TestShape")
proxy_node = cmds.ls(proxy_node, long=True)[0]
stage = mayaUsd.ufe.getStage(proxy_node)
over_prim = stage.OverridePrim("/newPrim")
over_prim.GetReferences().AddReference(usd_filepath)
```
3. Open Usd Layer Editor, right-click the target layer and "Print to Script Editor"
4. Notice that the prim is an "over" that references the external USD file
5. Expand Outliner and select the "newPrim" prim
6. Ctrl+g (for grouping the new prim)
7. Notice that the prim is a "def" and the referenced USD file is not flattened in the target layer.
**Expected behavior**
Keep the prim being grouped intact.
**Specs (if applicable):**
- Linux Rocky 9
- Compiler & version [e.g. gcc 11.2.1]
- Maya 2025.3
- MayaUsd 0.30.0
- USD 0.23.11
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.