Post #3198:
ac
š Metadata
- Author: roaoao
- Date: 2020-04-20 21:54:36
- Type:
answer - Quality Score: 9/10
- Reply to: post_03193
- Replies (1): post_03200
š·ļø Tags
āļø Related PME Features
- Macro Editor
- Python Scripting
- Command tab
š¬ Content
actimelvanille:
iād like to incrementally save the current file by increasing the number at the end of the file name by 1.
so save01.blend will be saved as an additional save02.blend in the same folder
Try this script (Command tab):
import re; fp = C.blend_data.filepath; fp = re.sub(r"(.*[^\d])(\d*)(\.blend)$", lambda mo: "%s%02d%s" % (mo.group(1), int(mo.group(2)) + 1 if mo.group(2) else 1, mo.group(3)), fp) if fp else ""; bpy.ops.wm.save_mainfile('EXEC_DEFAULT', filepath=fp) if fp else bpy.ops.wm.save_mainfile('INVOKE_DEFAULT')
ā¤ļø 5 likes