Fix: change poll function for add and remove layer operators

Current poll functions allows to use these operator only in edit mode.
Correct function would be `active_grease_pencil_poll` (check for active grease
pencil object instead of the context mode)

Pull Request: https://projects.blender.org/blender/blender/pulls/109238
This commit is contained in:
Pratik Borhade
2023-06-22 13:04:47 +02:00
committed by Falk David
parent d6cd3db13b
commit c1d6f8b567

View File

@@ -59,7 +59,7 @@ static void GREASE_PENCIL_OT_layer_add(wmOperatorType *ot)
/* callbacks */
ot->exec = grease_pencil_layer_add_exec;
ot->poll = editable_grease_pencil_poll;
ot->poll = active_grease_pencil_poll;
prop = RNA_def_string(
ot->srna, "new_layer_name", "GP_Layer", INT16_MAX, "Name", "Name of the new layer");
@@ -94,7 +94,7 @@ static void GREASE_PENCIL_OT_layer_remove(wmOperatorType *ot)
/* callbacks */
ot->exec = grease_pencil_layer_remove_exec;
ot->poll = editable_grease_pencil_poll;
ot->poll = active_grease_pencil_poll;
}
} // namespace blender::ed::greasepencil