diff options
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/CMakeLists.txt | 35 | ||||
-rw-r--r-- | source/blender/editors/space_action/Makefile | 2 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 65 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 60 | ||||
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 12 |
7 files changed, 92 insertions, 97 deletions
diff --git a/source/blender/editors/space_action/CMakeLists.txt b/source/blender/editors/space_action/CMakeLists.txt new file mode 100644 index 00000000000..85275b2db23 --- /dev/null +++ b/source/blender/editors/space_action/CMakeLists.txt @@ -0,0 +1,35 @@ +# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributor(s): Jacques Beaurain. +# +# ***** END GPL LICENSE BLOCK ***** + +FILE(GLOB SRC *.c) + +SET(INC + ../../blenkernel + ../../blenlib + ../include + ../../../../intern/guardedalloc + ../../makesdna + ../../makesrna + ../../windowmanager +) + + +BLENDERLIB(bf_editor_space_action "${SRC}" "${INC}") diff --git a/source/blender/editors/space_action/Makefile b/source/blender/editors/space_action/Makefile index e856587acca..19aeb54cc2f 100644 --- a/source/blender/editors/space_action/Makefile +++ b/source/blender/editors/space_action/Makefile @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index d486bff9b6f..d2067790b2f 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -34,11 +34,6 @@ #include <string.h> #include <float.h> -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "MEM_guardedalloc.h" #include "BLI_blenlib.h" #include "BLI_math.h" @@ -49,19 +44,12 @@ #include "DNA_screen_types.h" #include "BKE_action.h" -#include "BKE_depsgraph.h" -#include "BKE_fcurve.h" -#include "BKE_key.h" -#include "BKE_material.h" -#include "BKE_object.h" -#include "BKE_global.h" // XXX remove me! #include "BKE_context.h" #include "BKE_utildefines.h" /* Everything from source (BIF, BDR, BSE) ------------------------------ */ #include "BIF_gl.h" -#include "BIF_glutil.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 7e392f2d335..916b0032f17 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -32,11 +32,6 @@ #include <string.h> #include <float.h> -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "MEM_guardedalloc.h" #include "BLI_blenlib.h" #include "BLI_math.h" @@ -50,15 +45,10 @@ #include "RNA_enum_types.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_report.h" -#include "BKE_utildefines.h" #include "UI_view2d.h" @@ -103,7 +93,7 @@ static int act_new_exec(bContext *C, wmOperator *op) } /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -137,7 +127,7 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max) int filter; /* get data to filter, from Action or Dopesheet */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* set large values to try to override */ @@ -288,7 +278,7 @@ static short copy_action_keys (bAnimContext *ac) free_anim_copybuf(); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* copy keyframes */ @@ -307,7 +297,7 @@ static short paste_action_keys (bAnimContext *ac) int filter, ok=0; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* paste keyframes */ @@ -383,7 +373,7 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -425,7 +415,7 @@ static void insert_action_keys(bAnimContext *ac, short mode) short flag = 0; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); if (mode == 2) filter |= ANIMFILTER_SEL; else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED; @@ -478,7 +468,7 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -512,9 +502,9 @@ static void duplicate_action_keys (bAnimContext *ac) /* filter data */ if (ac->datatype == ANIMCONT_GPENCIL) - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and delete selected keys */ @@ -546,7 +536,7 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; // xxx - start transform } @@ -590,9 +580,9 @@ static void delete_action_keys (bAnimContext *ac) /* filter data */ if (ac->datatype == ANIMCONT_GPENCIL) - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and delete selected keys */ @@ -633,7 +623,7 @@ static int actkeys_delete_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -663,7 +653,7 @@ static void clean_action_keys (bAnimContext *ac, float thresh) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and clean curves */ @@ -697,7 +687,7 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -731,7 +721,7 @@ static void sample_action_keys (bAnimContext *ac) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and add keys between selected keyframes on every frame */ @@ -761,7 +751,7 @@ static int actkeys_sample_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -801,7 +791,7 @@ static void setexpo_action_keys(bAnimContext *ac, short mode) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting mode per F-Curve */ @@ -872,7 +862,7 @@ static void setipo_action_keys(bAnimContext *ac, short mode) KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting BezTriple interpolation @@ -956,7 +946,7 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting flags for handles @@ -1040,7 +1030,7 @@ static void setkeytype_action_keys(bAnimContext *ac, short mode) KeyframeEditFunc set_cb= ANIM_editkeyframes_keytype(mode); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting BezTriple interpolation @@ -1122,7 +1112,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op) memset(&ked, 0, sizeof(KeyframeEditData)); /* loop over action data, averaging values */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -1142,6 +1132,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op) if (ked.i1) { Scene *scene= ac.scene; CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f); + SUBFRA= 0.f; } /* set notifier that things have changed */ @@ -1190,7 +1181,7 @@ static void snap_action_keys(bAnimContext *ac, short mode) if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* get beztriple editing callbacks */ @@ -1242,7 +1233,7 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -1315,9 +1306,9 @@ static void mirror_action_keys(bAnimContext *ac, short mode) /* filter data */ if (ac->datatype == ANIMCONT_GPENCIL) - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* mirror keyframes */ @@ -1359,7 +1350,7 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 8ef37942fb3..19dd4512909 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -29,14 +29,11 @@ #include <stdlib.h> #include <math.h> -#include "MEM_guardedalloc.h" #include "DNA_space_types.h" #include "BLI_blenlib.h" -#include "BKE_context.h" -#include "BKE_utildefines.h" #include "ED_transform.h" diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 8f1d2d4be0e..b2c47194384 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_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" @@ -46,15 +42,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" @@ -69,6 +59,7 @@ #include "action_intern.h" + /* ************************************************************************** */ /* KEYFRAMES STUFF */ @@ -99,9 +90,9 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) /* determine type-based settings */ if (ac->datatype == ANIMCONT_GPENCIL) - filter= (ANIMFILTER_VISIBLE); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NODUPLIS); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); /* filter data */ ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); @@ -160,7 +151,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op) deselect_action_keys(&ac, 1, SELECT_ADD); /* set notifier that keyframe selection 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; } @@ -216,7 +207,7 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax-2, &rectf.xmax, &rectf.ymax); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* get filtering flag for dopesheet data (if applicable) */ @@ -321,7 +312,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) borderselect_action(&ac, rect, mode, selectmode); /* set notifier that keyframe selection 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; } @@ -393,7 +384,7 @@ static void markers_selectkeys_between (bAnimContext *ac) ked.f2= max; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* select keys in-between */ @@ -535,7 +526,7 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op) columnselect_action_keys(&ac, mode); /* set notifier that keyframe selection 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; } @@ -576,7 +567,7 @@ static int actkeys_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) { @@ -593,7 +584,7 @@ static int actkeys_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; } @@ -631,7 +622,7 @@ static void select_moreless_action_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_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -671,7 +662,7 @@ static int actkeys_select_more_exec (bContext *C, wmOperator *op) select_moreless_action_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; } @@ -705,7 +696,7 @@ static int actkeys_select_less_exec (bContext *C, wmOperator *op) select_moreless_action_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; } @@ -804,9 +795,9 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short /* filter data */ if (ac->datatype == ANIMCONT_GPENCIL) - filter= (ANIMFILTER_VISIBLE); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NODUPLIS); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* select keys on the side where most data occurs */ @@ -827,13 +818,14 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short /* Sync marker support */ if((select_mode==SELECT_ADD) && (ac->spacetype==SPACE_ACTION) && ELEM(leftright, ACTKEYS_LRSEL_LEFT, ACTKEYS_LRSEL_RIGHT)) { SpaceAction *saction= ac->sa->spacedata.first; + if (saction && saction->flag & SACTION_MARKERS_MOVE) { TimeMarker *marker; - + for (marker= scene->markers.first; marker; marker= marker->next) { - if( ((leftright == ACTKEYS_LRSEL_LEFT) && marker->frame < CFRA) || - ((leftright == ACTKEYS_LRSEL_RIGHT) && marker->frame >= CFRA) - ) { + if( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) || + ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA)) ) + { marker->flag |= SELECT; } else { @@ -868,9 +860,9 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se * based on the keys found to be selected above */ if (ac->datatype == ANIMCONT_GPENCIL) - filter= (ANIMFILTER_VISIBLE); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NODUPLIS); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -997,14 +989,12 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, return; } else if (ale->type == ANIMTYPE_GPLAYER) { - bGPDlayer *gpl= (bGPDlayer *)ale->data; + struct bGPDlayer *gpl= (struct bGPDlayer *)ale->data; gpl_to_keylist(ads, gpl, &anim_keys, NULL); } - // the call below is not strictly necessary, since we have adjacency info anyway - //BLI_dlrbTree_linkedlist_sync(&anim_keys); - /* loop through keyframes, finding one that was within the range clicked on */ + // TODO: replace this with API calls instead of inlining for (ak= anim_keys.root; ak; ak= akn) { if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) { /* set the frame to use, and apply inverse-correction for NLA-mapping @@ -1143,7 +1133,7 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even } /* set notifier that keyframe selection (and channels too) have 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; diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 7e02454254b..7b96618d923 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -38,10 +38,8 @@ #include "BLI_math.h" #include "BLI_rand.h" -#include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_screen.h" -#include "BKE_utildefines.h" #include "ED_screen.h" @@ -165,12 +163,10 @@ static void action_main_area_draw(const bContext *C, ARegion *ar) View2D *v2d= &ar->v2d; View2DGrid *grid; View2DScrollers *scrollers; - float col[3]; short unit=0, flag=0; /* clear and setup matrix */ - UI_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); + UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(C, v2d); @@ -227,11 +223,9 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar) bAnimContext ac; View2D *v2d= &ar->v2d; View2DScrollers *scrollers; - float col[3]; /* clear and setup matrix */ - UI_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); + UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(C, v2d); @@ -356,7 +350,7 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) switch (wmn->category) { case NC_ANIMATION: /* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */ - if (ELEM(wmn->data, ND_KEYFRAME_SELECT, ND_ANIMCHAN_SELECT)) + if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED)) ED_area_tag_redraw(sa); else ED_area_tag_refresh(sa); |