Skip to content

exportRoots with instanceable references not exporting source #4593

Description

@mrharris

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
Image

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:
#4118
#4073

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions