[Bf-blender-cvs] [6bddad2] master: Code Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy-paste buffer free callbacks
Joshua Leung
noreply at git.blender.org
Fri Apr 15 10:19:26 CEST 2016
Commit: 6bddad2c4e8ea6e0ad710bcf39b7cc361a23a274
Author: Joshua Leung
Date: Sun Apr 3 01:18:23 2016 +1300
Branches: master
https://developer.blender.org/rB6bddad2c4e8ea6e0ad710bcf39b7cc361a23a274
Code Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy-paste buffer free callbacks
===================================================================
M source/blender/editors/animation/drivers.c
M source/blender/editors/animation/fmodifier_ui.c
M source/blender/editors/animation/keyframes_general.c
M source/blender/editors/include/ED_anim_api.h
M source/blender/editors/include/ED_keyframes_edit.h
M source/blender/editors/include/ED_keyframing.h
M source/blender/editors/space_action/action_edit.c
M source/blender/editors/space_graph/graph_edit.c
M source/blender/editors/space_nla/nla_edit.c
M source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index f75f2ce..4ddf37a 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -61,9 +61,6 @@
#include "anim_intern.h"
-/* called by WM */
-void free_anim_drivers_copybuf(void);
-
/* ************************************************** */
/* Animation Data Validation */
@@ -514,8 +511,7 @@ bool ANIM_remove_driver(ReportList *UNUSED(reports), ID *id, const char rna_path
static FCurve *channeldriver_copypaste_buf = NULL;
/* This function frees any MEM_calloc'ed copy/paste buffer data */
-// XXX find some header to put this in!
-void free_anim_drivers_copybuf(void)
+void ANIM_drivers_copybuf_free(void)
{
/* free the buffer F-Curve if it exists, as if it were just another F-Curve */
if (channeldriver_copypaste_buf)
@@ -553,7 +549,7 @@ bool ANIM_copy_driver(ReportList *reports, ID *id, const char rna_path[], int ar
fcu = verify_driver_fcurve(id, rna_path, array_index, 0);
/* clear copy/paste buffer first (for consistency with other copy/paste buffers) */
- free_anim_drivers_copybuf();
+ ANIM_drivers_copybuf_free();
/* copy this to the copy/paste buf if it exists */
if (fcu && fcu->driver) {
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 91705d6..6bb7341 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -697,14 +697,14 @@ static ListBase fmodifier_copypaste_buf = {NULL, NULL};
/* ---------- */
/* free the copy/paste buffer */
-void free_fmodifiers_copybuf(void)
+void ANIM_fmodifiers_copybuf_free(void)
{
/* just free the whole buffer */
free_fmodifiers(&fmodifier_copypaste_buf);
}
/* copy the given F-Modifiers to the buffer, returning whether anything was copied or not
- * assuming that the buffer has been cleared already with free_fmodifiers_copybuf()
+ * assuming that the buffer has been cleared already with ANIM_fmodifiers_copybuf_free()
* - active: only copy the active modifier
*/
bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active)
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 9733d92..1703210 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -527,8 +527,7 @@ typedef struct tAnimCopybufItem {
/* This function frees any MEM_calloc'ed copy/paste buffer data */
-// XXX find some header to put this in!
-void free_anim_copybuf(void)
+void ANIM_fcurves_copybuf_free(void)
{
tAnimCopybufItem *aci, *acn;
@@ -563,7 +562,7 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data)
Scene *scene = ac->scene;
/* clear buffer first */
- free_anim_copybuf();
+ ANIM_fcurves_copybuf_free();
/* assume that each of these is an F-Curve */
for (ale = anim_data->first; ale; ale = ale->next) {
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 3c84422..fb4897c 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -544,10 +544,10 @@ void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, List
/* free the copy/paste buffer */
-void free_fmodifiers_copybuf(void);
+void ANIM_fmodifiers_copybuf_free(void);
/* copy the given F-Modifiers to the buffer, returning whether anything was copied or not
- * assuming that the buffer has been cleared already with free_fmodifiers_copybuf()
+ * assuming that the buffer has been cleared already with ANIM_fmodifiers_copybuf_free()
* - active: only copy the active modifier
*/
bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active);
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index bbfa8ec..fae3e36 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -272,7 +272,7 @@ void sample_fcurve(struct FCurve *fcu);
/* ----------- */
-void free_anim_copybuf(void);
+void ANIM_fcurves_copybuf_free(void);
short copy_animedit_keys(struct bAnimContext *ac, ListBase *anim_data);
short paste_animedit_keys(struct bAnimContext *ac, ListBase *anim_data,
const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, bool flip);
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 0ad1dc4..9a41197 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -288,6 +288,11 @@ bool ANIM_remove_driver(struct ReportList *reports, struct ID *id, const char rn
/* -------- */
+/* Clear copy-paste buffer for drivers */
+void ANIM_drivers_copybuf_free(void);
+
+/* -------- */
+
/* Returns whether there is a driver in the copy/paste buffer to paste */
bool ANIM_driver_can_paste(void);
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index c66028b..9cc138b 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -496,7 +496,7 @@ static short copy_action_keys(bAnimContext *ac)
int filter, ok = 0;
/* clear buffer first */
- free_anim_copybuf();
+ ANIM_fcurves_copybuf_free();
/* filter data */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 10baed8..4ebb9ce 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -789,7 +789,7 @@ static short copy_graph_keys(bAnimContext *ac)
int filter, ok = 0;
/* clear buffer first */
- free_anim_copybuf();
+ ANIM_fcurves_copybuf_free();
/* filter data */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
@@ -2487,7 +2487,7 @@ static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* clear buffer first */
- free_fmodifiers_copybuf();
+ ANIM_fmodifiers_copybuf_free();
/* get the active F-Curve */
ale = get_active_fcurve_channel(&ac);
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index ff71cc4..fd772aa 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -2346,7 +2346,7 @@ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* clear buffer first */
- free_fmodifiers_copybuf();
+ ANIM_fmodifiers_copybuf_free();
/* get a list of the editable tracks being shown in the NLA */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 4dc60a9..3d981b6 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -97,9 +97,11 @@
#include "wm_files.h"
#include "wm_window.h"
+#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_gpencil.h"
#include "ED_keyframing.h"
+#include "ED_keyframes_edit.h"
#include "ED_node.h"
#include "ED_render.h"
#include "ED_space_api.h"
@@ -399,13 +401,6 @@ static void free_openrecent(void)
}
-/* bad stuff*/
-
-// XXX copy/paste buffer stuff...
-extern void free_anim_copybuf(void);
-extern void free_anim_drivers_copybuf(void);
-extern void free_fmodifiers_copybuf(void);
-
#ifdef WIN32
/* Read console events until there is a key event. Also returns on any error. */
static void wait_for_console_key(void)
@@ -513,9 +508,9 @@ void WM_exit_ext(bContext *C, const bool do_python)
free_blender(); /* blender.c, does entire library and spacetypes */
// free_matcopybuf();
- free_anim_copybuf();
- free_anim_drivers_copybuf();
- free_fmodifiers_copybuf();
+ ANIM_fcurves_copybuf_free();
+ ANIM_drivers_copybuf_free();
+ ANIM_fmodifiers_copybuf_free();
ED_gpencil_anim_copybuf_free();
ED_gpencil_strokes_copybuf_free();
ED_clipboard_posebuf_free();
More information about the Bf-blender-cvs
mailing list