Fix #135611: Grease Pencil: Correct poll function for layer_group_color_tag
Operator `GREASE_PENCIL_OT_layer_group_color_tag` did not check the existence of active layer group before executing. Now corrected with a `poll()` callback. Pull Request: https://projects.blender.org/blender/blender/pulls/135612
This commit is contained in:
@@ -1059,7 +1059,7 @@ static void GREASE_PENCIL_OT_layer_group_color_tag(wmOperatorType *ot)
|
||||
ot->description = "Change layer group icon";
|
||||
|
||||
ot->exec = grease_pencil_layer_group_color_tag_exec;
|
||||
ot->poll = grease_pencil_context_poll;
|
||||
ot->poll = active_grease_pencil_layer_group_poll;
|
||||
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
|
||||
|
||||
@@ -70,6 +70,12 @@ bool active_grease_pencil_layer_poll(bContext *C)
|
||||
return grease_pencil && grease_pencil->has_active_layer();
|
||||
}
|
||||
|
||||
bool active_grease_pencil_layer_group_poll(bContext *C)
|
||||
{
|
||||
const GreasePencil *grease_pencil = blender::ed::greasepencil::from_context(*C);
|
||||
return grease_pencil && grease_pencil->has_active_group();
|
||||
}
|
||||
|
||||
bool editable_grease_pencil_point_selection_poll(bContext *C)
|
||||
{
|
||||
if (!editable_grease_pencil_poll(C)) {
|
||||
|
||||
@@ -318,6 +318,7 @@ bool active_grease_pencil_poll(bContext *C);
|
||||
bool active_grease_pencil_material_poll(bContext *C);
|
||||
bool editable_grease_pencil_poll(bContext *C);
|
||||
bool active_grease_pencil_layer_poll(bContext *C);
|
||||
bool active_grease_pencil_layer_group_poll(bContext *C);
|
||||
bool editable_grease_pencil_point_selection_poll(bContext *C);
|
||||
bool grease_pencil_selection_poll(bContext *C);
|
||||
bool grease_pencil_painting_poll(bContext *C);
|
||||
|
||||
Reference in New Issue
Block a user