How to rename texture with script?


I try to rename “[0].texture_slots[0]” when it’s exist.

That’s will reporting “”"
Traceback (most recent call last):
File “<blender_console>”, line 1, in <module>
AttributeError: bpy_struct: attribute “name” from “MaterialTextureSlot” is read-only

texture_slots.add() need no arguments.
texture_slots.create() just need a index int… So

Still can’t give it a name!

Welcome any sugestion.


You could try

tex_name =[0].texture_slots[0].name[tex_name].name = 'Texture'

Don’t really know why it’s read-only.