From 8369c62f26cc8949a46fb153aa19c7227dcda1c2 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Mon, 10 Jul 2023 22:19:44 -0700 Subject: [PATCH] Fix all non relative image paths in blender, ensure doesn't happen again in export script --- art/Exporter.py | 3 ++- art/art.blend | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/art/Exporter.py b/art/Exporter.py index 7d44809..bca6f3a 100644 --- a/art/Exporter.py +++ b/art/Exporter.py @@ -116,7 +116,8 @@ def ensure_tex_saved_and_get_name(o) -> str: new_path = bpy.path.abspath(f"//{image_filename}") assert not os.path.exists(new_path), f"Tried to migrate {image_filename} to a new home {new_path}, but its already taken. It's over!" shutil.copyfile(old_path, new_path) - img_obj.filepath = new_path + img_obj.filepath = bpy.path.relpath(new_path) + img_obj.filepath = bpy.path.relpath(img_obj.filepath) assert is_file_in_project(bpy.path.abspath(img_obj.filepath)), f"The image {image_filename} has filepath {img_obj.filepath} which isn't in the project directory {project_directory}, even after copying it! WTF" shutil.copyfile(bpy.path.abspath(img_obj.filepath),bpy.path.abspath(save_to)) diff --git a/art/art.blend b/art/art.blend index 7b8594e..a3cdc58 100644 --- a/art/art.blend +++ b/art/art.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9fb6d6dd9ed99b4e0cb4d5f391af5fb5648e4e2e408b26c110f9e0188d9b7ed6 -size 30828028 +oid sha256:6acda11bb98cfbc405866c1ee628d0abf5a030c61a58d0c65b7b056d28252a6a +size 17334768