[Bf-extensions-cvs] [520b6af2] master: glTF importer: fix bug on windows, use absolute path

Julien Duroure noreply at git.blender.org
Wed Mar 11 06:47:19 CET 2020


Commit: 520b6af2be38066566ae52781de14e510a0ee987
Author: Julien Duroure
Date:   Wed Mar 11 06:46:55 2020 +0100
Branches: master
https://developer.blender.org/rBA520b6af2be38066566ae52781de14e510a0ee987

glTF importer: fix bug on windows, use absolute path

===================================================================

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 61ab3dc3..40e40158 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
 bl_info = {
     'name': 'glTF 2.0 format',
     'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
-    "version": (1, 2, 40),
+    "version": (1, 2, 41),
     'blender': (2, 82, 7),
     '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 0075b7f4..92eed8d4 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_image.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_image.py
@@ -58,7 +58,7 @@ class BlenderImage():
                 path = tmp_file.name
 
             num_images = len(bpy.data.images)
-            blender_image = bpy.data.images.load(path, check_existing=img_from_file)
+            blender_image = bpy.data.images.load(os.path.abspath(path), check_existing=img_from_file)
             if len(bpy.data.images) != num_images:  # If created a new image
                 blender_image.name = img_name
                 if gltf.import_settings['import_pack_images'] or not img_from_file:



More information about the Bf-extensions-cvs mailing list