Fix T47986: OBJ Import fails w/ imagepath encoding
This commit is contained in:
@@ -80,9 +80,12 @@ def load_image(imagepath,
|
||||
# Utility Functions
|
||||
|
||||
def _image_load_placeholder(path):
|
||||
name = bpy.path.basename(path)
|
||||
if type(name) == bytes:
|
||||
name = name.decode("utf-8", "replace")
|
||||
name = path
|
||||
if type(path) is str:
|
||||
name = name.encode("utf-8", "replace")
|
||||
name = name.decode("utf-8", "replace")
|
||||
name = os.path.basename(name)
|
||||
|
||||
image = bpy.data.images.new(name, 128, 128)
|
||||
# allow the path to be resolved later
|
||||
image.filepath = path
|
||||
@@ -147,6 +150,8 @@ def load_image(imagepath,
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
imagepath = bpy.path.native_pathsep(imagepath)
|
||||
|
||||
if verbose:
|
||||
print("load_image('%s', '%s', ...)" % (imagepath, dirname))
|
||||
|
||||
|
Reference in New Issue
Block a user