[Bf-blender-cvs] [76d602f38d0] blender2.8: Add option not to print debug/info in ngon_tessellate.

Bastien Montagne noreply at git.blender.org
Tue Nov 20 12:35:48 CET 2018


Commit: 76d602f38d0a948f9d6b03edc4d26153f970fb1c
Author: Bastien Montagne
Date:   Tue Nov 20 11:37:01 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB76d602f38d0a948f9d6b03edc4d26153f970fb1c

Add option not to print debug/info in ngon_tessellate.

That func can be called a lot, generating a lot of noise in the
console...

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

M	release/scripts/modules/bpy_extras/mesh_utils.py

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

diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py
index a09282da2fe..85356206482 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -239,7 +239,7 @@ def edge_loops_from_edges(mesh, edges=None):
     return line_polys
 
 
-def ngon_tessellate(from_data, indices, fix_loops=True):
+def ngon_tessellate(from_data, indices, fix_loops=True, debug_print=True):
     """
     Takes a polyline of indices (fgon) and returns a list of face
     index lists. Designed to be used for importers that need indices for an
@@ -405,7 +405,8 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
         fill = [[vert_map[i] for i in reversed(f)] for f in fill]
 
     if not fill:
-        print('Warning Cannot scanfill, fallback on a triangle fan.')
+        if debug_print:
+            print('Warning Cannot scanfill, fallback on a triangle fan.')
         fill = [[0, i - 1, i] for i in range(2, len(indices))]
     else:
         # Use real scanfill.



More information about the Bf-blender-cvs mailing list