KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 316 forks source link

Add logging level control for gltf exports #2299

Closed buildxyz-git closed 1 week ago

buildxyz-git commented 1 month ago

Issue: Exporting scene as gltf when using python built as a module is very noisy with INFO logging entries.

I have made changes to ExportGLTF2_Base in: blender/scripts/addons_core/io_scene_gltf2/__init__.py

changes support setting the log level instead of using the hardcoded INFO value here which produces way to much output when exporting.

ImportGLTF2 already has a pattern for this here so I created a global set_debug_level function they can both use in the same manner.

The user can now set the log level before exporting by setting bpy.app.debug_value like:

bpy.app.debug_value = 2
bpy.ops.export_scene.gltf(...)

This will solve issue 2267

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

julienduroure commented 3 weeks ago

Thanks for the PR I will have a look soon

julienduroure commented 1 week ago

Merged, thanks!