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:
authorCampbell Barton <ideasman42@gmail.com>2017-10-18 08:40:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-18 08:40:31 +0300
commit54f9a6e5da06e671f7640c9ec3ac3c305644beb6 (patch)
tree6d9968f97e56bdb0758cfea123a1ca00c2bd799a /source/blender/editors/animation
parent0bcb61b2fe94d389332f91762cf07c2691c9fb93 (diff)
parent92611dada67fcc151c894462749031be1de27191 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/drivers.c2
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 1a3d82e5002..e686e278740 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -125,7 +125,7 @@ FCurve *verify_driver_fcurve(ID *id, const char rna_path[], const int array_inde
* Create FModifier so that old scripts won't break
* for now before 2.7 series -- (September 4, 2013)
*/
- add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR);
+ add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR, fcu);
}
else {
/* add 2 keyframes so that user has something to work with
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 6bb73416fec..8d77460e197 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -736,7 +736,7 @@ bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active)
/* 'Paste' the F-Modifier(s) from the buffer to the specified list
* - replace: free all the existing modifiers to leave only the pasted ones
*/
-bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace)
+bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace, FCurve *curve)
{
FModifier *fcm;
bool ok = false;
@@ -745,6 +745,8 @@ bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace)
if (modifiers == NULL)
return 0;
+ bool was_cyclic = curve && BKE_fcurve_is_cyclic(curve);
+
/* if replacing the list, free the existing modifiers */
if (replace)
free_fmodifiers(modifiers);
@@ -753,6 +755,8 @@ bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace)
for (fcm = fmodifier_copypaste_buf.first; fcm; fcm = fcm->next) {
/* make a copy of it */
FModifier *fcmN = copy_fmodifier(fcm);
+
+ fcmN->curve = curve;
/* make sure the new one isn't active, otherwise the list may get several actives */
fcmN->flag &= ~FMODIFIER_FLAG_ACTIVE;
@@ -762,6 +766,10 @@ bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace)
ok = 1;
}
+ /* adding or removing the Cycles modifier requires an update to handles */
+ if (curve && BKE_fcurve_is_cyclic(curve) != was_cyclic)
+ calchandles_fcurve(curve);
+
/* did we succeed? */
return ok;
}