I found those script i Think it was for Blender 2.49 to change all imagePath at once,
but I cant get it to work in Blender 2.8...
Can some one help , it would be very handie for flies with lots of images?
import bpy #Original import Blender
from bpy import context, data, ops
#from ORIGINAL from Blender import Texture, Image, Material
#insert the path which should be replaced
oldpath = "C:\OLDpath\"
#insert the new path which replaces the old one
newpath = "D:\NewPth\"
image_count = 0
for tex in bpy.data.textures.get():
image = tex.getImage()
#print image.name
filename = ""
if (tex.getType() == "Image"):
if (len(image.getFilename()) > 0):
i=0
while i < len(image.getFilename()) :
if image.getFilename()[i:i+1] == "\\" :
filename += "/"
else :
filename += image.getFilename()[i:i+1]
i+=1
if (oldpath == filename[0:len(oldpath)]):
temp = filename[len(oldpath):len(filename)]
temp = newpath + temp
image.filename = temp
image.reload()
image_count += 1
print ("image path's changed:")
print (image_count)
I did a few changes, but cant find the rest od my errors. I thing some stuff is now depricated but I cant find the 2.8 Version
here is the Path to the ORIGINAL Script https://blenderartists.org/t/script-to-change-paths-for-all-images/460733
for image in bpy.data.images:to change all image filepaths rather than only those assoc with an image texture. Q suggests this a bit, old script goes over textures? Wonder if it's worth mentioning relative paths, in that, for example: as long as a folder namedimagesis in same folder as blend file then//images/foo.pngwill be path to image relative to blend file. Was on BA answering Qs back then. 2009 would have been a 2.49 hanger on... the change from 2.7 to 2.8 was nothing like the upheaval of 49b to 50 – batFINGER Jun 17 '20 at 11:01filepath.startswith(oldpath)and report updated 3 of 10 (eg). – batFINGER Jun 17 '20 at 11:25