diff options
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 94aed7c7a01..0fd030be39c 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -274,7 +274,7 @@ void DM_init_funcs(DerivedMesh *dm) } void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges, - int numTessFaces, int numLoops, int numPolys) + int numTessFaces, int numLoops, int numPolys) { dm->type = type; dm->numVertData = numVerts; @@ -1223,7 +1223,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag, for (i=0; i<dm->numPolyData; i++, mp++) { ml = mloop + mp->loopstart; - BLI_array_growitems(wtcol_l, mp->totloop); + BLI_array_grow_items(wtcol_l, mp->totloop); for (j = 0; j < mp->totloop; j++, ml++, totloop++) { copy_v4_v4_char((char *)&wtcol_l[totloop], (char *)&wtcol_v[4 * ml->v]); @@ -2137,7 +2137,7 @@ static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask, if ((ob->mode & OB_MODE_SCULPT) && ob->sculpt) { /* create PBVH immediately (would be created on the fly too, - but this avoids waiting on first stroke) */ + * but this avoids waiting on first stroke) */ ob->sculpt->pbvh= ob->derivedFinal->getPBVH(ob, ob->derivedFinal); } } @@ -2279,8 +2279,10 @@ DerivedMesh *editbmesh_get_derived_cage_and_final(Scene *scene, Object *obedit, * the data we need, rebuild the derived mesh */ if (!em->derivedCage || - (em->lastDataMask & dataMask) != dataMask) + (em->lastDataMask & dataMask) != dataMask) + { editbmesh_build_data(scene, obedit, em, dataMask); + } *final_r = em->derivedFinal; return em->derivedCage; @@ -2292,8 +2294,10 @@ DerivedMesh *editbmesh_get_derived_cage(Scene *scene, Object *obedit, BMEditMesh * the data we need, rebuild the derived mesh */ if (!em->derivedCage || - (em->lastDataMask & dataMask) != dataMask) + (em->lastDataMask & dataMask) != dataMask) + { editbmesh_build_data(scene, obedit, em, dataMask); + } return em->derivedCage; } @@ -2701,8 +2705,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) if (nr_tris_to_pile==1 || nr_tris_to_pile==2) { const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 }; int t; - for ( t=0; t<nr_tris_to_pile; t++ ) - { + for ( t=0; t<nr_tris_to_pile; t++ ) { float f2x_area_uv; float * p0 = verts[indices[t*3+0]]; float * p1 = verts[indices[t*3+1]]; @@ -2769,7 +2772,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, for (b = 0; b < gattribs->totlayer; b++) { if (gattribs->layer[b].type == CD_MTFACE) { /* uv coordinates */ - if(dm->type == DM_TYPE_EDITBMESH) { + if (dm->type == DM_TYPE_EDITBMESH) { /* exception .. */ CustomData *ldata = dm->getLoopDataLayout(dm); @@ -2806,7 +2809,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, } } else if (gattribs->layer[b].type == CD_MCOL) { - if(dm->type == DM_TYPE_EDITBMESH) { + if (dm->type == DM_TYPE_EDITBMESH) { /* exception .. */ CustomData *ldata = dm->getLoopDataLayout(dm); |