Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-110727 - Crash when editing Layer That has Permission to Edit false (locked) #1363

Merged
merged 6 commits into from
Apr 26, 2021

Conversation

alsoussi
Copy link
Contributor

Fixed the problem, also added a function to do this for both muted and locked layers (and possibly user locked layers in the future). Also added the block for adding and attribute changes. This probably doesn't cover all the cases, but its good enough for now.

…lse (locked)

Fixed the problem, also added a function to do this for both muted and locked layers (and possibly user locked layers in the future). Also added the block for adding and attribute changes. This probably doesn't cover all the cases, but its good enough for now.
@alsoussi alsoussi added bug Something isn't working ufe-usd Related to UFE-USD plugin in Maya-Usd labels Apr 22, 2021
lib/mayaUsd/ufe/Utils.cpp Outdated Show resolved Hide resolved
lib/mayaUsd/ufe/Utils.cpp Outdated Show resolved Hide resolved
@alsoussi
Copy link
Contributor Author

After checking it seems that the test is failing on 2020, python 2, I looked at the log and found this:

     17/128 Test  #14: maya-usd\lib\mayaUsd\ufe\UsdTransform3d.cpp............................***Failed    7.85 sec
    Plug-in, "ufeSupport", was not found on MAYA_PLUG_IN_PATH.
    
    Unable to load ufeSupport
    Warning: This file is from an older version of Maya.  If saved, it will not be readable by previous versions.
    File read in  0.56 seconds.
    Error: Cannot create spec at </pCylinder1>. Layer @anon:000002D5305ED360:LayerA@ is not editable. -- Coding Error in _CreateSpec at line 4003 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\layer.cpp
    Error: Failed to create spec of type 'SdfSpecTypePrim' at </pCylinder1> -- Coding Error in CreateSpec at line 101 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\childrenUtils.cpp
    Error: Failed to create prim at path '/pCylinder1' in layer @anon:000002D5305ED360:LayerA@ -- Runtime Error in Sdf_UncheckedCreatePrimInLayer at line 964 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\primSpec.cpp
    Error: Cannot create an SdfAttributeSpec with a null owner -- Coding Error in New at line 61 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\attributeSpec.cpp
    Error: Unable to add xform op of type TypeTranslate and precision PrecisionDouble on prim at path </pCylinder1>. opSuffix=, isInverseOp=0 -- Coding Error in AddXformOp at line 228 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformable.cpp
    Error: Failed verification: ' t ' -- Coding Error in _GetOrAddCommonXformOps at line 872 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformCommonAPI.cpp
    Error: Cannot create spec at </pCylinder1>. Layer @anon:000002D5305ED360:LayerA@ is not editable. -- Coding Error in _CreateSpec at line 4003 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\layer.cpp
    Error: Failed to create spec of type 'SdfSpecTypePrim' at </pCylinder1> -- Coding Error in CreateSpec at line 101 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\childrenUtils.cpp
    Error: Failed to create prim at path '/pCylinder1' in layer @anon:000002D5305ED360:LayerA@ -- Runtime Error in Sdf_UncheckedCreatePrimInLayer at line 964 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\primSpec.cpp
    Error: Failed verification: ' primSpec ' -- Coding Error in _CreatePropertySpecForEditing at line 1433 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usd\stage.cpp
    Error: Cannot create spec at </pCylinder1>. Layer @anon:000002D5305ED360:LayerA@ is not editable. -- Coding Error in _CreateSpec at line 4003 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\layer.cpp
    Error: Failed to create spec of type 'SdfSpecTypePrim' at </pCylinder1> -- Coding Error in CreateSpec at line 101 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\childrenUtils.cpp
    Error: Failed to create prim at path '/pCylinder1' in layer @anon:000002D5305ED360:LayerA@ -- Runtime Error in Sdf_UncheckedCreatePrimInLayer at line 964 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\primSpec.cpp
    Error: Failed verification: ' primSpec ' -- Coding Error in _CreatePropertySpecForEditing at line 1433 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usd\stage.cpp
    Error: Cannot set attribute value.  Failed to create attribute spec </pCylinder1.xformOpOrder> in layer @anon:000002D5305ED360:LayerA@ -- Runtime Error in _SetValueImpl at line 5850 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usd\stage.cpp
    Error: Cannot create spec at </pCylinder1>. Layer @anon:000002D5305ED360:LayerA@ is not editable. -- Coding Error in _CreateSpec at line 4003 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\layer.cpp
    Error: Failed to create spec of type 'SdfSpecTypePrim' at </pCylinder1> -- Coding Error in CreateSpec at line 101 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\childrenUtils.cpp
    Error: Failed to create prim at path '/pCylinder1' in layer @anon:000002D5305ED360:LayerA@ -- Runtime Error in Sdf_UncheckedCreatePrimInLayer at line 964 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\primSpec.cpp
    Error: Cannot create an SdfAttributeSpec with a null owner -- Coding Error in New at line 61 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\sdf\attributeSpec.cpp
    Error: Unable to add xform op of type TypeTranslate and precision PrecisionDouble on prim at path </pCylinder1>. opSuffix=, isInverseOp=0 -- Coding Error in AddXformOp at line 228 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformable.cpp
    Error: Failed verification: ' t ' -- Coding Error in _GetOrAddCommonXformOps at line 872 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformCommonAPI.cpp
    Failed to translate prim |world|mayaUsdTransform|shape/pCylinder1 - Unable to SetTranslate after conversion to CommonAPI.
    	File: S:\jenkins\workspace\ecg-mayausd-branch-preflight-2020-windows\ecg-maya-usd\maya-usd\lib\mayaUsd\ufe\private\Utils.cpp
    	Line: 212
    	Function: MayaUsd_v0::ufe::translateOp
    EClearing USD Stage Cache
    Clearing USD Stage Cache
    Warning: This file is from an older version of Maya.  If saved, it will not be readable by previous versions.
    File read in  0.026 seconds.
    Error: Unable to add xform op of type TypeTranslate and precision PrecisionDouble on prim at path </pCylinder1>. opSuffix=, isInverseOp=0 -- Coding Error in AddXformOp at line 228 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformable.cpp
    Error: Failed verification: ' t ' -- Coding Error in _GetOrAddCommonXformOps at line 872 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformCommonAPI.cpp
    Error: Unable to add xform op of type TypeTranslate and precision PrecisionDouble on prim at path </pCylinder1>. opSuffix=, isInverseOp=0 -- Coding Error in AddXformOp at line 228 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformable.cpp
    Error: Failed verification: ' t ' -- Coding Error in _GetOrAddCommonXformOps at line 872 of S:\jenkins\workspace\ecg-usd-full-windows@2\ecg-usd-build\usd\pxr\usd\usdGeom\xformCommonAPI.cpp
    Failed to translate prim |world|mayaUsdTransform|shape/pCylinder1 - Unable to SetTranslate after conversion to CommonAPI.
    	File: S:\jenkins\workspace\ecg-mayausd-branch-preflight-2020-windows\ecg-maya-usd\maya-usd\lib\mayaUsd\ufe\private\Utils.cpp
    	Line: 212
    	Function: MayaUsd_v0::ufe::translateOp
    E
    ======================================================================
    ERROR: testTranslateLockedLayer (testBlockedLayerEdit.BlockedLayerEditTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "testBlockedLayerEdit.py", line 156, in testTranslateLockedLayer
        cylinderT3d.translate(5.0, 6.0, 7.0)
    RuntimeError: Unable to SetTranslate after conversion to CommonAPI.
    
    ======================================================================
    ERROR: testTranslateMutedLayer (testBlockedLayerEdit.BlockedLayerEditTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "testBlockedLayerEdit.py", line 103, in testTranslateMutedLayer
        cylinderT3d.translate(5.0, 6.0, 7.0)
    RuntimeError: Unable to SetTranslate after conversion to CommonAPI.
    
    ----------------------------------------------------------------------
    Ran 2 tests in 1.275s
    
    FAILED (errors=2)

It seems that in 2020 Py2 we are not calling the isAttributeAllowedToEdit before the translate command, @ppt-adsk @HamedSabri-adsk is this normal? Seems like we might want to call that function in all cases.

@alsoussi alsoussi added the ready-for-merge Development process is finished, PR is ready for merge label Apr 24, 2021
@kxl-adsk kxl-adsk merged commit 8cda8bf into dev Apr 26, 2021
@kxl-adsk kxl-adsk deleted the t_al-sa/MAYA-111074/locked_layer_crash branch April 26, 2021 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants