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-01-29 12:40:49 +0300
committerJoshua Leung <aligorith@gmail.com>2009-01-29 12:40:49 +0300
commit595983cd287c2910728022c01727a4db1d15ab23 (patch)
treef24da3cf0a6d3567c5ecc83d75ae46744858b688 /source/blender/blenkernel/intern/fcurve.c
parentca36e04362d1140fdc61bc052dd7b3dcc81545a0 (diff)
Animato: Added base-code for converting the ugly old bitflag settings
Only object layers have been done for now. The implementation of this should provide a good indicator for how this should be done. Unforunately, the code for animating layer visibility is not that straightforward, since scene->base->layer (not set) settings need to be synchronised with the object->layer (set by Animato) settings.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r--source/blender/blenkernel/intern/fcurve.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index bb627039639..bfc193254fe 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -106,7 +106,7 @@ FCurve *copy_fcurve (FCurve *fcu)
fcu_d->rna_path= MEM_dupallocN(fcu_d->rna_path);
/* copy driver */
- //fcurve_copy_driver();
+ fcu_d->driver= fcurve_copy_driver(fcu_d->driver);
/* copy modifiers */
fcurve_copy_modifiers(&fcu_d->modifiers, &fcu->modifiers);
@@ -438,6 +438,24 @@ void fcurve_free_driver(FCurve *fcu)
fcu->driver= NULL;
}
+/* This makes a copy of the given driver */
+ChannelDriver *fcurve_copy_driver (ChannelDriver *driver)
+{
+ ChannelDriver *ndriver;
+
+ /* sanity checks */
+ if (driver == NULL)
+ return NULL;
+
+ /* copy all data */
+ ndriver= MEM_dupallocN(driver);
+ ndriver->rna_path= MEM_dupallocN(ndriver->rna_path);
+ ndriver->rna_path2= MEM_dupallocN(ndriver->rna_path2);
+
+ /* return the new driver */
+ return ndriver;
+}
+
/* Driver Evaluation -------------------------- */
/* Helper function to obtain a value using RNA from the specified source (for evaluating drivers)