Share

Lock layers in the USD Layer Editor

When a layer is locked, you cannot target or add sublayers to it. If a locked layer has sublayers, the sublayers cannot have new parent layers added to them. You can lock the layers either through the UI or enforce system-level locks.

Lock layers through the UI

  • You can lock a layer by clicking the lock icon or selecting Lock from the context menu.
  • When locking multiple layers, highlight the layers in the USD Layer Editor > right click > select Lock from the context menu.
  • You can lock a layer together with its sublayers using the Lock Layer and Sublayers option in the context menu.
  • An anonymous layer can be locked in the same manner as a layer saved on file. A locked anonymous layer can still be saved. It will remain locked after being saved.
  • The lock state is saved as part of the Maya data, ensuring its persistence even after reopening the project.
Note:

The sessionLayer will be automatically targeted in the following situations:

  • When all the layers are locked or muted
  • When a stage is created from a locked file

System lock

Administrators can enforce system-level locks on layers, preventing standard users from unlocking them. This can be done via Mel or Python scripts, or by locking the USD file on disk. The system-locked layers are easily identifiable by the disabled lock icons.

Note:

System locks are not saved as part of the Maya data.

Here is an example code for system-locking a layer using MEL scripts:

// Lock Type: 0 = Unlocked, 1 = Locked and 2 = System-Locked. 
// Include Sublayers : 0 = Top Layer Only, 1 : Top and Sublayers
// example: System-lock lighting_shot_1.usda

mayaUsdLayerEditor -edit -lockLayer 2 0 "|shot_1|shot_1Shape" "d:/Assets/lighting_shot_1.usda"

See Layer Locking for more information.

Was this information helpful?