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

Campbell Barton noreply at git.blender.org
Sun Aug 27 08:30:23 CEST 2017


Commit: ca9801bd427ce2e76a992b62d476859efcc14547
Author: Campbell Barton
Date:   Sun Aug 27 16:35:51 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBca9801bd427ce2e76a992b62d476859efcc14547

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/bmesh/intern/bmesh_mesh_conv.c
index 025377b04aa,7787d704b59..6cc1f37db43
--- a/source/blender/bmesh/intern/bmesh_mesh_conv.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c
@@@ -199,17 -243,10 +207,10 @@@ void BM_mesh_bm_from_me
  	BMEdge *e, **etable = NULL;
  	BMFace *f, **ftable = NULL;
  	float (*keyco)[3] = NULL;
- 	int totloops, i, j;
- 
- 	/* free custom data */
- 	/* this isnt needed in most cases but do just incase */
- 	CustomData_free(&bm->vdata, bm->totvert);
- 	CustomData_free(&bm->edata, bm->totedge);
- 	CustomData_free(&bm->ldata, bm->totloop);
- 	CustomData_free(&bm->pdata, bm->totface);
 -	int totuv, totloops, i;
++	int totloops, i;
  
  	if (!me || !me->totvert) {
- 		if (me) { /*no verts? still copy customdata layout*/
+ 		if (me && is_new) { /*no verts? still copy customdata layout*/
  			CustomData_copy(&me->vdata, &bm->vdata, CD_MASK_BMESH, CD_ASSIGN, 0);
  			CustomData_copy(&me->edata, &bm->edata, CD_MASK_BMESH, CD_ASSIGN, 0);
  			CustomData_copy(&me->ldata, &bm->ldata, CD_MASK_BMESH, CD_ASSIGN, 0);
@@@ -223,12 -260,27 +224,20 @@@
  		return; /* sanity check */
  	}
  
- 	vtable = MEM_mallocN(sizeof(BMVert **) * me->totvert, __func__);
+ 	if (is_new) {
+ 		CustomData_copy(&me->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
+ 		CustomData_copy(&me->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
+ 		CustomData_copy(&me->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
+ 		CustomData_copy(&me->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
 -
 -		/* make sure uv layer names are consisten */
 -		totuv = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
 -		for (i = 0; i < totuv; i++) {
 -			int li = CustomData_get_layer_index_n(&bm->pdata, CD_MTEXPOLY, i);
 -			CustomData_set_layer_name(&bm->ldata, CD_MLOOPUV, i, bm->pdata.layers[li].name);
 -		}
+ 	}
  
- 	CustomData_copy(&me->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
- 	CustomData_copy(&me->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
- 	CustomData_copy(&me->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
- 	CustomData_copy(&me->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
+ 	/* -------------------------------------------------------------------- */
+ 	/* Shape Key */
+ 	int tot_shape_keys = me->key ? BLI_listbase_count(&me->key->block) : 0;
+ 	if (is_new == false) {
+ 		tot_shape_keys = min_ii(tot_shape_keys, CustomData_number_of_layers(&bm->vdata, CD_SHAPEKEY));
+ 	}
+ 	const float (**shape_key_table)[3] = tot_shape_keys ? BLI_array_alloca(shape_key_table, tot_shape_keys) : NULL;
  
  	if ((params->active_shapekey != 0) && (me->key != NULL)) {
  		actkey = BLI_findlink(&me->key->block, params->active_shapekey - 1);
diff --cc tests/gtests/blenlib/CMakeLists.txt
index 21b1d173e76,ffdb8d08d31..e64bcf821de
--- a/tests/gtests/blenlib/CMakeLists.txt
+++ b/tests/gtests/blenlib/CMakeLists.txt
@@@ -37,22 -42,19 +42,20 @@@ endif(
  
  BLENDER_TEST(BLI_array_store "bf_blenlib")
  BLENDER_TEST(BLI_array_utils "bf_blenlib")
- BLENDER_TEST(BLI_kdopbvh "bf_blenlib;bf_intern_eigen")
- BLENDER_TEST(BLI_stack "bf_blenlib")
- BLENDER_TEST(BLI_math_color "bf_blenlib")
- BLENDER_TEST(BLI_math_geom "bf_blenlib;bf_intern_eigen")
+ BLENDER_TEST(BLI_ghash "bf_blenlib")
+ BLENDER_TEST(BLI_hash_mm2a "bf_blenlib")
+ BLENDER_TEST(BLI_kdopbvh "bf_blenlib")
+ BLENDER_TEST(BLI_listbase "bf_blenlib")
  BLENDER_TEST(BLI_math_base "bf_blenlib")
+ BLENDER_TEST(BLI_math_color "bf_blenlib")
+ BLENDER_TEST(BLI_math_geom "bf_blenlib")
 +BLENDER_TEST(BLI_memiter "bf_blenlib")
+ BLENDER_TEST(BLI_path_util "${BLI_path_util_extra_libs}")
+ BLENDER_TEST(BLI_polyfill2d "bf_blenlib")
+ BLENDER_TEST(BLI_stack "bf_blenlib")
  BLENDER_TEST(BLI_string "bf_blenlib")
  BLENDER_TEST(BLI_string_utf8 "bf_blenlib")
- if(WIN32)
- 	BLENDER_TEST(BLI_path_util "bf_blenlib;bf_intern_utfconv;extern_wcwidth;${ZLIB_LIBRARIES}")
- else()
- 	BLENDER_TEST(BLI_path_util "bf_blenlib;extern_wcwidth;${ZLIB_LIBRARIES}")
- endif()
- BLENDER_TEST(BLI_polyfill2d "bf_blenlib;bf_intern_eigen")
- BLENDER_TEST(BLI_listbase "bf_blenlib")
- BLENDER_TEST(BLI_hash_mm2a "bf_blenlib")
- BLENDER_TEST(BLI_ghash "bf_blenlib")
  
  BLENDER_TEST_PERFORMANCE(BLI_ghash_performance "bf_blenlib")
+ 
+ unset(BLI_path_util_extra_libs)



More information about the Bf-blender-cvs mailing list