Skip to content
Snippets Groups Projects
Commit 60010436 authored by Bastien Montagne's avatar Bastien Montagne
Browse files

Fix [#31039] Obj export adds blendfile name to the texture names (and [31040] too).

bpy_extras.io_utils.path_reference() expects a real dir as base_src, not the blend file name!
parent 911691d6
No related branches found
No related tags found
No related merge requests found
...@@ -42,13 +42,13 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict): ...@@ -42,13 +42,13 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
else: else:
world_amb = Color((0.0, 0.0, 0.0)) world_amb = Color((0.0, 0.0, 0.0))
source_dir = bpy.data.filepath source_dir = os.path.dirname(bpy.data.filepath)
dest_dir = os.path.dirname(filepath) dest_dir = os.path.dirname(filepath)
file = open(filepath, "w", encoding="utf8", newline="\n") file = open(filepath, "w", encoding="utf8", newline="\n")
fw = file.write fw = file.write
fw('# Blender MTL File: %r\n' % os.path.basename(bpy.data.filepath)) fw('# Blender MTL File: %r\n' % (os.path.basename(bpy.data.filepath) or "None"))
fw('# Material Count: %i\n' % len(mtl_dict)) fw('# Material Count: %i\n' % len(mtl_dict))
mtl_dict_values = list(mtl_dict.values()) mtl_dict_values = list(mtl_dict.values())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment