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>2018-12-04 20:27:13 +0300
committerJulien Duroure <julien.duroure@gmail.com>2018-12-04 20:27:13 +0300
commitebd3f5a4dc0819520a8de8da80952bbcd05b88bc (patch)
treeb4199b6b914b4b312ae71c375e0a1e81e05a9253 /io_scene_gltf2
parent3aa7c2cc3e50f429616fd8ed2c0276c30ba6fc22 (diff)
glTF: Fix & tweak glTF / Embedded / glb
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-xio_scene_gltf2/__init__.py8
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_export.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_image.py5
3 files changed, 7 insertions, 8 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 10577813..d6b7fd02 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -74,11 +74,11 @@ class ExportGLTF2_Base:
export_format: EnumProperty(
name='Format',
- items=(('GLB', 'Binary (.glb)', 'Exports a single file, with all data packed in binary form. Most efficient and portable, but more difficult to edit later'),
- ('GLTF', 'JSON (.gltf)', 'Exports a single file, with all data packed in JSON. Less efficient than binary, but easier to edit later'),
- ('GLTF_SEPARATE', 'JSON (.gltf + .bin + textures)', 'Exports multiple files, with separate JSON (.gltf), binary (.bin), and texture data. Easiest to edit later')),
+ items=(('GLB', 'glb', 'Exports a single file, with all data packed in binary form. Most efficient and portable, but more difficult to edit later'),
+ ('GLTF_EMBEDDED', 'glTF embedded)', 'Exports a single file, with all data packed in JSON. Less efficient than binary, but easier to edit later'),
+ ('GLTF', 'glTF', 'Exports multiple files, with separate JSON (.gltf), binary (.bin), and texture data. Easiest to edit later')),
description='Output format and embedding options. Binary is most efficient, but JSON (embedded or separate) may be easier to edit later',
- default='GLB'
+ default='GLTF'
)
export_copyright: StringProperty(
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_export.py b/io_scene_gltf2/blender/exp/gltf2_blender_export.py
index 7ef3941d..f2cc9fa5 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_export.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_export.py
@@ -61,7 +61,7 @@ def __create_buffer(exporter, export_settings):
if export_settings[gltf2_blender_export_keys.FORMAT] == 'GLB':
buffer = exporter.finalize_buffer(export_settings[gltf2_blender_export_keys.FILE_DIRECTORY], is_glb=True)
else:
- if export_settings[gltf2_blender_export_keys.FORMAT] == 'GLTF':
+ if export_settings[gltf2_blender_export_keys.FORMAT] == 'GLTF_EMBEDDED':
exporter.finalize_buffer(export_settings[gltf2_blender_export_keys.FILE_DIRECTORY])
else:
exporter.finalize_buffer(export_settings[gltf2_blender_export_keys.FILE_DIRECTORY],
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
index 42dd9bd7..d9cc17dc 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -48,8 +48,7 @@ def __filter_image(sockets_or_slots, export_settings):
def __gather_buffer_view(sockets_or_slots, export_settings):
- if export_settings[gltf2_blender_export_keys.FORMAT] != 'ASCII':
-
+ if export_settings[gltf2_blender_export_keys.FORMAT] != 'GLTF':
image = __get_image_data(sockets_or_slots)
return gltf2_io_binary_data.BinaryData(
data=image.to_image_data(__gather_mime_type(sockets_or_slots, export_settings)))
@@ -80,7 +79,7 @@ def __gather_name(sockets_or_slots, export_settings):
def __gather_uri(sockets_or_slots, export_settings):
- if export_settings[gltf2_blender_export_keys.FORMAT] != 'GLB':
+ if export_settings[gltf2_blender_export_keys.FORMAT] == 'GLTF':
# as usual we just store the data in place instead of already resolving the references
return __get_image_data(sockets_or_slots)
return None