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-05 23:41:39 +0300
committerJulien Duroure <julien.duroure@gmail.com>2018-12-05 23:41:39 +0300
commit3087c4e458dc4e9fd016d2f17e37e0473ce5dce2 (patch)
tree32bbbf5c7f048f8e548cbe25958f81e43d72113b /io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
parent0c494907cf799747fcd33171d1532839001dd729 (diff)
glTF exporter: Options tweaks, image merging fixes
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_image.py9
1 files changed, 6 insertions, 3 deletions
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 d9cc17dc..d9583d08 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -48,7 +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] != 'GLTF':
+ if export_settings[gltf2_blender_export_keys.FORMAT] != 'GLTF_SEPARATE':
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)))
@@ -79,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] == 'GLTF':
+ if export_settings[gltf2_blender_export_keys.FORMAT] == 'GLTF_SEPARATE':
# as usual we just store the data in place instead of already resolving the references
return __get_image_data(sockets_or_slots)
return None
@@ -121,6 +121,7 @@ def __get_image_data(sockets_or_slots):
pixels = [split_pixels_by_channels(result.shader_node.image)[channel]]
else:
pixels = split_pixels_by_channels(result.shader_node.image)
+ channel = 0
file_name = os.path.splitext(result.shader_node.image.name)[0]
@@ -128,12 +129,13 @@ def __get_image_data(sockets_or_slots):
file_name,
result.shader_node.image.size[0],
result.shader_node.image.size[1],
+ channel,
pixels)
if image is None:
image = image_data
else:
- image.add_to_image(image_data)
+ image.add_to_image(channel, image_data)
return image
elif __is_slot(sockets_or_slots):
@@ -144,6 +146,7 @@ def __get_image_data(sockets_or_slots):
texture.name,
texture.image.size[0],
texture.image.size[1],
+ 0,
pixels)
return image_data
else: