Created
June 29, 2019 13:00
-
-
Save mirekfranc/7b89a3010f4e2b1a13e49c3ed81c0d27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import bpy | |
DIRNAME = os.path.dirname(os.path.realpath(__file__)) | |
FILES = [f for f in os.listdir(DIRNAME) if os.path.isfile(os.path.join(DIRNAME, f)) and f.endswith(('blend'))] | |
NEW_FILES_DIR = os.path.join(DIRNAME, 'ok') | |
os.mkdir(NEW_FILES_DIR) | |
for f in FILES: | |
bpy.ops.wm.open_mainfile(filepath=os.path.join(DIRNAME, f)) | |
bpy.ops.file.make_paths_relative() | |
bpy.ops.wm.save_mainfile(filepath=os.path.join(NEW_FILES_DIR, f)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment