Anim: View FCurve of Property in the Graph Editor #114407
|
@ -4522,7 +4522,9 @@ static int view_curve_in_graph_editor_exec(bContext *C, wmOperator *op)
|
|||
|
||||
static int view_curve_in_graph_editor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
RNA_boolean_set(op->ptr, "isolate", event->modifier == KM_ALT);
|
||||
if (RNA_boolean_get(op->ptr, "use_modifier_key")) {
|
||||
RNA_boolean_set(op->ptr, "isolate", event->modifier == KM_ALT);
|
||||
}
|
||||
return view_curve_in_graph_editor_exec(C, op);
|
||||
}
|
||||
|
||||
|
@ -4550,6 +4552,16 @@ static void ANIM_OT_view_curve_in_graph_editor(wmOperatorType *ot)
|
|||
false,
|
||||
"Isolate",
|
||||
"Hides all other F-Curves other than the ones being framed");
|
||||
|
||||
PropertyRNA *prop = RNA_def_boolean(
|
||||
ot->srna,
|
||||
"use_modifier_key",
|
||||
false,
|
||||
"Use Modifier Key",
|
||||
"Check the Alt key when the operator is executed to define the isolation behavior. If true, "
|
||||
"overrides the isolate property");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -658,26 +658,47 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
|
|||
if (but->flag & UI_BUT_ANIMATED) {
|
||||
uiItemS(layout);
|
||||
if (is_array_component) {
|
||||
uiItemBooleanO(layout,
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Show Single in Graph Editor"),
|
||||
ICON_NONE,
|
||||
"ANIM_OT_view_curve_in_graph_editor",
|
||||
"all",
|
||||
false);
|
||||
uiItemBooleanO(layout,
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Show All in Graph Editor"),
|
||||
ICON_NONE,
|
||||
"ANIM_OT_view_curve_in_graph_editor",
|
||||
"all",
|
||||
true);
|
||||
PointerRNA op_ptr;
|
||||
wmOperatorType *ot;
|
||||
ot = WM_operatortype_find("ANIM_OT_view_curve_in_graph_editor", false);
|
||||
uiItemFullO_ptr(
|
||||
layout,
|
||||
ot,
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "View Single in Graph Editor"),
|
||||
ICON_NONE,
|
||||
nullptr,
|
||||
WM_OP_INVOKE_DEFAULT,
|
||||
UI_ITEM_NONE,
|
||||
&op_ptr);
|
||||
RNA_boolean_set(&op_ptr, "all", false);
|
||||
RNA_boolean_set(&op_ptr, "use_modifier_key", true);
|
||||
|
||||
uiItemFullO_ptr(layout,
|
||||
ot,
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "View All in Graph Editor"),
|
||||
ICON_NONE,
|
||||
nullptr,
|
||||
WM_OP_INVOKE_DEFAULT,
|
||||
UI_ITEM_NONE,
|
||||
&op_ptr);
|
||||
RNA_boolean_set(&op_ptr, "all", true);
|
||||
RNA_boolean_set(&op_ptr, "use_modifier_key", true);
|
||||
}
|
||||
else {
|
||||
uiItemBooleanO(layout,
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Show in Graph Editor"),
|
||||
ICON_NONE,
|
||||
"ANIM_OT_view_curve_in_graph_editor",
|
||||
"all",
|
||||
false);
|
||||
PointerRNA op_ptr;
|
||||
wmOperatorType *ot;
|
||||
ot = WM_operatortype_find("ANIM_OT_view_curve_in_graph_editor", false);
|
||||
|
||||
uiItemFullO_ptr(layout,
|
||||
ot,
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "View in Graph Editor"),
|
||||
ICON_NONE,
|
||||
nullptr,
|
||||
WM_OP_INVOKE_DEFAULT,
|
||||
UI_ITEM_NONE,
|
||||
&op_ptr);
|
||||
RNA_boolean_set(&op_ptr, "all", false);
|
||||
RNA_boolean_set(&op_ptr, "use_modifier_key", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue