User Tools

Site Tools


images_proxies_blender_script

Script made by Damien For scenes with huge textures, the first part will make a smaller version of the image and save it as proxy (updating textures paths); the second part of the script will re-assign the original paths to the textures to load the big images. <code python>import bpy #PROXY for obj in bpy.context.selected_objects: img = obj.active_material.active_texture.image img.reload() img_copy = img.copy() img_copy.name = img.name + "_orig" img.scale(img.size[0]*0.2, img.size[1]*0.2) path = bpy.path.abspath('//'+img.name.split(".")[0]+"_proxy.png") img.save_render(path) img.filepath = img.filepath.split(".")[0] + "_proxy.png" img.reload() ##DEPROXY for obj in bpy.context.selected_objects: tex = obj.active_material.active_texture img = tex.image.name print(img) orig_img = bpy.data.images[img+"_orig"] tex.image = orig_img </code>

images_proxies_blender_script.txt · Last modified: 2015/08/19 14:06 by damien