From 42508e1815c6f9b1ec93f4aeb77cefa93072593d Mon Sep 17 00:00:00 2001
From: Julien Duroure <julien.duroure@gmail.com>
Date: Tue, 7 May 2019 11:15:22 +0200
Subject: [PATCH] glTF importer: Use debug value 101 to display current node
 importing

---
 io_scene_gltf2/__init__.py                       | 2 +-
 io_scene_gltf2/blender/imp/gltf2_blender_gltf.py | 6 ++++++
 io_scene_gltf2/blender/imp/gltf2_blender_node.py | 4 ++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 6b14b8e92..a86736344 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": (0, 9, 5),
+    "version": (0, 9, 6),
     'blender': (2, 80, 0),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
index c3b511a25..fefb80958 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
@@ -29,6 +29,12 @@ class BlenderGlTF():
             bpy.context.scene.render.engine = 'BLENDER_EEVEE'
         BlenderGlTF.pre_compute(gltf)
 
+        gltf.display_current_node = 0
+        if gltf.data.nodes is not None:
+            gltf.display_total_nodes = len(gltf.data.nodes)
+        else:
+            gltf.display_total_nodes = "?"
+
         active_object_name_at_end = None
         if gltf.data.scenes is not None:
             for scene_idx, scene in enumerate(gltf.data.scenes):
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_node.py
index 282144bac..76dadcc17 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_node.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_node.py
@@ -34,6 +34,10 @@ class BlenderNode():
         pynode.blender_object = ""
         pynode.parent = parent
 
+        gltf.display_current_node += 1
+        if bpy.app.debug_value == 101:
+            gltf.log.critical("Node " + str(gltf.display_current_node) + " of " + str(gltf.display_total_nodes) + " (idx " + str(node_idx) + ")")
+
         if pynode.mesh is not None:
 
             instance = False
-- 
GitLab