2.5 - Quick fix for NLA drawing
authorJoshua Leung <aligorith@gmail.com>
Sat, 18 Jul 2009 04:16:51 +0000 (04:16 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 18 Jul 2009 04:16:51 +0000 (04:16 +0000)
When some object had materials that may have been driven/animated, a crash could sometimes occur if some material-slot had no material.

source/blender/editors/animation/anim_filter.c

index 42943475a57d7995dfa7d58229ac8bad0ec7b8cd..ecc8012f3ec9dd6e7505a12f00b0600b01c6f078 100644 (file)
@@ -1471,18 +1471,20 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
                                        for (a=0; a < ob->totcol; a++) {
                                                Material *ma= give_current_material(ob, a);
                                                
-                                               /* if material has relevant animation data, break */
-                                               ANIMDATA_FILTER_CASES(ma, 
-                                                       {
-                                                               /* for the special AnimData blocks only case, we only need to add
-                                                                * the block if it is valid... then other cases just get skipped (hence ok=0)
-                                                                */
-                                                               ANIMDATA_ADD_ANIMDATA(ma);
-                                                               matOk=0;
-                                                       },
-                                                       matOk= 1;, 
-                                                       matOk= 1;, 
-                                                       matOk= 1;)
+                                               if (ma) {
+                                                       /* if material has relevant animation data, break */
+                                                       ANIMDATA_FILTER_CASES(ma, 
+                                                               {
+                                                                       /* for the special AnimData blocks only case, we only need to add
+                                                                        * the block if it is valid... then other cases just get skipped (hence ok=0)
+                                                                        */
+                                                                       ANIMDATA_ADD_ANIMDATA(ma);
+                                                                       matOk=0;
+                                                               },
+                                                               matOk= 1;, 
+                                                               matOk= 1;, 
+                                                               matOk= 1;)
+                                               }
                                                        
                                                if (matOk) 
                                                        break;