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? :)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user