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>2008-09-20 14:02:13 +0400
committerJoshua Leung <aligorith@gmail.com>2008-09-20 14:02:13 +0400
commite7c62e903882947afce9dfea5beb1a2ed320cbe3 (patch)
treee7dd5b7e47f4d7bf33ebe707f138f1d6e6a83d45
parent415868b5e2dc1732aebe19c1fbd17d180249d396 (diff)
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.
-rw-r--r--source/blender/src/editipo.c10
-rw-r--r--source/blender/src/transform.c6
-rw-r--r--source/blender/src/transform_conversions.c6
3 files changed, 9 insertions, 13 deletions
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index 09862636085..ecb9e845104 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -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;
}
}
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c
index 705a5f868e7..e21d543d34e 100644
--- a/source/blender/src/transform.c
+++ b/source/blender/src/transform.c
@@ -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 */
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 210a81927c8..7a2ca3f088b 100644
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -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