io_scene_gltf2: lazy import gltf2_io_draco_compression_extension

This commit is contained in:
Campbell Barton 2019-10-10 10:38:06 +11:00
parent d618d26057
commit a7a6252882
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,6 @@ from bpy.props import (StringProperty,
IntProperty)
from bpy.types import Operator
from bpy_extras.io_utils import ImportHelper, ExportHelper
from io_scene_gltf2.io.exp import gltf2_io_draco_compression_extension
#
@ -72,6 +71,7 @@ class ExportGLTF2_Base:
# TODO: refactor to avoid boilerplate
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()
bl_options = {'UNDO', 'PRESET'}
@ -551,6 +551,7 @@ class GLTF_PT_export_geometry_compression(bpy.types.Panel):
bl_options = {'DEFAULT_CLOSED'}
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()
@classmethod
@ -833,4 +834,3 @@ def unregister():
# remove from the export / import menu
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)