glTF exporter: workaround for image size copy not stored

This commit is contained in:
Julien Duroure 2022-02-12 13:54:55 +01:00
parent dc2d9b0864
commit 3b088fc33d
2 changed files with 4 additions and 2 deletions

View File

@ -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, 8, 15),
"version": (1, 8, 16),
'blender': (3, 1, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -245,8 +245,10 @@ def _make_temp_image_copy(guard: TmpImageGuard, src_image: bpy.types.Image):
tmp_image = guard.image
tmp_image.update()
# See #1564 and T95616
tmp_image.scale(*src_image.size)
if src_image.is_dirty:
if src_image.is_dirty: # Warning, img size change doesn't make it dirty, see T95616
# Unsaved changes aren't copied by .copy(), so do them ourselves
tmp_buf = np.empty(src_image.size[0] * src_image.size[1] * 4, np.float32)
src_image.pixels.foreach_get(tmp_buf)