diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-13 09:37:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-13 09:40:17 +0300 |
commit | a855a763c253fd61fce49002307b2c6f14aa50ed (patch) | |
tree | 11c6a4850194154182a7fb46a1957748cb6a7322 /source/blender/blenkernel/intern/mesh_convert.c | |
parent | a81d0108fc8c7cdea14042e7a59ab00ba2633e72 (diff) | |
parent | fb5597540decca4b490089134890d3e575477e95 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_convert.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index 3fc5d1ca51c..738f116310b 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -134,9 +134,10 @@ void BKE_mesh_from_metaball(ListBase *lb, Mesh *me) /** * Specialized function to use when we _know_ existing edges don't overlap with poly edges. */ -static void make_edges_mdata_extend(MEdge **r_alledge, int *r_totedge, - const MPoly *mpoly, MLoop *mloop, - const int totpoly) +static void make_edges_mdata_extend( + MEdge **r_alledge, int *r_totedge, + const MPoly *mpoly, MLoop *mloop, + const int totpoly) { int totedge = *r_totedge; int totedge_new; @@ -561,10 +562,11 @@ void BKE_mesh_from_nurbs_displist( cu = ob->data; if (dm == NULL) { - if (BKE_mesh_nurbs_displist_to_mdata(ob, dispbase, &allvert, &totvert, - &alledge, &totedge, &allloop, - &allpoly, (use_orco_uv) ? &alluv : NULL, - &totloop, &totpoly) != 0) + if (BKE_mesh_nurbs_displist_to_mdata( + ob, dispbase, &allvert, &totvert, + &alledge, &totedge, &allloop, + &allpoly, (use_orco_uv) ? &alluv : NULL, + &totloop, &totpoly) != 0) { /* Error initializing */ return; @@ -1143,12 +1145,13 @@ Mesh *BKE_mesh_create_derived_for_modifier( float (*deformedVerts)[3] = BKE_mesh_vertexCos_get(me, &numVerts); modifier_deformVerts(md, &mectx, NULL, deformedVerts, numVerts); - BKE_id_copy_ex(NULL, &me->id, (ID **)&result, - LIB_ID_CREATE_NO_MAIN | - LIB_ID_CREATE_NO_USER_REFCOUNT | - LIB_ID_CREATE_NO_DEG_TAG | - LIB_ID_COPY_NO_PREVIEW, - false); + BKE_id_copy_ex( + NULL, &me->id, (ID **)&result, + LIB_ID_CREATE_NO_MAIN | + LIB_ID_CREATE_NO_USER_REFCOUNT | + LIB_ID_CREATE_NO_DEG_TAG | + LIB_ID_COPY_NO_PREVIEW, + false); BKE_mesh_apply_vert_coords(result, deformedVerts); if (build_shapekey_layers) @@ -1158,12 +1161,13 @@ Mesh *BKE_mesh_create_derived_for_modifier( } else { Mesh *mesh_temp; - BKE_id_copy_ex(NULL, &me->id, (ID **)&mesh_temp, - LIB_ID_CREATE_NO_MAIN | - LIB_ID_CREATE_NO_USER_REFCOUNT | - LIB_ID_CREATE_NO_DEG_TAG | - LIB_ID_COPY_NO_PREVIEW, - false); + BKE_id_copy_ex( + NULL, &me->id, (ID **)&mesh_temp, + LIB_ID_CREATE_NO_MAIN | + LIB_ID_CREATE_NO_USER_REFCOUNT | + LIB_ID_CREATE_NO_DEG_TAG | + LIB_ID_COPY_NO_PREVIEW, + false); if (build_shapekey_layers) add_shapekey_layers(mesh_temp, me); @@ -1314,14 +1318,16 @@ void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob, CustomD /* TODO(Sybren): we could probably replace CD_ASSIGN with alloctype and always directly pass mesh_src->mxxx, * instead of using a ternary operator. */ if (!CustomData_has_layer(&tmp.vdata, CD_MVERT)) { - CustomData_add_layer(&tmp.vdata, CD_MVERT, CD_ASSIGN, - (alloctype == CD_ASSIGN) ? mesh_src->mvert : MEM_dupallocN(mesh_src->mvert), - totvert); + CustomData_add_layer( + &tmp.vdata, CD_MVERT, CD_ASSIGN, + (alloctype == CD_ASSIGN) ? mesh_src->mvert : MEM_dupallocN(mesh_src->mvert), + totvert); } if (!CustomData_has_layer(&tmp.edata, CD_MEDGE)) { - CustomData_add_layer(&tmp.edata, CD_MEDGE, CD_ASSIGN, - (alloctype == CD_ASSIGN) ? mesh_src->medge : MEM_dupallocN(mesh_src->medge), - totedge); + CustomData_add_layer( + &tmp.edata, CD_MEDGE, CD_ASSIGN, + (alloctype == CD_ASSIGN) ? mesh_src->medge : MEM_dupallocN(mesh_src->medge), + totedge); } if (!CustomData_has_layer(&tmp.pdata, CD_MPOLY)) { /* TODO(Sybren): assigment to tmp.mxxx is probably not necessary due to the |