diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_graph.py | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 66 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 6 |
4 files changed, 7 insertions, 69 deletions
diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index f333bff4bf3..d3e1a866e43 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -41,8 +41,6 @@ class GRAPH_HT_header(Header): dopesheet_filter(layout, context) - layout.prop(st, "use_auto_view_selected", text="Auto View") - layout.prop(st, "use_normalization", text="Normalize") row = layout.row() row.active = st.use_normalization diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 46a39806ad7..78dbae7618b 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -66,15 +66,6 @@ /* ************************************************************************** */ /* KEYFRAMES STUFF */ -static void graphkeys_auto_view(bContext *C) -{ - const SpaceIpo *sipo = CTX_wm_space_graph(C); - - if (sipo && sipo->flag & SIPO_AUTO_VIEW_SELECTED) { - WM_operator_name_call(C, "GRAPH_OT_view_selected", WM_OP_INVOKE_DEFAULT, NULL); - } -} - /* ******************** Deselect All Operator ***************************** */ /* This operator works in one of three ways: * 1) (de)select all (AKEY) - test if select all or deselect all @@ -92,7 +83,7 @@ static void graphkeys_auto_view(bContext *C) * 2 = invert * - do_channels: whether to affect selection status of channels */ -static short deselect_graph_keys(bAnimContext *ac, short test, short sel, short do_channels) +static void deselect_graph_keys(bAnimContext *ac, short test, short sel, short do_channels) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -151,8 +142,6 @@ static short deselect_graph_keys(bAnimContext *ac, short test, short sel, short /* Cleanup */ ANIM_animdata_freelist(&anim_data); - - return sel; } /* ------------------- */ @@ -161,7 +150,6 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) { bAnimContext ac; bAnimListElem *ale_active = NULL; - short sel; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -175,9 +163,9 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) /* 'standard' behavior - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) - sel = deselect_graph_keys(&ac, 0, SELECT_INVERT, true); + deselect_graph_keys(&ac, 0, SELECT_INVERT, true); else - sel = deselect_graph_keys(&ac, 1, SELECT_ADD, true); + deselect_graph_keys(&ac, 1, SELECT_ADD, true); /* restore active F-Curve... */ if (ale_active) { @@ -192,9 +180,6 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) ale_active = NULL; } - if (sel != SELECT_SUBTRACT) - graphkeys_auto_view(C); - /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -389,8 +374,6 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) /* apply borderselect action */ borderselect_graphkeys(&ac, &rect_fl, mode, selectmode, incl_handles, NULL); - graphkeys_auto_view(C); - /* send notifier that keyframe selection has changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -478,8 +461,6 @@ static int graphkeys_lassoselect_exec(bContext *C, wmOperator *op) MEM_freeN((void *)data_lasso.mcords); - graphkeys_auto_view(C); - /* send notifier that keyframe selection has changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -510,14 +491,6 @@ void GRAPH_OT_select_lasso(wmOperatorType *ot) RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection instead of deselecting everything first"); } -static int graph_circle_select_modal(bContext *C, wmOperator *op, const wmEvent *event) -{ - if (event->type == EVT_MODAL_MAP && event->val == GESTURE_MODAL_NOP) - graphkeys_auto_view(C); - - return WM_gesture_circle_modal(C, op, event); -} - static int graph_circle_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -579,7 +552,7 @@ void GRAPH_OT_select_circle(wmOperatorType *ot) ot->idname = "GRAPH_OT_select_circle"; ot->invoke = WM_gesture_circle_invoke; - ot->modal = graph_circle_select_modal; + ot->modal = WM_gesture_circle_modal; ot->exec = graph_circle_select_exec; ot->poll = graphop_visible_keyframes_poll; ot->cancel = WM_gesture_circle_cancel; @@ -752,8 +725,6 @@ static int graphkeys_columnselect_exec(bContext *C, wmOperator *op) else columnselect_graph_keys(&ac, mode); - graphkeys_auto_view(C); - /* set notifier that keyframe selection has changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -812,8 +783,6 @@ static int graphkeys_select_linked_exec(bContext *C, wmOperator *UNUSED(op)) /* Cleanup */ ANIM_animdata_freelist(&anim_data); - graphkeys_auto_view(C); - /* set notifier that keyframe selection has changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -838,13 +807,12 @@ void GRAPH_OT_select_linked(wmOperatorType *ot) /* ******************** Select More/Less Operators *********************** */ /* Common code to perform selection */ -static void select_moreless_graph_keys(bContext *C, bAnimContext *ac, short mode) +static void select_moreless_graph_keys(bAnimContext *ac, short mode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - const SpaceIpo *sipo = (SpaceIpo *)ac->sl; KeyframeEditData ked; KeyframeEditFunc build_cb; @@ -874,24 +842,6 @@ static void select_moreless_graph_keys(bContext *C, bAnimContext *ac, short mode /* free the selmap used here */ MEM_freeN(ked.data); ked.data = NULL; - - /* only do auto view if a bezier point is selected */ - if (sipo->flag & SIPO_AUTO_VIEW_SELECTED) { - const FCurve *fcu = (FCurve *)ale->key_data; - const BezTriple *bezt; - unsigned int i; - - /* only continue if F-Curve has keyframes */ - if (fcu->bezt == NULL) - continue; - - for (bezt = fcu->bezt, i = 0; i < fcu->totvert; bezt++, i++) { - if (BEZSELECTED(bezt)) { - graphkeys_auto_view(C); - break; - } - } - } } /* Cleanup */ @@ -909,7 +859,7 @@ static int graphkeys_select_more_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; /* perform select changes */ - select_moreless_graph_keys(C, &ac, SELMAP_MORE); + select_moreless_graph_keys(&ac, SELMAP_MORE); /* set notifier that keyframe selection has changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -943,7 +893,7 @@ static int graphkeys_select_less_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; /* perform select changes */ - select_moreless_graph_keys(C, &ac, SELMAP_LESS); + select_moreless_graph_keys(&ac, SELMAP_LESS); /* set notifier that keyframe selection has changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); @@ -1058,8 +1008,6 @@ static int graphkeys_select_leftright_exec(bContext *C, wmOperator *op) /* do the selecting now */ graphkeys_select_leftright(&ac, leftright, selectmode); - graphkeys_auto_view(C); - /* set notifier that keyframe selection (and channels too) have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index e530841789b..f41de65f68e 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -370,8 +370,6 @@ typedef enum eGraphEdit_Flag { /* normalize curves on display */ SIPO_NORMALIZE = (1 << 14), SIPO_NORMALIZE_FREEZE = (1 << 15), - /* automatically set view on selection */ - SIPO_AUTO_VIEW_SELECTED = (1 << 16), } eGraphEdit_Flag; /* SpaceIpo->mode (Graph Editor Mode) */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 24c80ccdb02..816d4acd729 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -3282,12 +3282,6 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored"); - /* auto view */ - prop = RNA_def_property(srna, "use_auto_view_selected", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_AUTO_VIEW_SELECTED); - RNA_def_property_ui_text(prop, "Auto View Selected", "Automatically adjust view based on selection"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - /* nromalize curves */ prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NORMALIZE); |