Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

udim tile number

udim tile number

Anonymous
Not applicable
2,034 Views
0 Replies
Message 1 of 1

udim tile number

Anonymous
Not applicable

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 = mc.ls(sl=1, o=1)
minU=1
minV=0
maxU=2
maxV=1
uvArray= []
if sel :
    for i in sel :
        uvNum = mc.polyEvaluate(i, uv=1)
        if uvNum :
            for u in range(uvNum) :
                uvPos = mc.polyEditUV("%s.map[%d]" % (i, u), q=1)
                if uvPos[0] > minU and uvPos[0] < maxU and uvPos[1] > minV and uvPos[1] < maxV:
                    uvArray.append("%s.map[%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 )
    mc.select(x,sel)
    mc.delete(mc.ls(sl=1), ch=True) 
else :
    mc.warning("Nothing Selected....")
0 Likes
2,035 Views
0 Replies
Replies (0)