From 2f13b191ad9fa01915cd62739f99598529a21f0b Mon Sep 17 00:00:00 2001 From: Julien Duroure <julien.duroure@gmail.com> Date: Tue, 3 Dec 2019 06:50:20 +0100 Subject: [PATCH] glTF exporter: fix spam debug print --- io_scene_gltf2/__init__.py | 4 ++-- .../io/exp/gltf2_io_draco_compression_extension.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index e05e588f2..45a09fa27 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin SchmithĂĽsen, Jim Eckerlein, and many external contributors', - "version": (1, 1, 18), + "version": (1, 1, 19), 'blender': (2, 81, 6), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', @@ -564,7 +564,7 @@ class GLTF_PT_export_geometry_compression(bpy.types.Panel): def __init__(self): from io_scene_gltf2.io.exp import gltf2_io_draco_compression_extension - self.is_draco_available = gltf2_io_draco_compression_extension.dll_exists() + self.is_draco_available = gltf2_io_draco_compression_extension.dll_exists(quiet=True) @classmethod def poll(cls, context): diff --git a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py index fc65edbd0..93c326bb1 100644 --- a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py @@ -40,14 +40,15 @@ def dll_path() -> Path: return path if path is not None else '' -def dll_exists() -> bool: +def dll_exists(quiet=False) -> bool: """ Checks whether the DLL path exists. :return: True if the DLL exists. """ exists = dll_path().exists() - print("'{}' ".format(dll_path().absolute()) + ("exists, draco mesh compression is available" if exists else - "does not exist, draco mesh compression not available")) + if quiet is False: + print("'{}' ".format(dll_path().absolute()) + ("exists, draco mesh compression is available" if exists else + "does not exist, draco mesh compression not available")) return exists @@ -175,7 +176,7 @@ def __compress_primitive(primitive, dll, export_settings): enable_normals = 'NORMAL' in attributes tex_coord_attrs = [attributes[attr] for attr in attributes if attr.startswith('TEXCOORD_')] - print_console('INFO', ('Draco exporter: Compressing primitive %s normal attribute and with %d ' + + print_console('INFO', ('Draco exporter: Compressing primitive %s normal attribute and with %d ' + 'texture coordinate attributes, along with positions.') % ('with' if enable_normals else 'without', len(tex_coord_attrs))) -- GitLab