glTF importer: add hook before gltf import

This commit is contained in:
Julien Duroure 2022-10-21 18:39:14 +02:00
parent ae3d53a7ce
commit a1706bd0f0
2 changed files with 5 additions and 1 deletions

View File

@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 4, 36),
"version": (3, 4, 37),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -6,6 +6,7 @@ from mathutils import Vector, Quaternion, Matrix
from .gltf2_blender_scene import BlenderScene
from ..com.gltf2_blender_ui import gltf2_KHR_materials_variants_variant, gltf2_KHR_materials_variants_primitive, gltf2_KHR_materials_variants_default_material
from .gltf2_blender_material import BlenderMaterial
from io_scene_gltf2.io.imp.gltf2_io_user_extensions import import_user_extensions
class BlenderGlTF():
@ -16,6 +17,9 @@ class BlenderGlTF():
@staticmethod
def create(gltf):
"""Create glTF main method, with optional profiling"""
import_user_extensions('gather_import_gltf_before_hook', gltf)
profile = bpy.app.debug_value == 102
if profile:
import cProfile, pstats, io