=bmesh= merge from trunk at r36529
[blender.git] / source / blender / editors / util / crazyspace.c
index ac403e716271342ab1e64b9c074ce1f320750766..1dd24db36ec2ba6151e1458a462c80fec6e4fc52 100644 (file)
@@ -455,7 +455,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
                        if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
 
                        if(mti->type==eModifierTypeType_OnlyDeform) {
-                               /* skip leading modifiers which have been alredy
+                               /* skip leading modifiers which have been already
                                   handled in sculpt_get_first_deform_matrices */
                                if(mti->deformMatrices && !deformed)
                                        continue;
@@ -480,4 +480,15 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
                MEM_freeN(origVerts);
                MEM_freeN(quats);
        }
+
+       if(!*deformmats) {
+               int a, numVerts;
+               Mesh *me= (Mesh*)ob->data;
+
+               *deformcos= mesh_getVertexCos(me, &numVerts);
+               *deformmats= MEM_callocN(sizeof(*(*deformmats))*numVerts, "defmats");
+
+               for(a=0; a<numVerts; a++)
+                       unit_m3((*deformmats)[a]);
+       }
 }