[Bf-blender-cvs] [3b967b273c8] temp-modifier-rm-cddm: Merge remote-tracking branch 'origin/blender2.8' into temp-modifier-rm-cddm
Sybren A. Stüvel
noreply at git.blender.org
Wed Apr 25 12:43:02 CEST 2018
Commit: 3b967b273c837683fa8dcbf4fdf31e5ed944de2a
Author: Sybren A. Stüvel
Date: Wed Apr 25 12:41:07 2018 +0200
Branches: temp-modifier-rm-cddm
https://developer.blender.org/rB3b967b273c837683fa8dcbf4fdf31e5ed944de2a
Merge remote-tracking branch 'origin/blender2.8' into temp-modifier-rm-cddm
===================================================================
===================================================================
diff --cc source/blender/modifiers/intern/MOD_mirror.c
index 8d39a6d8b7f,84667e278fc..d31e4426b96
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@@ -132,19 -131,35 +132,33 @@@ static Mesh *doMirrorOnAxis(MirrorModif
mul_m4_m4m4(mtx, itmp, mtx);
}
- result = CDDM_from_template(dm, maxVerts * 2, maxEdges * 2, 0, maxLoops * 2, maxPolys * 2);
+ result = BKE_mesh_from_template(mesh, maxVerts * 2, maxEdges * 2, 0, maxLoops * 2, maxPolys * 2);
/*copy customdata to original geometry*/
- DM_copy_vert_data(dm, result, 0, 0, maxVerts);
- DM_copy_edge_data(dm, result, 0, 0, maxEdges);
- DM_copy_loop_data(dm, result, 0, 0, maxLoops);
- DM_copy_poly_data(dm, result, 0, 0, maxPolys);
-
+ CustomData_copy_data(&mesh->vdata, &result->vdata, 0, 0, maxVerts);
+ CustomData_copy_data(&mesh->edata, &result->edata, 0, 0, maxEdges);
+ CustomData_copy_data(&mesh->ldata, &result->ldata, 0, 0, maxLoops);
+ CustomData_copy_data(&mesh->pdata, &result->pdata, 0, 0, maxPolys);
+ /* Subsurf for eg wont have mesh data in the custom data arrays.
+ * now add mvert/medge/mpoly layers. */
+
+ if (!CustomData_has_layer(&dm->vertData, CD_MVERT)) {
+ dm->copyVertArray(dm, CDDM_get_verts(result));
+ }
+ if (!CustomData_has_layer(&dm->edgeData, CD_MEDGE)) {
+ dm->copyEdgeArray(dm, CDDM_get_edges(result));
+ }
+ if (!CustomData_has_layer(&dm->polyData, CD_MPOLY)) {
+ dm->copyLoopArray(dm, CDDM_get_loops(result));
+ dm->copyPolyArray(dm, CDDM_get_polys(result));
+ }
+
- /* copy customdata to new geometry,
- * copy from its self because this data may have been created in the checks above */
- DM_copy_vert_data(result, result, 0, maxVerts, maxVerts);
- DM_copy_edge_data(result, result, 0, maxEdges, maxEdges);
+ /* copy customdata to new geometry */
+ CustomData_copy_data(&result->vdata, &result->vdata, 0, maxVerts, maxVerts);
+ CustomData_copy_data(&result->edata, &result->edata, 0, maxEdges, maxEdges);
/* loops are copied later */
- DM_copy_poly_data(result, result, 0, maxPolys, maxPolys);
+ CustomData_copy_data(&result->pdata, &result->pdata, 0, maxPolys, maxPolys);
if (do_vtargetmap) {
/* second half is filled with -1 */
More information about the Bf-blender-cvs
mailing list