Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-07-10 14:48:25 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-10 14:48:25 +0400
commit6f0de59c551235d5e26281eca6e172d08ff5eb73 (patch)
tree6a119fd0740cf21854a8d34919d5780a677c86aa /source/blender/editors/space_nla/nla_edit.c
parentb1a9281ed801ae8b2483cd4246880b1009efe955 (diff)
NLA SoC: Notifier Fixes for Animation Editors
I've gone through all the Animation Editor operators, making sure they send appropriate notifiers, and that these notifiers are handled. * Added a separate category for animation-related notifiers, since the old-style ones attached to specific datatypes only was turning out to be not too feasible. * For now, the focus has been on making sure that all Animation Editors update when there have been any potentially suitable changes at all. Later on, we can filter these more carefully to only take the ones we really need (for optimisation purposes)
Diffstat (limited to 'source/blender/editors/space_nla/nla_edit.c')
-rw-r--r--source/blender/editors/space_nla/nla_edit.c49
1 files changed, 17 insertions, 32 deletions
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 6cbc9cab253..cb151429dd1 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -127,8 +127,7 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op)
ac.scene->flag |= SCE_NLA_EDIT_ON;
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_ACTCHANGE, NULL);
}
else {
BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on.");
@@ -197,8 +196,7 @@ static int nlaedit_disable_tweakmode_exec (bContext *C, wmOperator *op)
ac.scene->flag &= ~SCE_NLA_EDIT_ON;
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_ACTCHANGE, NULL);
}
/* done */
@@ -315,8 +313,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -424,8 +421,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
/* was anything added? */
if (done) {
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -483,8 +479,7 @@ static int nlaedit_add_meta_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -536,8 +531,7 @@ static int nlaedit_remove_meta_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -621,8 +615,7 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op)
if (done) {
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -707,8 +700,7 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -831,8 +823,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -894,8 +885,7 @@ static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -966,8 +956,7 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1038,8 +1027,7 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1137,8 +1125,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1198,8 +1185,7 @@ static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1337,8 +1323,7 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1447,8 +1432,8 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
- WM_event_add_notifier(C, NC_SCENE, NULL);
+ // FIXME: this doesn't really do it justice...
+ WM_event_add_notifier(C, NC_ANIMATION, NULL);
/* done */
return OPERATOR_FINISHED;