[Bf-extensions-cvs] [f9696870] master: glTF importer: Permit missing texture.source
Julien Duroure
noreply at git.blender.org
Sat Sep 5 15:25:34 CEST 2020
Commit: f9696870783db9e33b69f29ee61e7e7616d33b8c
Author: Julien Duroure
Date: Sat Sep 5 15:25:26 2020 +0200
Branches: master
https://developer.blender.org/rBAf9696870783db9e33b69f29ee61e7e7616d33b8c
glTF importer:
Permit missing texture.source
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/io/com/gltf2_io.py
===================================================================
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 9d4be397..87798cfd 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, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 4, 11),
+ "version": (1, 4, 12),
'blender': (2, 90, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/io/com/gltf2_io.py b/io_scene_gltf2/io/com/gltf2_io.py
index 7d70b5fb..86a29f5c 100755
--- a/io_scene_gltf2/io/com/gltf2_io.py
+++ b/io_scene_gltf2/io/com/gltf2_io.py
@@ -1117,7 +1117,7 @@ class Texture:
extras = obj.get("extras")
name = from_union([from_str, from_none], obj.get("name"))
sampler = from_union([from_int, from_none], obj.get("sampler"))
- source = from_int(obj.get("source"))
+ source = from_union([from_int, from_none], obj.get("source"))
return Texture(extensions, extras, name, sampler, source)
def to_dict(self):
@@ -1127,7 +1127,7 @@ class Texture:
result["extras"] = from_extra(self.extras)
result["name"] = from_union([from_str, from_none], self.name)
result["sampler"] = from_union([from_int, from_none], self.sampler)
- result["source"] = from_int(self.source) # most viewers can't handle missing sources
+ result["source"] = from_union([from_int, from_none], self.source)
return result
More information about the Bf-extensions-cvs
mailing list