Revision: 16623
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16623
Author:   aligorith
Date:     2008-09-20 12:02:13 +0200 (Sat, 20 Sep 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/src/editipo.c
    trunk/blender/source/blender/src/transform.c
    trunk/blender/source/blender/src/transform_conversions.c

Modified: trunk/blender/source/blender/src/editipo.c
===================================================================
--- trunk/blender/source/blender/src/editipo.c  2008-09-20 09:17:40 UTC (rev 
16622)
+++ trunk/blender/source/blender/src/editipo.c  2008-09-20 10:02:13 UTC (rev 
16623)
@@ -3589,15 +3589,11 @@
                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;
        }
 }
 

Modified: trunk/blender/source/blender/src/transform.c
===================================================================
--- trunk/blender/source/blender/src/transform.c        2008-09-20 09:17:40 UTC 
(rev 16622)
+++ trunk/blender/source/blender/src/transform.c        2008-09-20 10:02:13 UTC 
(rev 16623)
@@ -2548,9 +2548,9 @@
                                        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 */

Modified: trunk/blender/source/blender/src/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/src/transform_conversions.c    2008-09-20 
09:17:40 UTC (rev 16622)
+++ trunk/blender/source/blender/src/transform_conversions.c    2008-09-20 
10:02:13 UTC (rev 16623)
@@ -4033,7 +4033,7 @@
                        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 @@
                                
                                for(ik= elems.first; ik; ik= ik->next)
                                        t->total++;
-
+                               
                                if(elems.first==NULL)
                                        t->total++;
                        }
@@ -4074,7 +4074,7 @@
                        }
 
                        /* 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
                                


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to