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>2010-01-15 13:34:39 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-15 13:34:39 +0300
commit39ff5d7eb978d16370c37508c012bd9d319ac348 (patch)
treec946d43704c1e8122db612da04a488a41fb75aa3 /source/blender/editors/animation/anim_draw.c
parentaed721e01cc4c0f03b03628f8a5898739c7eaf8e (diff)
Reverting changes made in r25940 with the NLA unmapping.
The reverted code was just blindly restoring the old state of the keyframes; changes to selection state, value changes, handle type, etc. were overridden, and the cases where keyframes were deliberately retimed or otherwise were also ignored. I'm not sure what problems these changes were meant to be solving, but will reassess the situation when I get more info on this.
Diffstat (limited to 'source/blender/editors/animation/anim_draw.c')
-rw-r--r--source/blender/editors/animation/anim_draw.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index fbacd22b360..f8a5a9daa06 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -260,14 +260,17 @@ typedef struct NlaMappingApplyBackup {
/* helper function for ANIM_nla_mapping_apply_fcurve() -> "restore", i.e. mapping points back to action-time */
static short bezt_nlamapping_restore(BeztEditData *bed, BezTriple *bezt)
{
- ListBase *lb= (ListBase*)bed->data2;
- NlaMappingApplyBackup *backup= lb->first;
-
- /* restore beztriple from backup list. this used to use NLATIME_CONVERT_UNMAP,
- but this was not the inverse of NLATIME_CONVERT_MAP and it's not clear how
- that is even possible due to repeats - brecht. */
- *bezt= backup->bezt;
- BLI_freelinkN(lb, backup);
+ /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
+ AnimData *adt= (AnimData *)bed->data;
+ short only_keys= (short)bed->i1;
+
+ /* adjust BezTriple handles only if allowed to */
+ if (only_keys == 0) {
+ bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_UNMAP);
+ bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_UNMAP);
+ }
+
+ bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_UNMAP);
return 0;
}
@@ -277,14 +280,7 @@ static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt)
{
/* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
AnimData *adt= (AnimData*)bed->data;
- ListBase *lb= (ListBase*)bed->data2;
- NlaMappingApplyBackup *backup;
short only_keys= (short)bed->i1;
-
- /* backup for restore later */
- backup= MEM_callocN(sizeof(NlaMappingApplyBackup), "NlaMappingApplyBackup");
- backup->bezt= *bezt;
- BLI_addtail(lb, backup);
/* adjust BezTriple handles only if allowed to */
if (only_keys == 0) {
@@ -302,7 +298,7 @@ static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt)
* - restore = whether to map points back to non-mapped time
* - only_keys = whether to only adjust the location of the center point of beztriples
*/
-void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, short only_keys, ListBase *backup)
+void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, short only_keys)
{
BeztEditData bed;
BeztEditFunc map_cb;
@@ -313,11 +309,7 @@ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, s
*/
memset(&bed, 0, sizeof(BeztEditData));
bed.data= (void *)adt;
- bed.data2= (void *)backup;
bed.i1= (int)only_keys;
-
- if(!restore)
- backup->first= backup->last= NULL;
/* get editing callback */
if (restore)