I'm trying to write a script that when I save the file (Ctrl + S) save the images on file too.
bl_info = {
"name": "Auto-save images",
"author": "mcunha98",
"version": (1, 0),
"blender": (2, 78, 0),
"location": "",
"description": "Auto save images datablocks after save .blend",
"warning": "Works only with external images",
"wiki_url": "",
"category": "Paint"}
import bpy
def save_external_images(dummy):
for img in bpy.data.images:
img.save()
def register():
bpy.app.handlers.save_pre.append(save_external_images)
def unregister():
bpy.app.handlers.save_pre.remove(save_external_images)
if __name__ == "__main__":
register()
I saw [this thread][1] as reference , but in fact the image not save when I save the file, someone can help me to understand why ?
I don't have any kind of warning or output on console window warning about erros, simply the image file not was save