[Bf-blender-cvs] [6f8a141fad8] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Thu Jul 12 21:45:14 CEST 2018


Commit: 6f8a141fad8819739f0aa7b53c6c43a577571b28
Author: Campbell Barton
Date:   Thu Jul 12 21:43:51 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6f8a141fad8819739f0aa7b53c6c43a577571b28

Merge branch 'master' into blender2.8

===================================================================



===================================================================

diff --cc source/blender/blenkernel/intern/mesh_evaluate.c
index 8194e21cbb1,6a3d74aec64..38e0d79d78c
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@@ -3031,132 -3160,8 +3031,8 @@@ void BKE_mesh_recalc_looptri
  #undef ML_TO_MLT
  }
  
- /* -------------------------------------------------------------------- */
- 
- 
- #ifdef USE_BMESH_SAVE_AS_COMPAT
- 
- /**
-  * This function recreates a tessellation.
-  * returns number of tessellation faces.
-  *
-  * for forwards compat only quad->tri polys to mface, skip ngons.
-  */
- int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
-                             struct CustomData *pdata, int totface, int UNUSED(totloop), int totpoly)
- {
- 	MLoop *mloop;
- 
- 	unsigned int lindex[4];
- 	int i;
- 	int k;
- 
- 	MPoly *mp, *mpoly;
- 	MFace *mface, *mf;
- 
- 	const int numUV = CustomData_number_of_layers(ldata, CD_MLOOPUV);
- 	const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
- 	const bool hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
- 	const bool hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
- 	const bool hasLNor = CustomData_has_layer(ldata, CD_NORMAL);
- 
- 	/* over-alloc, ngons will be skipped */
- 	mface = MEM_malloc_arrayN((size_t)totpoly, sizeof(*mface), __func__);
- 
- 	mpoly = CustomData_get_layer(pdata, CD_MPOLY);
- 	mloop = CustomData_get_layer(ldata, CD_MLOOP);
- 
- 	mp = mpoly;
- 	k = 0;
- 	for (i = 0; i < totpoly; i++, mp++) {
- 		if (ELEM(mp->totloop, 3, 4)) {
- 			const unsigned int mp_loopstart = (unsigned int)mp->loopstart;
- 			mf = &mface[k];
- 
- 			mf->mat_nr = mp->mat_nr;
- 			mf->flag = mp->flag;
- 
- 			mf->v1 = mp_loopstart + 0;
- 			mf->v2 = mp_loopstart + 1;
- 			mf->v3 = mp_loopstart + 2;
- 			mf->v4 = (mp->totloop == 4) ? (mp_loopstart + 3) : 0;
- 
- 			/* abuse edcode for temp storage and clear next loop */
- 			mf->edcode = (char)mp->totloop; /* only ever 3 or 4 */
- 
- 			k++;
- 		}
- 	}
- 
- 	CustomData_free(fdata, totface);
- 
- 	totface = k;
- 
- 	CustomData_add_layer(fdata, CD_MFACE, CD_ASSIGN, mface, totface);
- 
- 	CustomData_from_bmeshpoly(fdata, ldata, totface);
- 
- 	mp = mpoly;
- 	k = 0;
- 	for (i = 0; i < totpoly; i++, mp++) {
- 		if (ELEM(mp->totloop, 3, 4)) {
- 			mf = &mface[k];
- 
- 			if (mf->edcode == 3) {
- 				/* sort loop indices to ensure winding is correct */
- 				/* NO SORT - looks like we can skip this */
- 
- 				lindex[0] = mf->v1;
- 				lindex[1] = mf->v2;
- 				lindex[2] = mf->v3;
- 				lindex[3] = 0; /* unused */
- 
- 				/* transform loop indices to vert indices */
- 				mf->v1 = mloop[mf->v1].v;
- 				mf->v2 = mloop[mf->v2].v;
- 				mf->v3 = mloop[mf->v3].v;
- 
- 				BKE_mesh_loops_to_mface_corners(
- 				        fdata, ldata, pdata,
- 				        lindex, k, i, 3,
- 				        numUV, numCol, hasPCol, hasOrigSpace, hasLNor);
- 				test_index_face(mf, fdata, k, 3);
- 			}
- 			else {
- 				/* sort loop indices to ensure winding is correct */
- 				/* NO SORT - looks like we can skip this */
- 
- 				lindex[0] = mf->v1;
- 				lindex[1] = mf->v2;
- 				lindex[2] = mf->v3;
- 				lindex[3] = mf->v4;
- 
- 				/* transform loop indices to vert indices */
- 				mf->v1 = mloop[mf->v1].v;
- 				mf->v2 = mloop[mf->v2].v;
- 				mf->v3 = mloop[mf->v3].v;
- 				mf->v4 = mloop[mf->v4].v;
- 
- 				BKE_mesh_loops_to_mface_corners(
- 				        fdata, ldata, pdata,
- 				        lindex, k, i, 4,
- 				        numUV, numCol, hasPCol, hasOrigSpace, hasLNor);
- 				test_index_face(mf, fdata, k, 4);
- 			}
- 
- 			mf->edcode = 0;
- 
- 			k++;
- 		}
- 	}
- 
- 	return k;
- }
- #endif /* USE_BMESH_SAVE_AS_COMPAT */
- 
- 
  static void bm_corners_to_loops_ex(
 -        ID *id, CustomData *fdata, CustomData *ldata, CustomData *pdata,
 +        ID *id, CustomData *fdata, CustomData *ldata,
          MFace *mface, int totloop, int findex, int loopstart, int numTex, int numCol)
  {
  	MTFace *texface;



More information about the Bf-blender-cvs mailing list