[Bf-blender-cvs] [e5b53fb28ca] blender2.8: Some cleanup in modifiers' mesh copying.

Bastien Montagne noreply at git.blender.org
Mon May 14 14:34:24 CEST 2018


Commit: e5b53fb28cab9f39f888b7ec1c128b990d3b7a36
Author: Bastien Montagne
Date:   Mon May 14 14:34:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBe5b53fb28cab9f39f888b7ec1c128b990d3b7a36

Some cleanup in modifiers' mesh copying.

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

M	source/blender/modifiers/intern/MOD_boolean.c
M	source/blender/modifiers/intern/MOD_util.c

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

diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 7694265a172..ebe5aacd888 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -119,7 +119,12 @@ static Mesh *get_quick_mesh(
 					result = mesh_self;
 				}
 				else {
-					BKE_id_copy_ex(NULL, &mesh_other->id, (ID **)&result, LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG, false);
+					BKE_id_copy_ex(NULL, &mesh_other->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);
 
 					float imat[4][4];
 					float omat[4][4];
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 6de0cd753cd..f3da8d054ec 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -300,8 +300,9 @@ Mesh *get_mesh(
 		/* pass */
 	}
 	else if (ob->type == OB_MESH) {
-		struct BMeshToMeshParams bmtmp = {0};
-		if (em) mesh = BKE_bmesh_to_mesh_nomain(em->bm, &bmtmp);
+		if (em) {
+			mesh = BKE_bmesh_to_mesh_nomain(em->bm, &(struct BMeshToMeshParams){0});
+		}
 		else {
 			/* TODO(sybren): after modifier conversion of DM to Mesh is done, check whether
 			 * we really need a copy here. Maybe the CoW ob->data can be directly used. */
@@ -309,7 +310,8 @@ Mesh *get_mesh(
 			        NULL, ob->data, (ID **)&mesh,
 			        LIB_ID_CREATE_NO_MAIN |
 			        LIB_ID_CREATE_NO_USER_REFCOUNT |
-			        LIB_ID_CREATE_NO_DEG_TAG,
+			        LIB_ID_CREATE_NO_DEG_TAG |
+			        LIB_ID_COPY_NO_PREVIEW,
 			        false);
 		}



More information about the Bf-blender-cvs mailing list