diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2017-10-17 19:39:10 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2017-10-17 19:39:10 +0300 |
commit | 1cb884be35e160740e97065afd6548e6a052c9d8 (patch) | |
tree | bc93243f86ec4f28f65c32619538e1e5857e0b6b /source/blender/blenloader | |
parent | 7d3723a54d8a809d5c95b235e90a12e2f6295f0e (diff) |
Make auto handle placement aware of cyclic extrapolation.
Cyclic extrapolation is implemented as an f-curve modifier, so this
technically violates abstraction separation and is something of a hack.
However without such behavior achieving smooth looping with cyclic
extrapolation is extremely cumbersome.
The new behavior is applied when the first modifier is Cyclic
extrapolation in Repeat or Repeat with Offset mode without
using influence, repeat count or range restrictions.
This change in behavior means that curve handles have to be updated
when the modifier is added, removed or its options change. Due to the
way code is structured, it seems it requires a helper link to the
containing curve from the modifier object.
Reviewers: aligorith
Differential Revision: https://developer.blender.org/D2783
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3b7662be2b2..231b467a0af 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2441,13 +2441,14 @@ static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list) /* NOTE: this assumes that link_list has already been called on the list */ -static void direct_link_fmodifiers(FileData *fd, ListBase *list) +static void direct_link_fmodifiers(FileData *fd, ListBase *list, FCurve *curve) { FModifier *fcm; for (fcm = list->first; fcm; fcm = fcm->next) { /* relink general data */ fcm->data = newdataadr(fd, fcm->data); + fcm->curve = curve; /* do relinking of data for specific types */ switch (fcm->type) { @@ -2537,7 +2538,7 @@ static void direct_link_fcurves(FileData *fd, ListBase *list) /* modifiers */ link_list(fd, &fcu->modifiers); - direct_link_fmodifiers(fd, &fcu->modifiers); + direct_link_fmodifiers(fd, &fcu->modifiers, fcu); } } @@ -2642,7 +2643,7 @@ static void direct_link_nladata_strips(FileData *fd, ListBase *list) /* strip's F-Modifiers */ link_list(fd, &strip->modifiers); - direct_link_fmodifiers(fd, &strip->modifiers); + direct_link_fmodifiers(fd, &strip->modifiers, NULL); } } |