diff --git a/art/Exporter.py b/art/Exporter.py index 0a15c0b..14d1cf4 100644 --- a/art/Exporter.py +++ b/art/Exporter.py @@ -80,6 +80,15 @@ with open(bpy.path.abspath(f"//{EXPORT_DIRECTORY}/shorttest.bin"), "wb") as f: for i in range(4): write_u16(f, i) +project_directory = bpy.path.abspath("//") +def is_file_in_project(file_path): + file_name = os.path.basename(file_path) + for root, dirs, files in os.walk(project_directory): + print(f"Looking for {file_name} Dirs: {dirs} files: {files}") + if file_name in files: + return True + return False + saved_images = set() def ensure_tex_saved_and_get_name(o) -> str: """returns the path to the mesh's texture's png in the exported directory""" @@ -102,6 +111,7 @@ def ensure_tex_saved_and_get_name(o) -> str: img_obj.save(filepath=bpy.path.abspath(save_to)) else: assert img_obj.filepath != "", f"{img_obj.filepath} in mesh {mesh_name} Isn't there but should be, as it has no packed image" + 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}" shutil.copyfile(bpy.path.abspath(img_obj.filepath),bpy.path.abspath(save_to)) return image_filename diff --git a/art/art.blend b/art/art.blend index da254e2..5060b47 100644 --- a/art/art.blend +++ b/art/art.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b0a8bdb5a724cc88180961ea2237e087909dd98f2941852fa2d84ad29c4c1f4 -size 10989320 +oid sha256:dcb07c137568de1752ac7de5b44475fba142bd3fd7ffbfe31446fd05e651bab4 +size 10993436 diff --git a/art/farmertexture.png b/art/farmertexture.png new file mode 100644 index 0000000..6f27c8d --- /dev/null +++ b/art/farmertexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc7d1b6d0549d62c8ba74d1d7fa19f00afdc8dfb2c4d4f95d3dc0946e7c8a4ba +size 1523927 diff --git a/art/playertexture.png b/art/playertexture.png new file mode 100644 index 0000000..fdc1bc5 --- /dev/null +++ b/art/playertexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04e897e9e4be6c15d66d33d506a045014eea8b0f9c2a79d1e243311caee2945d +size 1998106