diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 28 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 10 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_convert_nla.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 1 |
7 files changed, 41 insertions, 13 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index ac226b36e21..a7d02c0e6fb 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1580,6 +1580,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op) /* send notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ORDER, NULL); return OPERATOR_FINISHED; } @@ -2900,6 +2901,7 @@ static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), const /* handle click */ if (rename_anim_channels(&ac, channel_index)) { + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_RENAME, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 24157ad34a1..c6d6b8b16b9 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1730,7 +1730,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op) BLI_strncpy(nlt->name, DATA_("SoundTrack"), sizeof(nlt->name)); BKE_nlastrip_validate_name(adt, strip); - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); } return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 763a3fd63e6..20a330492a4 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -735,7 +735,7 @@ static int nlaedit_add_tracks_exec(bContext *C, wmOperator *op) DEG_relations_tag_update(CTX_data_main(C)); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -823,7 +823,7 @@ static int nlaedit_delete_tracks_exec(bContext *C, wmOperator *UNUSED(op)) DEG_relations_tag_update(ac.bmain); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL); /* done */ return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 3fa1b614a03..d7bf6c324ac 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -693,7 +693,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) DEG_relations_tag_update(ac.bmain); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -823,7 +823,7 @@ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op) ED_nla_postop_refresh(&ac); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -920,7 +920,7 @@ static int nlaedit_add_sound_exec(bContext *C, wmOperator *UNUSED(op)) ED_nla_postop_refresh(&ac); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -992,7 +992,7 @@ static int nlaedit_add_meta_exec(bContext *C, wmOperator *UNUSED(op)) ANIM_animdata_freelist(&anim_data); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -1053,7 +1053,7 @@ static int nlaedit_remove_meta_exec(bContext *C, wmOperator *UNUSED(op)) ANIM_animdata_freelist(&anim_data); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL); /* done */ return OPERATOR_FINISHED; @@ -1155,7 +1155,7 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *op) } /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -1260,7 +1260,7 @@ static int nlaedit_delete_exec(bContext *C, wmOperator *UNUSED(op)) DEG_relations_tag_update(ac.bmain); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL); /* done */ return OPERATOR_FINISHED; @@ -1415,7 +1415,7 @@ static int nlaedit_split_exec(bContext *C, wmOperator *UNUSED(op)) ED_nla_postop_refresh(&ac); /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -1659,6 +1659,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ORDER, NULL); /* done */ return OPERATOR_FINISHED; @@ -1744,6 +1745,7 @@ static int nlaedit_move_up_exec(bContext *C, wmOperator *UNUSED(op)) /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ORDER, NULL); /* done */ return OPERATOR_FINISHED; @@ -1829,6 +1831,7 @@ static int nlaedit_move_down_exec(bContext *C, wmOperator *UNUSED(op)) /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ORDER, NULL); /* done */ return OPERATOR_FINISHED; @@ -2002,7 +2005,7 @@ static int nlaedit_make_single_user_exec(bContext *C, wmOperator *UNUSED(op)) } /* set notifier that things have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); /* done */ return OPERATOR_FINISHED; @@ -2241,6 +2244,8 @@ static int nlaedit_snap_exec(bContext *C, wmOperator *op) scene = ac.scene; secf = (float)FPS; + bool any_added = false; + /* since we may add tracks, perform this in reverse order */ for (ale = anim_data.last; ale; ale = ale->prev) { ListBase tmp_strips = {NULL, NULL}; @@ -2314,6 +2319,8 @@ static int nlaedit_snap_exec(bContext *C, wmOperator *op) /* clear temp meta-strips on this new track, * as we may not be able to get back to it */ BKE_nlastrips_clear_metas(&track->strips, 0, 1); + + any_added = true; } } @@ -2333,6 +2340,9 @@ static int nlaedit_snap_exec(bContext *C, wmOperator *op) /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + if (any_added) { + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); + } /* done */ return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index f207b6193be..6c9d4433abd 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -222,10 +222,18 @@ static void outliner_main_region_listener(wmWindow *UNUSED(win), ED_region_tag_redraw(region); break; case ND_ANIMCHAN: - if (wmn->action == NA_SELECTED) { + if (ELEM(wmn->action, NA_SELECTED, NA_RENAME)) { ED_region_tag_redraw(region); } break; + case ND_NLA: + if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) { + ED_region_tag_redraw(region); + } + break; + case ND_NLA_ORDER: + ED_region_tag_redraw(region); + break; } break; case NC_GPENCIL: diff --git a/source/blender/editors/transform/transform_convert_nla.c b/source/blender/editors/transform/transform_convert_nla.c index ada668bcd04..adc2d03e2dc 100644 --- a/source/blender/editors/transform/transform_convert_nla.c +++ b/source/blender/editors/transform/transform_convert_nla.c @@ -36,6 +36,7 @@ #include "ED_markers.h" #include "WM_api.h" +#include "WM_types.h" #include "RNA_access.h" @@ -554,6 +555,12 @@ void special_aftertrans_update__nla(bContext *C, TransInfo *UNUSED(t)) BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } + /* General refresh for the outliner because the following might have happened: + * - strips moved between tracks + * - strips swapped order + * - duplicate-move moves to different track. */ + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); + /* free temp memory */ ANIM_animdata_freelist(&anim_data); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 448166170a9..0a32d2f0405 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -392,6 +392,7 @@ typedef struct wmNotifier { #define ND_NLA (73 << 16) #define ND_NLA_ACTCHANGE (74 << 16) #define ND_FCURVES_ORDER (75 << 16) +#define ND_NLA_ORDER (76 << 16) /* NC_GPENCIL */ #define ND_GPENCIL_EDITMODE (85 << 16) |