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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-01-18 03:35:28 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-18 03:35:28 +0300
commit90e95d896c964bd17b9f46e5f41bcb3ba47618c4 (patch)
treee43558e814f1aeac2a2c5b1a730a121172dd1c0a /source
parent280df5dd470b02c40eb7254efcfea0d617a76075 (diff)
NLA (Un)Mapping Fixes:
Hopefully this time I've finally found the proper fix for this. At least in the mini test-suite I made for this, the new inverse process seemed stable enough. --- Also, tweaked the keyframe drawing code so that it doesn't convert the handles too when performing NLA mapping. This should provide some minor speed boosts when drawing keyframes under these conditions...
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/nla.c18
-rw-r--r--source/blender/editors/animation/keyframes_draw.c4
-rw-r--r--source/blender/makesrna/intern/rna_nla.c2
3 files changed, 5 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 3979586fb19..c9008e91646 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -369,14 +369,7 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short
return strip->end - scale*(cframe - strip->actstart);
}
else if (mode == NLATIME_CONVERT_UNMAP) {
- int repeatsNum = (int)((cframe - strip->start) / (actlength * scale));
-
- /* this method doesn't clip the values to lie within the action range only
- * - the '(repeatsNum * actlength * scale)' compensates for the fmod(...)
- * - the fmod(...) works in the same way as for eval
- */
- return strip->actend - (repeatsNum * actlength * scale)
- - (fmod(cframe - strip->start, actlength*scale) / scale);
+ return strip->actend - (strip->end - cframe) / scale;
}
else /* if (mode == NLATIME_CONVERT_EVAL) */{
if (IS_EQ(cframe, strip->end) && IS_EQ(strip->repeat, ((int)strip->repeat))) {
@@ -399,14 +392,7 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short
return strip->start + scale*(cframe - strip->actstart);
}
else if (mode == NLATIME_CONVERT_UNMAP) {
- int repeatsNum = (int)((cframe - strip->start) / (actlength * scale));
-
- /* this method doesn't clip the values to lie within the action range only
- * - the '(repeatsNum * actlength * scale)' compensates for the fmod(...)
- * - the fmod(...) works in the same way as for eval
- */
- return strip->actstart + (repeatsNum * actlength * scale)
- + (fmod(cframe - strip->start, actlength*scale) / scale);
+ return strip->actstart + (cframe - strip->start) / scale;
}
else /* if (mode == NLATIME_CONVERT_EVAL) */{
if (IS_EQ(cframe, strip->end) && IS_EQ(strip->repeat, ((int)strip->repeat))) {
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 3a48aa0b063..da1233c17f1 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -855,7 +855,7 @@ void fcurve_to_keylist(AnimData *adt, FCurve *fcu, DLRBT_Tree *keys, DLRBT_Tree
if (fcu && fcu->totvert && fcu->bezt) {
/* apply NLA-mapping (if applicable) */
if (adt)
- ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
+ ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0);
/* if getting long keyframes too, grab the BezTriples in a BST for
* accelerated searching...
@@ -892,7 +892,7 @@ void fcurve_to_keylist(AnimData *adt, FCurve *fcu, DLRBT_Tree *keys, DLRBT_Tree
/* unapply NLA-mapping if applicable */
if (adt)
- ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1);
+ ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 0);
}
}
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 79b34a4cfe3..79e6d52766e 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -187,7 +187,7 @@ static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value)
NlaStrip *data= (NlaStrip*)ptr->data;
float actlen, mapping;
- /* set scale value */
+ /* set repeat value */
CLAMP(value, 0.01f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
data->repeat= value;