Since there is no way to go from a uv_texture to a uv_layer (e.g. by .index or theoretically .layer_name), it's impossible to reference the uv layers in script after a uv texture rename.
import bpy
bpy.ops.mesh.primitive_cube_add()
me = bpy.context.object.data
uvtex = me.uv_textures.new(name="initial_name")
print()
print(me.uv_textures[0].name)
print(me.uv_layers[0].name)
uvtex.name = "new_name"
print()
print(me.uv_textures[0].name)
print(me.uv_layers[0].name)
# can't reference uv_layers[uvtex.name] here!
Description
Description
Event Timeline
Comment Actions
Not sure names are intended to be syncronized actually -- there were plans to separate this two guys.
Campbell, can you please check on this?
Comment Actions
As long as they are magically linked, they should also share names. Not sure what it would be good for to have them separated (other than better understandability for new scripters), but sure, if they get separated, no need to update the other name as well.
Comment Actions
Currently only the indices's are shared (it is confusing that names are shared on creation but not renaming).
Eventually we'll decouple these layers and expose to users.
Closing.