Results 1 to 2 of 2
  1. #1
    Member oscurart's Avatar
    Join Date
    Feb 2011
    Location
    Argentina, Buenos Aires
    Posts
    261

    [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.

    Code:
    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):
        os.mkdir(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!
    Eugenio Pignataro
    Site: http://www.oscurart.com.ar Blog: http://oscurart.blogspot.com Twitter: @Oscurart
    Email: infoARROBAoscurart.com.ar



  2. #2
    Member Spirou4D's Avatar
    Join Date
    Jul 2010
    Location
    Lille, France
    Posts
    1,235
    Thanks Oscurart, very useful script indeed!
    Bye bye
    Spirou4D
    Words are Images that loosed Light!
    Linux Mint 18.1 Serena Bi-Quad Intel 2.66Ghz x64Bytes - Nvidia OpenGL GT 630 4Go-vram



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •