[Bf-blender-cvs] [7b32c913c18] soc-2018-npr: Change how opti marks inco faces initially

Sebastian Parborg noreply at git.blender.org
Fri Aug 31 15:48:46 CEST 2018


Commit: 7b32c913c183a8f5fec5b63c3672fea346a2c23e
Author: Sebastian Parborg
Date:   Wed Aug 29 11:02:16 2018 +0200
Branches: soc-2018-npr
https://developer.blender.org/rB7b32c913c183a8f5fec5b63c3672fea346a2c23e

Change how opti marks inco faces initially

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

M	source/blender/modifiers/intern/MOD_mybmesh.c

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

diff --git a/source/blender/modifiers/intern/MOD_mybmesh.c b/source/blender/modifiers/intern/MOD_mybmesh.c
index 06514f34409..621bdd86932 100644
--- a/source/blender/modifiers/intern/MOD_mybmesh.c
+++ b/source/blender/modifiers/intern/MOD_mybmesh.c
@@ -65,6 +65,9 @@
 
 #include "DEG_depsgraph_build.h"
 
+//BMesh intern
+#include "../../bmesh/intern/bmesh_private.h"
+
 //TODO this modifier depends on OpenSubDiv. So if it's not compiled in, remove this modifier
 
 #include "../../../../intern/opensubdiv/opensubdiv_capi.h"
@@ -3312,10 +3315,9 @@ static void optimization( MeshData *m_d ){
 				float P[3], no[3];
 
 				BM_ITER_ELEM (face, &iter_f, vert, BM_FACES_OF_VERT) {
-					//TODO mark inconsistent faces in an other way
 					// and only check each face once
-					// look at BM_face_exists_overlap for marks
-					if(face->mat_nr == 5){
+					// taken from BM_face_exists_overlap for marks
+					if(BM_ELEM_API_FLAG_TEST(face, _FLAG_OVERLAP) != 0){
 						//Already added this face to inco_faces
 						continue;
 					}
@@ -3346,7 +3348,7 @@ static void optimization( MeshData *m_d ){
 						IncoFace inface;
 						inface.face = face;
 						inface.back_f = b_f;
-						face->mat_nr = 5;
+						BM_ELEM_API_FLAG_ENABLE(face, _FLAG_OVERLAP);
 						BLI_buffer_append(&inco_faces, IncoFace, inface);
 					}
 
@@ -3354,6 +3356,12 @@ static void optimization( MeshData *m_d ){
 			}
 
 		}
+
+		//Clear _OVERLAP flag
+		for(int face_i = 0; face_i < inco_faces.count; face_i++){
+			IncoFace *inface = &BLI_buffer_at(&inco_faces, IncoFace, face_i);
+			BM_ELEM_API_FLAG_DISABLE(inface->face, _FLAG_OVERLAP);
+		}
 	}
 
 	// 2. Edge flipping



More information about the Bf-blender-cvs mailing list