diff options
Diffstat (limited to 'source/blender/editors/space_graph/graph_select.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index a81de25f265..cdc8166f2d6 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -29,10 +29,6 @@ #include <string.h> #include <float.h> -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" @@ -47,15 +43,9 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "BKE_action.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" -#include "BKE_key.h" -#include "BKE_material.h" #include "BKE_nla.h" -#include "BKE_object.h" #include "BKE_context.h" -#include "BKE_utildefines.h" #include "UI_view2d.h" @@ -99,7 +89,7 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) KeyframeEditFunc test_cb, sel_cb; /* determine type-based settings */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); /* filter data */ ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); @@ -164,7 +154,7 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) deselect_graph_keys(&ac, 1, SELECT_ADD); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -217,7 +207,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* get beztriple editing/validation funcs */ @@ -333,7 +323,7 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) borderselect_graphkeys(&ac, rect, mode, selectmode, incl_handles); /* send notifier that keyframe selection has changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -406,7 +396,7 @@ static void markers_selectkeys_between (bAnimContext *ac) ked.f2= max; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* select keys in-between */ @@ -446,7 +436,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) /* build list of columns */ switch (mode) { case GRAPHKEYS_COLUMNSEL_KEYS: /* list of selected keys */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) @@ -478,7 +468,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) /* loop through all of the keys and select additional keyframes * based on the keys found to be selected above */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -524,7 +514,7 @@ static int graphkeys_columnselect_exec(bContext *C, wmOperator *op) columnselect_graph_keys(&ac, mode); /* set notifier that keyframe selection has changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -565,7 +555,7 @@ static int graphkeys_select_linked_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* loop through all of the keys and select additional keyframes based on these */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -582,7 +572,7 @@ static int graphkeys_select_linked_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that keyframe selection has changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -620,7 +610,7 @@ static void select_moreless_graph_keys (bAnimContext *ac, short mode) memset(&ked, 0, sizeof(KeyframeEditData)); /* loop through all of the keys and select additional keyframes based on these */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -660,7 +650,7 @@ static int graphkeys_select_more_exec (bContext *C, wmOperator *op) select_moreless_graph_keys(&ac, SELMAP_MORE); /* set notifier that keyframe selection has changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -694,7 +684,7 @@ static int graphkeys_select_less_exec (bContext *C, wmOperator *op) select_moreless_graph_keys(&ac, SELMAP_LESS); /* set notifier that keyframe selection has changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -784,7 +774,7 @@ static void nearest_fcurve_vert_store (ListBase *matches, View2D *v2d, FCurve *f * needed to access the relevant vertex coordinates in the 3x3 * 'vec' matrix */ - UI_view2d_to_region_no_clip(v2d, bezt->vec[hpoint+1][0], bezt->vec[hpoint+1][1], &screen_co[0], &screen_co[1]); + UI_view2d_view_to_region(v2d, bezt->vec[hpoint+1][0], bezt->vec[hpoint+1][1], &screen_co[0], &screen_co[1]); /* check if distance from mouse cursor to vert in screen space is within tolerance */ // XXX: inlined distance calculation, since we cannot do this on ints using the math lib... @@ -838,7 +828,7 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, int mval[2], ListBa * - if the option to only show keyframes that belong to selected F-Curves is enabled, * include the 'only selected' flag... */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); if (sipo->flag & SIPO_SELCUVERTSONLY) // FIXME: this should really be check for by the filtering code... filter |= ANIMFILTER_SEL; ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); @@ -1059,7 +1049,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s /* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */ if (nvi->fcu->flag & FCURVE_SELECTED) { - int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nvi->fcu, ANIMTYPE_FCURVE); } } @@ -1111,7 +1101,7 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor } /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* select keys on the side where most data occurs */ @@ -1184,7 +1174,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec /* loop through all of the keys and select additional keyframes * based on the keys found to be selected above */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -1264,7 +1254,7 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *ev } /* set notifier that keyframe selection (and also channel selection in some cases) has changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT|ND_ANIMCHAN_SELECT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|ND_ANIMCHAN|NA_SELECTED, NULL); /* for tweak grab to work */ return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; |