Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2020-03-09 18:30:31 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-03-09 18:30:31 +0300
commit5b0b0b3781d1831a06687f89e169150133181b06 (patch)
tree179a4ed7674e1aed18cfbec5adc68302715fd7e4 /io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
parent6e7dfdd8a91fdccae321f6192dd22accb5bc2426 (diff)
glTF importer: speedup import of vertex color
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_gltf.py')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_gltf.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
index 8e6c1950..e00e2449 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
@@ -24,7 +24,26 @@ class BlenderGlTF():
@staticmethod
def create(gltf):
- """Create glTF main method."""
+ """Create glTF main method, with optional profiling"""
+ profile = bpy.app.debug_value == 102
+ if profile:
+ import cProfile, pstats, io
+ from pstats import SortKey
+ pr = cProfile.Profile()
+ pr.enable()
+ BlenderGlTF._create(gltf)
+ pr.disable()
+ s = io.StringIO()
+ sortby = SortKey.TIME
+ ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
+ ps.print_stats()
+ print(s.getvalue())
+ else:
+ BlenderGlTF._create(gltf)
+
+ @staticmethod
+ def _create(gltf):
+ """Create glTF main worker method."""
BlenderGlTF.set_convert_functions(gltf)
BlenderGlTF.pre_compute(gltf)
BlenderScene.create(gltf)