Nobody knows how to contact a named texture in Blender 2.70 with python?
EDIT and ANSWER: --> (with the loop:::> for Tex in bpy.data.textures)
for f in files: try: fn = f[:-4] #create image and load... img = bpy.data.images.load(filepath = directory + os.sep + f) # ... ex\Plane_D.png img.use_fake_user =True x= 0 #Try to connect to texture already named fn for Tex in bpy.data.textures: if Tex.name == fn and Tex.type == 'IMAGE': Tex.image = img x += 1 else: continue if x == 0: #create a texture tex = bpy.data.textures.new(name =fn, type='IMAGE') tex.use_fake_user =True #link the img to the texture tex.image = img except: print(f,'is not image?') continue
Merçi à tous pour votre grande aide!
texture_paint_layer_manager.py is now modified to load your diff, norm, spec, Ao, Displ, images automatiquely!