Autodesk / maya-usd

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

[MAYA-121681] / [MAYA-126141] Cannot add new [Def1] #2052

Closed suekieza closed 1 year ago

suekieza commented 2 years ago

Describe the bug

Error: RuntimeError: file C:\appnet\applications\maya\2022-x64\Maya2022\Python27\Lib\site-packages\maya\app\ufe\outlinerSupport.py line 27: Cannot add new [Def1] under [prop]. It is defined on another layer. Please set [seq010_sh010_manifest.usda],[seq010_manifest.usda] as the target layer to proceed.

Why cant I create a new def under the "scope prop"(see image)? I would expect it to add overs to my chosen layer like:

over "shot" { over "prop" { def "def1" {} } }

I don't want to add this def on the "seq010_manifest.usda" layer. I can add to any layer I want using overs in houdini and in USD externally, so why lock this in maya?

scopeprop

Specs (if applicable):

womanyoyoyo-adsk commented 2 years ago

Hi @suekieza. I am able to reproduce and have logged this issue as MAYA-121681.

suekieza commented 2 years ago

cool cool

msercheli commented 2 years ago

@suekieza , we (at the studio I am working for) are experiencing the exact same issue. Since we don't want to create our own set of UsdStage manipulation tools (using USD natively), we would like/need this bug to be resolved as soon as possible. I was about to create a ticket. I am glad you did first.

womanyoyoyo-adsk commented 2 years ago

Hi all, we just scheduled this on our side.

santosg87 commented 2 years ago

@suekieza this should be now fixe don MayaUSD 0.19.0. are you able to test and confirm on your side? :)

msercheli commented 1 year ago

I built tag v0.19.0 and I am getting the same error. Just to be sure we are talking about the same use-case here, here are the steps I am making to see the error:

def Xform "top_prim" { def Xform "first_child" { } }

- Open this USD layer into Maya and set the **session layer** as the active target
- Select the **first_child** prim in the Maya outliner, right-click and run **Add New Prim > Def**

Error:

Error: Cannot add new [Def2] under [first_child]. It is defined on another layer. Please set [new_def_test.usda] as the target layer to proceed.

Traceback (most recent call last):

File "/mnt/rez/softwares/binaries/maya/2023.0/maya2023/lib/python3.9/site-packages/maya/app/ufe/outlinerSupport.py", line 26, in doOp

cmd = contextOps.doOpCmd(itemPath)

RuntimeError: Cannot add new [Def2] under [first_child]. It is defined on another layer. Please set [new_def_test.usda] as the target layer to proceed.



Maya allows the creation of the new "def" only if the active target is the layer that the parent prim is defined.
What I am expecting is that, using the session layer, I could define a new prim, and Maya would create the parent hierarchy using "over" prims.

@santosg87 , could you give us a step-by-step to reproduce your fix? Just to be sure we are in the same page.
Thanks.
santosg87 commented 1 year ago

ah! I think I see the issue better now.

on our testing, we found that opinions on ancestors couldn't be added previously. That was the fix that we included.

after re-reading this issue quite a few times, this is about sister layers, not a hierarchy issue.

our workflow that now works is:

I logged a new issue for the adjacent layers internally for investigating. internal ticket ID [MAYA-126141]

santosg87 commented 1 year ago

@suekieza @msercheli this issue should be fixed with #2720. I have tested internally and creating a prim is possible in any layer.

are you able to build with that commit and test on your side? otherwise, this should be available on future releases of mayausd :)

msercheli commented 1 year ago

Hi @santosg87 ,

Thanks for the fix. I see the removal of the code that was preventing it. I don't think I will have time to build, but I am sure it's fixed. I will wait until tag 0.21.0.

Once again, thanks.