Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
751 stars 199 forks source link

[MAYA-114855] Crash when interacting with outliner after unloading payload #1688

Open eddiehoyle opened 2 years ago

eddiehoyle commented 2 years ago

Describe the bug Maya crashes if user interacts with USD hierarchy in Maya's outliner if a prim with payloads is unloaded while expanded.

Steps to reproduce

Note: This repro has been manually copied and typed out (internal network restrictions, sorry) and is untested.

  1. Save these layers to disk in the same folder:
    // entry.usda
    #usda 1.0
    (
       defaultPrim = "entry"
    )
    def "entry" (
       kind = "component"
       append payload = @./payload.usda@</entry>
    ) {}
    // payload.usda
    #usda 1.0
    over "entry" {
       def Cube "cube" {
       }
    }
  2. In Maya, create proxy from file "entry.usda" with payloads enabled and expand the outliner hierarchy. You should see the following:
    proxy             # transform
       shape         # shape
           entry     # /entry
               cube  # /entry/cube
  3. Unload payload prim
    import mayaUsd
    from maya import cmds
    stage = mayaUsd.ufe.getStage("|world{}".format(cmds.ls(type="mayaUsdProxyShape", long=True)[0]))
    entry = stage.GetPrimAtPath("/entry")
    entry.Unload()
  4. Try to select, or collapse USD hierarchy in Maya outliner
  5. crash

Error message:

maya.bin crashed. FATAL ERROR: Used expired 'Cube' prim </entry/cube>

If the hierarchy is collapsed before calling Unload, no crash occurs. My guess the outliner needs to be refreshed.

Expected behavior The outliner should refresh, display the correct USD structure (payload pruned) and should not crash.

Specs:

santosg87 commented 2 years ago

@eddiehoyle I am trying to reproduce this one for a bit of time now, but no luck.

this seems to behave as expected on my side. are you able to test this on the latest mayaUSD build to confirm?

eddiehoyle commented 2 years ago

Hey @santosg87, I just tried a build of:

And can still reproduce the crash. We don't have 2022 in-house yet so can't check if that's the issue.

I just noticed my example usda files were invalid too. I fixed their cookies to be #usda 1.0 instead of # usda 1.0. I'll try a usd 21.08 build next.

santosg87 commented 2 years ago

@eddiehoyle thanks for the info! this seems to be indeed something specific to 2020 only. I am able to repro this on 2020.4, but not on 2022 builds.

given that this is something specific to 2020, my guess is that there is some UFE support missing in there.

santosg87 commented 2 years ago

@eddiehoyle we have a fix for this issue merged now. are you able to test and confirm?

eddiehoyle commented 2 years ago

Hi @santosg87, I've since moved to another company so don't have access to the tickets original environment for testing. I'll follow up here if I run into this issue again. Thanks for taking a look!

maya-usd-git-sync[bot] commented 8 months ago

Issue synced internally to EMSUSD-671