Fix T47360: Image loading fails when accessible from the CWD
This commit is contained in:
parent
f77110e789
commit
dc2a01ca05
Notes:
blender-bot
2023-02-14 08:14:45 +01:00
Referenced by issue #47360, .blend of Linux-origin causes "Import Images as Planes" to fail, when double-clicked in Windows, but not when loaded from a plain run of Blender.
|
@ -95,6 +95,10 @@ def load_image(imagepath,
|
|||
if convert_callback:
|
||||
path = convert_callback(path)
|
||||
|
||||
# Ensure we're not relying on the 'CWD' to resolve the path.
|
||||
if not os.path.isabs(path):
|
||||
path = os.path.abspath(path)
|
||||
|
||||
try:
|
||||
image = bpy.data.images.load(path, check_existing)
|
||||
except RuntimeError:
|
||||
|
|
Loading…
Reference in New Issue