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:
authorTon Roosendaal <ton@blender.org>2008-01-14 18:16:59 +0300
committerTon Roosendaal <ton@blender.org>2008-01-14 18:16:59 +0300
commitcdcba166f63dcb3c87bf1c99c4b7aae4f3481701 (patch)
tree1ced3917ff020e24af982ad2063139b1e55b04b5 /source
parent54be577d68839bd20c9d9cbf9d129995b0b9792c (diff)
Bad bad bug!
Newly added strip->scale was never initialized 1.0f on adding, causing divide by zero in NLA/Action UI. Bug since september or so... is nobody using NLA? :)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/action.c2
-rw-r--r--source/blender/src/editnla.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 4dab625d2c9..61668ddb0eb 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -441,6 +441,8 @@ static float get_actionstrip_frame(bActionStrip *strip, float cframe, int invert
float length, actlength, repeat, scale;
repeat = (strip->flag & ACTSTRIP_USESTRIDE) ? (1.0f) : (strip->repeat);
+ if(strip->scale == 0.0f) strip->scale= 1.0f;
+
scale = abs(strip->scale); /* scale must be positive (for now) */
actlength = strip->actend-strip->actstart;
diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c
index a75f5a211b7..05e030bf80b 100644
--- a/source/blender/src/editnla.c
+++ b/source/blender/src/editnla.c
@@ -581,7 +581,7 @@ static void add_nla_block(short event)
/* simple prevention of zero strips */
if(strip->start>strip->end-2)
strip->end= strip->start+100;
- strip->repeat = 1.0;
+ strip->repeat = strip->scale= 1.0f;
strip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION;
@@ -620,6 +620,7 @@ static void add_nla_block_by_name(char name[32], Object *ob, short hold, short a
/* Initialize the new action block */
strip = MEM_callocN(sizeof(bActionStrip), "bActionStrip");
+ strip->scale= 1.0f;
deselect_nlachannel_keys(0);