Fix T47360: Image loading fails when accessible from the CWD

This commit is contained in:
Campbell Barton 2016-02-08 18:19:50 +11:00
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.
1 changed files with 4 additions and 0 deletions

View File

@ -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: