[Bf-blender-cvs] [997b35f57a5] soc-2018-bevel: Added comments on hn_mode, BMOps on bevel

Rohan Rathi noreply at git.blender.org
Sun Aug 5 05:20:10 CEST 2018


Commit: 997b35f57a5454b5a43d47fddd84459bd19936f0
Author: Rohan Rathi
Date:   Sat Aug 4 22:31:53 2018 +0530
Branches: soc-2018-bevel
https://developer.blender.org/rB997b35f57a5454b5a43d47fddd84459bd19936f0

Added comments on hn_mode, BMOps on bevel

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

M	source/blender/bmesh/intern/bmesh_mesh.c
M	source/blender/bmesh/intern/bmesh_opdefines.c
M	source/blender/bmesh/intern/bmesh_operators.h

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

diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 96707335081..4059cf27f23 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -320,7 +320,6 @@ void BM_mesh_free(BMesh *bm)
  */
 
 /* We use that existing internal API flag, assuming no other tool using it would run concurrently to clnors editing. */
-/* XXX Should we rather add a new internal flag? */
 #define BM_LNORSPACE_UPDATE _FLAG_MF
 
 typedef struct BMEdgesCalcVectorsData {
@@ -1077,7 +1076,6 @@ void BM_lnorspacearr_store(BMesh *bm, float(*r_lnors)[3])
 	bm->spacearr_dirty &= ~(BM_SPACEARR_DIRTY | BM_SPACEARR_DIRTY_ALL);
 }
 
-/* will change later */
 #define CLEAR_SPACEARRAY_THRESHOLD(x) ((x) / 2)
 
 void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 49d160f5d4a..d9093e774e6 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1736,17 +1736,17 @@ static BMOpDefine bmo_bevel_def = {
 	 {"clamp_overlap", BMO_OP_SLOT_BOOL},   /* do not allow beveled edges/vertices to overlap each other */
 	 {"material", BMO_OP_SLOT_INT},         /* material for bevel faces, -1 means get from adjacent faces */
 	 {"loop_slide", BMO_OP_SLOT_BOOL},      /* prefer to slide along edges to having even widths */
-	 {"mark_seam", BMO_OP_SLOT_BOOL},
-	 {"mark_sharp", BMO_OP_SLOT_BOOL},
-	 {"strength", BMO_OP_SLOT_FLT},
-	 {"hnmode", BMO_OP_SLOT_INT},
+	 {"mark_seam", BMO_OP_SLOT_BOOL},		/* extend edge data to allow seams to run across bevels */
+	 {"mark_sharp", BMO_OP_SLOT_BOOL},		/* extend edge data to allow sharp edges to run across bevels */
+	 {"strength", BMO_OP_SLOT_FLT},			/* strength of calculated normal in range (0, 1) for custom clnors */
+	 {"hnmode", BMO_OP_SLOT_INT},			/* harden normals mode used in bevel if enabled */
 	 {{'\0'}},
 	},
 	/* slots_out */
 	{{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
 	 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */
 	 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
-	 {"normals.out", BMO_OP_SLOT_MAPPING},
+	 {"normals.out", BMO_OP_SLOT_MAPPING},				/* output normals per vertex for beveled edges */
 	 {{'\0'}},
 	},
 
diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h
index 9f6ac50a3e5..6d518545967 100644
--- a/source/blender/bmesh/intern/bmesh_operators.h
+++ b/source/blender/bmesh/intern/bmesh_operators.h
@@ -128,10 +128,10 @@ enum {
 };
 
 enum {
-	BEVEL_HN_NONE,
-	BEVEL_HN_FACE,
-	BEVEL_HN_ADJ,
-	BEVEL_HN_FIX_SHA,
+	BEVEL_HN_NONE,			/* Disable harden normals */
+	BEVEL_HN_FACE,			/* harden normals according to face area */
+	BEVEL_HN_ADJ,			/* harden normals according to adjacent 'beveled' faces */
+	BEVEL_HN_FIX_SHA,		/* Special mode to fix normal shading continuity */
 };
 
 extern const BMOpDefine *bmo_opdefines[];



More information about the Bf-blender-cvs mailing list