Fix crash in when dding subsurf modifier to curves
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 20 Jun 2013 11:00:35 +0000 (11:00 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 20 Jun 2013 11:00:35 +0000 (11:00 +0000)
Issue was caused by svn rev57566 which didn't take into
account the fact that curves could have dm of type CCGDM
and in this case CDDM_calc_normals_mapping_ex would fail
dramatically.

Added a check around normals update call bout whether
DM is CDDM or not. The same happens in mesh's modifier
stack.

source/blender/blenkernel/intern/displist.c

index e1ecf00104a443662790af778d19ce00815d9e7f..38a0b8483397a4e9c588b7e0a60e1f08146a307e 100644 (file)
@@ -1040,7 +1040,9 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
                                DM_update_tessface_data(dm);
                        }
 
-                       CDDM_calc_normals_mapping_ex(dm, (dm->dirty & DM_DIRTY_NORMALS) ? false : true);
+                       if (dm->type == DM_TYPE_CDDM) {
+                               CDDM_calc_normals_mapping_ex(dm, (dm->dirty & DM_DIRTY_NORMALS) ? false : true);
+                       }
                }
                (*derivedFinal) = dm;
        }