Fix #137942: Grease Pencil: Make layer operators non-editable for linked data

For linked grease pencil data, layer operators are accessible right
now. Grey out them in UI by adjusting poll functions. Also disabled
the individual layer row of tree-view.`

See images in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/137946
This commit is contained in:
Pratik Borhade
2025-06-05 11:55:38 +02:00
committed by Pratik Borhade
parent a4c91939e7
commit afa4eaa96c
5 changed files with 33 additions and 10 deletions

View File

@@ -32,7 +32,8 @@ class GREASE_PENCIL_OT_relative_layer_mask_add(Operator):
(obj := context.active_object) is not None and
obj.is_editable and
obj.type == 'GREASEPENCIL' and
obj.data.layers.active is not None
obj.data.layers.active is not None and
obj.data.is_editable
)
def execute(self, context):