[Script] - Collect Images

Hi Guys!!!
I made this script for collect all images in the blend file.
The script create a folder in the .blend folder… and copy all pictures into.

Is usefull for backups.

import bpy
import shutil
import os

folder = os.path.dirname(bpy.data.filepath ) + os.path.sep
textfolder = folder+"TEXTURES"+os.path.basename(bpy.data.filepath).rpartition(".")[0]
if not os.path.exists(textfolder):
    for image in bpy.data.images :
        if image.source == "FILE":
            image.filepath.replace("//",folder) , image.name
            fl = shutil.copy(image.filepath.replace("//",folder),textfolder)
            image.filepath = fl

Enjoy it!

Thanks Oscurart, very useful script indeed!
Bye bye