Autodesk / maya-usd

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

Cannot load a maya reference to an usd file from referenceEditor #1672

Open jufrantz opened 3 years ago

jufrantz commented 3 years ago

Describe the bug

When loading an unloaded maya usd reference from the reference editor, maya loses the file type and confuses it with an image. A fcheck process is launched instead of reading the usd hierarchy.

Steps to reproduce

  1. Execute following script to create a reference to the usd file in attached simpleUsdFile.zip.

    from maya import cmds
    cmds.loadPlugin('mayaUsdPlugin')
    refFile = cmds.file('simpleUsdFile.usd', reference=True, deferReference=True, type='USD Import')
  2. Click on the checkBox in the referenceEditor to load the created reference

  3. Notice that the file was not read, and is not handled anymore by "USD Import" translator :

    cmds.file(refFile, q=True, type=True)
    # Result: [u'image'] # 

Specs (if applicable):

Additional context

We noticed that it only occurs with usdc files (with .usd or .usdc extensions) never with usd ascii files. 

santosg87 commented 3 years ago

I can reproduce this on our side as well.

it seems that bringing the file as an unloaded reference causes the usd file not to be imported properly. I was able to import "some" usdc files as a reference succesfully, but the attached file is a good example of a non-working file.

jacobvfx commented 2 years ago

This also happens if you load the reference normally and try to unload/load it again. It effectively means you can't unload/disable a reference of a USD file.

This is quite a big bug and would be good to get fixed in the near future.