Merge branch 'blender-v5.2-release'

This commit is contained in:
Campbell Barton 2026-06-10 10:26:18 +10:00
commit 1fefb99eb0
7 changed files with 57 additions and 11 deletions

View file

@ -613,11 +613,14 @@ bool ED_operator_buttons_active(bContext *C);
bool ED_operator_node_active(bContext *C);
bool ED_operator_node_editable(bContext *C);
bool ED_operator_graphedit_active(bContext *C);
bool ED_operator_region_graphedit_active(bContext *C);
bool ED_operator_sequencer_active(bContext *C);
bool ED_operator_sequencer_active_editable(bContext *C);
bool ED_operator_image_active(bContext *C);
bool ED_operator_nla_active(bContext *C);
bool ED_operator_region_nla_active(bContext *C);
bool ED_operator_info_active(bContext *C);
bool ED_operator_region_info_active(bContext *C);
bool ED_operator_console_active(bContext *C);
bool ED_operator_preferences_active(bContext *C);

View file

@ -471,6 +471,20 @@ bool ED_operator_graphedit_active(bContext *C)
return ed_spacetype_test(C, SPACE_GRAPH);
}
bool ED_operator_region_graphedit_active(bContext *C)
{
if (!ED_operator_graphedit_active(C)) {
CTX_wm_operator_poll_msg_set(C, "Expected an active Graph Editor");
return false;
}
const ARegion *region = CTX_wm_region(C);
if (!(region && region->regiontype == RGN_TYPE_WINDOW)) {
CTX_wm_operator_poll_msg_set(C, "Expected a Graph Editor region");
return false;
}
return true;
}
bool ED_operator_sequencer_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_SEQ) && CTX_data_sequencer_scene(C) != nullptr;
@ -491,11 +505,39 @@ bool ED_operator_nla_active(bContext *C)
return ed_spacetype_test(C, SPACE_NLA);
}
bool ED_operator_region_nla_active(bContext *C)
{
if (!ED_operator_nla_active(C)) {
CTX_wm_operator_poll_msg_set(C, "Expected an active Nonlinear Animation editor");
return false;
}
const ARegion *region = CTX_wm_region(C);
if (!(region && region->regiontype == RGN_TYPE_WINDOW)) {
CTX_wm_operator_poll_msg_set(C, "Expected a Nonlinear Animation region");
return false;
}
return true;
}
bool ED_operator_info_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_INFO);
}
bool ED_operator_region_info_active(bContext *C)
{
if (!ED_operator_info_active(C)) {
CTX_wm_operator_poll_msg_set(C, "Expected an active Info editor");
return false;
}
const ARegion *region = CTX_wm_region(C);
if (!(region && region->regiontype == RGN_TYPE_WINDOW)) {
CTX_wm_operator_poll_msg_set(C, "Expected an Info region");
return false;
}
return true;
}
bool ED_operator_console_active(bContext *C)
{
return ed_spacetype_test(C, SPACE_CONSOLE);
@ -2614,6 +2656,7 @@ static void SCREEN_OT_edge_merge(wmOperatorType *ot)
ot->description = "Merge aligned area edges";
ot->idname = "SCREEN_OT_edge_merge";
ot->exec = area_edge_merge_exec;
ot->poll = ED_operator_screenactive;
/* flags */
ot->flag = OPTYPE_INTERNAL;

View file

@ -1007,7 +1007,7 @@ void SCULPT_OT_set_pivot_position(wmOperatorType *ot)
ot->invoke = set_pivot_position_invoke;
ot->exec = set_pivot_position_exec;
ot->poll = sculpt_mode_poll;
ot->poll = sculpt_mode_poll_view3d;
ot->depends_on_cursor = set_pivot_depends_on_cursor;
ot->poll_property = set_pivot_position_poll_property;

View file

@ -398,7 +398,7 @@ void GRAPH_OT_view_all(wmOperatorType *ot)
/* API callbacks */
ot->exec = graphkeys_viewall_exec;
/* XXX: Unchecked poll to get F-samples working too, but makes modifier damage trickier. */
ot->poll = ED_operator_graphedit_active;
ot->poll = ED_operator_region_graphedit_active;
/* Flags */
ot->flag = 0;
@ -421,7 +421,7 @@ void GRAPH_OT_view_selected(wmOperatorType *ot)
/* API callbacks */
ot->exec = graphkeys_view_selected_exec;
/* XXX: Unchecked poll to get F-samples working too, but makes modifier damage trickier. */
ot->poll = ED_operator_graphedit_active;
ot->poll = ED_operator_region_graphedit_active;
/* Flags */
ot->flag = 0;
@ -456,7 +456,7 @@ void GRAPH_OT_view_frame(wmOperatorType *ot)
/* API callbacks */
ot->exec = graphkeys_view_frame_exec;
ot->poll = ED_operator_graphedit_active;
ot->poll = ED_operator_region_graphedit_active;
/* Flags */
ot->flag = 0;

View file

@ -184,7 +184,7 @@ void INFO_OT_select_pick(wmOperatorType *ot)
ot->idname = "INFO_OT_select_pick";
/* API callbacks. */
ot->poll = ED_operator_info_active;
ot->poll = ED_operator_region_info_active;
ot->invoke = select_report_pick_invoke;
ot->exec = select_report_pick_exec;
@ -306,7 +306,7 @@ void INFO_OT_select_box(wmOperatorType *ot)
ot->modal = WM_gesture_box_modal;
ot->cancel = WM_gesture_box_cancel;
ot->poll = ED_operator_info_active;
ot->poll = ED_operator_region_info_active;
/* flags */
// ot->flag = OPTYPE_REGISTER;

View file

@ -558,7 +558,7 @@ void NLA_OT_view_all(wmOperatorType *ot)
/* API callbacks. */
ot->exec = nlaedit_viewall_exec;
ot->poll = ED_operator_nla_active;
ot->poll = ED_operator_region_nla_active;
/* flags */
ot->flag = 0;
@ -573,7 +573,7 @@ void NLA_OT_view_selected(wmOperatorType *ot)
/* API callbacks. */
ot->exec = nlaedit_viewsel_exec;
ot->poll = ED_operator_nla_active;
ot->poll = ED_operator_region_nla_active;
/* flags */
ot->flag = 0;
@ -601,7 +601,7 @@ void NLA_OT_view_frame(wmOperatorType *ot)
/* API callbacks. */
ot->exec = nlaedit_viewframe_exec;
ot->poll = ED_operator_nla_active;
ot->poll = ED_operator_region_nla_active;
/* flags */
ot->flag = 0;

View file

@ -578,7 +578,7 @@ void NLA_OT_select_leftright(wmOperatorType *ot)
/* API callbacks. */
ot->invoke = nlaedit_select_leftright_invoke;
ot->exec = nlaedit_select_leftright_exec;
ot->poll = ED_operator_nla_active;
ot->poll = ED_operator_region_nla_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@ -718,7 +718,7 @@ void NLA_OT_click_select(wmOperatorType *ot)
ot->description = "Handle clicks to select NLA Strips";
/* callbacks */
ot->poll = ED_operator_nla_active;
ot->poll = ED_operator_region_nla_active;
ot->exec = nlaedit_clickselect_exec;
ot->invoke = WM_generic_select_invoke;
ot->modal = WM_generic_select_modal;