Bugfix #17652: "K" mode for controlling keys and drivers cause crashes
When using a transform and there didn't exist an IPO-channel for that transform's focus (i.e. no rot curves when rotating) and "K" mode was active, there would be a crash due to missing checks for such situations.
This commit is contained in:
@@ -3589,15 +3589,11 @@ void make_ipokey_transform(Object *ob, ListBase *lb, int sel)
|
||||
icu= icu->next;
|
||||
}
|
||||
|
||||
|
||||
ik= lb->first;
|
||||
while(ik) {
|
||||
/* map ipo-keys for drawing/editing if scaled ipo */
|
||||
if (NLA_IPO_SCALED) {
|
||||
if (NLA_IPO_SCALED) {
|
||||
for (ik= lb->first; ik; ik= ik->next) {
|
||||
/* map ipo-keys for drawing/editing if scaled ipo */
|
||||
ik->val= get_action_frame_inv(OBACT, ik->val);
|
||||
}
|
||||
|
||||
ik= ik->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2548,9 +2548,9 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
|
||||
float rot[3];
|
||||
|
||||
/* current IPO value for compatible euler */
|
||||
current_rot[0] = tdi->rotx[0];
|
||||
current_rot[1] = tdi->roty[0];
|
||||
current_rot[2] = tdi->rotz[0];
|
||||
current_rot[0] = (tdi->rotx) ? tdi->rotx[0] : 0.0f;
|
||||
current_rot[1] = (tdi->roty) ? tdi->roty[0] : 0.0f;
|
||||
current_rot[2] = (tdi->rotz) ? tdi->rotz[0] : 0.0f;
|
||||
VecMulf(current_rot, (float)(M_PI_2 / 9.0));
|
||||
|
||||
/* calculate the total rotatation in eulers */
|
||||
|
||||
@@ -4033,7 +4033,7 @@ static void createTransObject(TransInfo *t)
|
||||
ob= base->object;
|
||||
|
||||
/* store ipo keys? */
|
||||
if (ob->id.lib == 0 && ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) {
|
||||
if ((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) {
|
||||
elems.first= elems.last= NULL;
|
||||
make_ipokey_transform(ob, &elems, 1); /* '1' only selected keys */
|
||||
|
||||
@@ -4041,7 +4041,7 @@ static void createTransObject(TransInfo *t)
|
||||
|
||||
for(ik= elems.first; ik; ik= ik->next)
|
||||
t->total++;
|
||||
|
||||
|
||||
if(elems.first==NULL)
|
||||
t->total++;
|
||||
}
|
||||
@@ -4074,7 +4074,7 @@ static void createTransObject(TransInfo *t)
|
||||
}
|
||||
|
||||
/* store ipo keys? */
|
||||
if(ob->id.lib == 0 && ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) {
|
||||
if((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) {
|
||||
|
||||
popfirst(&elems); // bring back pushed listbase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user