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:
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_image.py')
-rw-r--r--io_scene_gltf2/blender/exp/gltf2_blender_image.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_image.py b/io_scene_gltf2/blender/exp/gltf2_blender_image.py
index a0952bb5..8ac272d8 100644
--- a/io_scene_gltf2/blender/exp/gltf2_blender_image.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_image.py
@@ -64,9 +64,12 @@ class ExportImage:
intelligent decisions about how to encode the image.
"""
- def __init__(self):
+ def __init__(self, original=None):
self.fills = {}
+ # In case of keeping original texture images
+ self.original = original
+
@staticmethod
def from_blender_image(image: bpy.types.Image):
export_image = ExportImage()
@@ -74,6 +77,10 @@ class ExportImage:
export_image.fill_image(image, dst_chan=chan, src_chan=chan)
return export_image
+ @staticmethod
+ def from_original(image: bpy.types.Image):
+ return ExportImage(image)
+
def fill_image(self, image: bpy.types.Image, dst_chan: Channel, src_chan: Channel):
self.fills[dst_chan] = FillImage(image, src_chan)
@@ -84,7 +91,10 @@ class ExportImage:
return chan in self.fills
def empty(self) -> bool:
- return not self.fills
+ if self.original is None:
+ return not self.fills
+ else:
+ return False
def blender_image(self) -> Optional[bpy.types.Image]:
"""If there's an existing Blender image we can use,