Autodesk / Autodesk/maya-usd

exportRoots with instanceable references not exporting source

Open
#4,593 0 comments 0 reactions 1 assignee Claimed by @santosg87 View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

**Describe the bug**
If I export maya mesh shapes which are instanced using `exportRoots`, the MayaExportedInstanceSources is not included. I must use `selection=True` to get the expected behaviour.

**Steps to reproduce**
1. Open attached maya scene which contains 3 cube instances under an export group, and a "master" (instance 0?) outside of the group
2. Run the below script to export the "Instances" group in both ways
3. Observe that the exportRoots export does not include the instance source

**Expected behavior**
Expect the instance source to be incliuded under `over "MayaExportedInstanceSources"` in the usd file

**Attachments**
[instance_references.zip](https://github.com/user-attachments/files/27280497/instance_references.zip)
Image

```python
import maya.cmds as cmds

node = "Instances"

with_sel_usd = os.path.join(os.environ["TEMP"], "with_selection.usd")
with_roots_usd = os.path.join(os.environ["TEMP"], "with_exportroots.usd")

# Good
cmds.select(node)
cmds.mayaUSDExport(
f=with_sel_usd,
defaultUSDFormat="usda",
defaultPrim=node,
selection=True,
)

# Bad
cmds.select(None)
cmds.mayaUSDExport(
f=with_roots_usd,
defaultUSDFormat="usda",
defaultPrim=node,
exportRoots=[node],
)

````

**Specs (if applicable):**
- Windows 11
- Maya 2024
- maya_usd 0.35

**Additional context**
There is a related MR and Issue here:
https://github.com/Autodesk/maya-usd/pull/4118
https://github.com/Autodesk/maya-usd/issues/4073

But I beleive that is refereing to point instancing rather than scenegraph instances

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.