Skip to content

Maya crashes on file open when a maya scene with a mayaUsdProxyShape is referenced multiple times #4087

@radon199

Description

@radon199

Describe the bug
When you reference the same external maya scene file multiple times and that scene contains a mayaUsdProxyShape, Maya will crash on file open.

This behavior does not happen when there is only a single reference, or two references to two different maya files.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a mayaUsdProxyShape pointing to a USD layer in a scene, and save that scene as a MB or MA file.
  2. Create a new scene, and reference the MB or MA file from step 1 twice. It must be the same MB or MA file, not different files.
  3. Save the scene, reset Maya to a new scene, and then open the saved scene.
  4. Maya will crash.

Expected behavior
Maya should open a scene with multiple references to an external file containing a mayaUsdProxyShape.

Specs (if applicable):

  • Windows 10
  • Maya 2022.5 and 2024.2
  • maya_usd-0.26.0 and maya_usd-0.30.0

Additional context
We have debugged it down to this line :

MPlug forceCompute(node, _forceCompute);

I think what is happening is _forceCompute is not defined at this stage. When we have multiple references to the same file, somehow this ends up not defined.
Instead of getting the MPlug directly, you can turn the MObject into a MFnDependencyNode and use findPlug with the attribute name as a MString. This is safe and doesn't cause the crash on load.

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