[Bf-extensions-cvs] [a2650c01] master: glTF importer: Add missing image name
Julien Duroure
noreply at git.blender.org
Sat Jun 25 06:41:25 CEST 2022
Commit: a2650c0158eeb6488e21204887c98d376d881f72
Author: Julien Duroure
Date: Sat Jun 25 06:40:58 2022 +0200
Branches: master
https://developer.blender.org/rBAa2650c0158eeb6488e21204887c98d376d881f72
glTF importer: Add missing image name
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/blender/imp/gltf2_blender_image.py
===================================================================
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index ce48f293..e9e6660e 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,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": (3, 3, 5),
+ "version": (3, 3, 6),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_image.py b/io_scene_gltf2/blender/imp/gltf2_blender_image.py
index 4f9af799..abce0354 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_image.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_image.py
@@ -83,7 +83,7 @@ def create_from_data(gltf, img_idx):
img_data = BinaryData.get_image_data(gltf, img_idx)
if img_data is None:
return
- img_name = 'Image_%d' % img_idx
+ img_name = gltf.data.images[img_idx].name or 'Image_%d' % img_idx
# Create image, width and height are dummy values
blender_image = bpy.data.images.new(img_name, 8, 8)
More information about the Bf-extensions-cvs
mailing list