Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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')
for f in FILES:
bpy.ops.wm.open_mainfile(filepath=os.path.join(DIRNAME, f))
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
You can’t perform that action at this time.