In python I want to select one object and change repeatUV .
The code work for all objects and not for one specific object
import maya.cmds as cmds
import pymel.core as pmc
def UVTILECHANGE():
selected = cmds.ls(sl=True)
textField_obj_name = cmds.textField( 'textField_action_name',query=True,text=True )
textField_obj = cmds.textField( 'textField_action',query=True,text=True )
#print textField_obj
textField_obj2 = cmds.textField( 'textField_action2',query=True,text=True )
if textField_obj_name==selected[0]:
array = cmds.ls(type="place2dTexture")
#SELECT ALL PLACE2DTECTURE
#I WANT JUST FOR selected[0]
#print len(array)
i=0
while (i <= len(array)):
print
cmds.setAttr(str(array[i])+ ".repeatU", float(textField_obj))
cmds.setAttr(str(array[i])+ ".repeatV", float(textField_obj2))
i=i+1
def MakeWindow():
if (pmc.window('flattenVertwindow', exists=True)):
pmc.deleteUI('flattenVertwindow')
pmc.window('flattenVertwindow', title="TEST",widthHeight=(200,100))
pmc.columnLayout(adjustableColumn=True)
#pmc.text(label='select axis')
cmds.text("Choisir nom de l'objet")
cmds.separator(h=10)
textField00 = cmds.textField( 'textField_action_name' )
cmds.separator(h=10)
cmds.text("Taille des Tiles")
cmds.separator(h=10)
textField01 = cmds.textField( 'textField_action' )
textField02 = cmds.textField( 'textField_action2' )
red= pmc.button(label='Change UV TILE ', command= 'UVTILECHANGE()')
pmc.showWindow('flattenVertwindow')
MakeWindow()