[Bf-blender-cvs] [6950faa24ef] master: Normals Menu: fix Average to be able to specify type.

Howard Trickey noreply at git.blender.org
Wed May 8 13:45:39 CEST 2019


Commit: 6950faa24eff7bf756ebed7e3d86e37966cabfc4
Author: Howard Trickey
Date:   Wed May 8 07:44:15 2019 -0400
Branches: master
https://developer.blender.org/rB6950faa24eff7bf756ebed7e3d86e37966cabfc4

Normals Menu: fix Average to be able to specify type.

Also removed some rogue debugging printfs from normal selection code.

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

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/bmesh/intern/bmesh_mesh.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 33fc3ad28d6..3f67dbd9d6f 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3786,6 +3786,16 @@ class VIEW3D_MT_edit_mesh_normals_set_strength(Menu):
         op.set = True
         op.face_strength = 'STRONG'
 
+class VIEW3D_MT_edit_mesh_normals_average(Menu):
+    bl_label = "Average"
+
+    def draw(self, _context):
+        layout = self.layout
+
+        layout.operator("mesh.average_normals", text="Custom Normal").average_type = 'CUSTOM_NORMAL'
+        layout.operator("mesh.average_normals", text="Face Area").average_type = 'FACE_AREA'
+        layout.operator("mesh.average_normals", text="Corner Angle").average_type = 'CORNER_ANGLE'
+
 class VIEW3D_MT_edit_mesh_normals(Menu):
     bl_label = "Normals"
 
@@ -3803,7 +3813,7 @@ class VIEW3D_MT_edit_mesh_normals(Menu):
         layout.operator("mesh.point_normals", text="Point to Target")
         layout.operator("mesh.merge_normals", text="Merge")
         layout.operator("mesh.split_normals", text="Split")
-        layout.operator("mesh.average_normals", text="Average")
+        layout.menu("VIEW3D_MT_edit_mesh_normals_average", text="Average")
 
         layout.separator()
 
@@ -6489,6 +6499,7 @@ classes = (
     VIEW3D_MT_edit_mesh_normals,
     VIEW3D_MT_edit_mesh_normals_select_strength,
     VIEW3D_MT_edit_mesh_normals_set_strength,
+    VIEW3D_MT_edit_mesh_normals_average,
     VIEW3D_MT_edit_mesh_shading,
     VIEW3D_MT_edit_mesh_weights,
     VIEW3D_MT_edit_mesh_clean,
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index cb10ec9d701..a35d10db697 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -1440,7 +1440,6 @@ static int bm_loop_normal_mark_indiv(BMesh *bm, BLI_bitmap *loops)
      * Note that this is On² piece of code,
      * but it is not designed to be used with huge selection sets,
      * rather with only a few items selected at most.*/
-    printf("using face history selection\n");
     /* Goes from last selected to the first selected element. */
     for (ese = bm->selected.last; ese; ese = ese->prev) {
       if (ese->htype == BM_FACE) {
@@ -1473,7 +1472,6 @@ static int bm_loop_normal_mark_indiv(BMesh *bm, BLI_bitmap *loops)
   else {
     if (sel_faces) {
       /* Only select all loops of selected faces. */
-      printf("using face selection\n");
       BMLoop *l;
       BMFace *f;
       BMIter liter, fiter;
@@ -1487,7 +1485,6 @@ static int bm_loop_normal_mark_indiv(BMesh *bm, BLI_bitmap *loops)
     }
     if (sel_edges) {
       /* Only select all loops of selected edges. */
-      printf("using edge selection\n");
       BMLoop *l;
       BMEdge *e;
       BMIter liter, eiter;
@@ -1510,7 +1507,6 @@ static int bm_loop_normal_mark_indiv(BMesh *bm, BLI_bitmap *loops)
     }
     if (sel_verts) {
       /* Select all loops of selected verts. */
-      printf("using vert selection\n");
       BMLoop *l;
       BMVert *v;
       BMIter liter, viter;



More information about the Bf-blender-cvs mailing list