MeshTextureFaceLayer

Allohh

is there someone who could help and tell me how i can change the name of the MeshTextureFaceLayer by python when you have the selected object… :frowning:

if have something like this that doenst work:

 uvName = bpy.ops.mesh.uv_texture_add()
    #uvName.uv.textures.new(name ='test')
    bpy.ops.MeshTextureFaceLayer.value = 'test'
    #uvName = name

thanks in advanced im going to drink tea

wessx

First of all, the function
bpy.ops.mesh.uv_texture_add()

does not return the name of the uv texture. It returns {‘FINISHED’} if everything is all right and {‘CANCELED’} if there is a problem.
To change the name, just write
bpy.data.meshes[‘Cube’].uv_textures[‘UVTex’].name = “The_name_u_want”

thanks for the reply Jacques!!!

it doenst work “UVTex is not found…”

i use the add() method to add the uvtex layer… i had the problem solved an working but becaus blenders REDO button dint work in the python text editor i could not find the solution again (FRUSTRATION!!!))))

am i doing something wrong ? that it could not work?

wessx

it works i was not using the right object…

but i want it on the selected object (active object!) ?

wessx

bpy.context.active_object.data

it works now fine…
mercie bien…

althought i get confused by blenders output when you hover over these Uvlayer buttons showing this MeshTextureFaceLayer.
And the API documentation didnt really help eighter makin it clear…

maybe its just me…

thanks again

wessx

I guess “MeshTextureFaceLayer” is used to set an UVmap as active or as active_render, but I can’t figure out how. If someone knows it, I would be very happy.