Maya udim python questions


udim python question.

I am trying to write a python script that would:

  1. get the occupied udim tile number (like 1001,1002) etc.
  2. select the faces that in each tile and extract them to separate objects.
  3. assign the udim tile number (like 1001,1002) to extracted objects.

This is what I have got to so far:

sel =, o=1)
uvArray= []
if sel :
    for i in sel :
        uvNum = mc.polyEvaluate(i, uv=1)
        if uvNum :
            for u in range(uvNum) :
                uvPos = mc.polyEditUV("[%d]" % (i, u), q=1)
                if uvPos[0] > minU and uvPos[0] < maxU and uvPos[1] > minV and uvPos[1] < maxV :
                    uvArray.append("[%d]" % (i, u)) 
if uvArray:
    print uvArray
    face = cmds.polyListComponentConversion( uvArray, tf=True )
    y=cmds.polyChipOff( face, dup=True, kft=True )
    x=mc.polySeparate(sel, rs=True)
    print y
    print x
    print sel
    mc.ungroup( sel ),sel)
    mc.delete(, ch=True) 
else :
    mc.warning("Nothing Selected....")