texture slots

i can print the textures slots like this for a material

for tslot in mat.texture_slots:

if tslot!=“None”:
print (‘TXT index=’,ll,‘tslot=’,tslot)

print (‘dir text slot =’,dir(tslot))

but how can i get the name type and len of text slots for a specific material?

need to know type texture like cloud or image
or if UV image or not

and how do you delete one specific slots for a material

thanks

slots = [(t.texture.type, t.texture_coords == "UV") for t in mat.texture_slots if t]
len(slots)
mat.texture_slots.clear(0)   #clears texture at 0 index

found way to list text slot from mat
but cannot get name or type or other specs!

is it possible to get the name or type from the text slot
then go back to master list of texture to get other data but still need the name to do that!

thanks

slots = [(t, t.texture.name, t.texture.type, t.texture_coords == "UV") for t in mat.texture_slots if t]

…would give you a list of the texture slots, texture name, texture type, and a bool if UV is used. Not sure I understand what you’re trying to do.

if i use this

for mslot in object.material_slots:

print ()
mat =mslot.material
print(‘index =’,jj,’ material name =’,mslot.name,’ len text slots =’,len(mat.texture_slots) )
ll=0
for tslot in mat.texture_slots:

if tslot is not None:
print (‘TXT index=’,ll,‘tslot=’,tslot)
else:

print (‘rien’)

pass

^^^^

i can see each real slots

index = 3 material name = yelo1 len text slots = 18
XT index= 0 tslot= <bpy_struct, MaterialTextureSlot(“Texture.003”)>
XT index= 1 tslot= <bpy_struct, MaterialTextureSlot(“Texture.004”)>

but is there a way to get the name adn other parameters from this?
tried to do a dir but don’t see the parameters !

looks like 18 text slot are all defined in advance but contains none value!

thanks

trying to understand this
slots = [(t.texture.type, t.texture_coords == “UV”) for t in mat.texture_slots if t]

if t means if it exist not equal to none i guess

but not certain how the first part do [(t.texture.type, t.texture_coords == “UV”)

is it possible to represent that with a more classical way may be
might be easeir to understand it

thanks

mat.texture_slots[0].texture.type gets the texture type. mat.texture_slots[0].texture.texture_coords gets the texture coordinates. You said you wanted to check if it was UV or not, t.texture_coords == “UV” gives a bool of that.

if i use std for loop i can get the other parameters for each texture slot

for mslot in object.material_slots:

mat =mslot.material

for t in mat.texture_slots :

if t is not None:
print (’ type=’,t.texture.type,’ mapping =’,t.texture_coords)
print (’ Diff =’,t.diffuse_factor,’ NOR =’,t.normal_factor)

i’ll try to modify my loop to get samething

thanks

???,http://www.agentshield.com/HowItWorks.php???,mcm ?? ?????,timberland ??? ???2010???3???3???1???,??? Skytop???2000???,??????1000???300???,mcm ??? ???: ??? ??? []???](http://202.109.115.218:8080/read.php?tid=61210&page=e#a) ??? ???