forked from sketchfab/blender-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkhronos-gltf.patch
More file actions
75 lines (69 loc) · 2.73 KB
/
khronos-gltf.patch
File metadata and controls
75 lines (69 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
diff --git a/addons/io_scene_gltf2/io/com/gltf2_io.py b/addons/io_scene_gltf2/io/com/gltf2_io.py
index d00a914d..a51ff4e3 100644
--- a/addons/io_scene_gltf2/io/com/gltf2_io.py
+++ b/addons/io_scene_gltf2/io/com/gltf2_io.py
@@ -26,7 +26,7 @@
import sys
import traceback
-from io_scene_gltf2.io.com import gltf2_io_debug
+from . import gltf2_io_debug
def from_int(x):
diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_debug.py b/addons/io_scene_gltf2/io/com/gltf2_io_debug.py
index 290616cc..f987d9e3 100644
--- a/addons/io_scene_gltf2/io/com/gltf2_io_debug.py
+++ b/addons/io_scene_gltf2/io/com/gltf2_io_debug.py
@@ -124,3 +124,17 @@ class Log:
self.hdlr.setFormatter(formatter)
self.logger.addHandler(self.hdlr)
self.logger.setLevel(int(loglevel))
+
+ def getLevels():
+ levels = [
+ (str(logging.CRITICAL), "Critical", "", logging.CRITICAL),
+ (str(logging.ERROR), "Error", "", logging.ERROR),
+ (str(logging.WARNING), "Warning", "", logging.WARNING),
+ (str(logging.INFO), "Info", "", logging.INFO),
+ (str(logging.NOTSET), "NotSet", "", logging.NOTSET)
+ ]
+
+ return levels
+
+ def default():
+ return str(logging.ERROR)
\ No newline at end of file
diff --git a/addons/io_scene_gltf2/io/imp/__init__.py b/addons/io_scene_gltf2/io/imp/__init__.py
index 666fdf3f..81f88469 100644
--- a/addons/io_scene_gltf2/io/imp/__init__.py
+++ b/addons/io_scene_gltf2/io/imp/__init__.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-"""IO imp package."""
+from .gltf2_io_gltf import *
\ No newline at end of file
diff --git a/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py b/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py
index 407afccd..d776d353 100644
--- a/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py
+++ b/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py
@@ -30,20 +30,15 @@ class ImportError(RuntimeError):
class glTFImporter():
"""glTF Importer class."""
- def __init__(self, filename, import_settings):
+ def __init__(self, filename, loglevel=logging.ERROR):
"""initialization."""
self.filename = filename
- self.import_settings = import_settings
self.glb_buffer = None
self.buffers = {}
self.accessor_cache = {}
self.decode_accessor_cache = {}
- self.import_user_extensions = import_settings['import_user_extensions']
-
- if 'loglevel' not in self.import_settings.keys():
- self.import_settings['loglevel'] = logging.ERROR
-
- log = Log(import_settings['loglevel'])
+ self.import_user_extensions = []
+ log = Log(loglevel)
self.log = log.logger
self.log_handler = log.hdlr