Selecting poly mesh faces from UV data

127 views
Skip to first unread message

tushar sankhala

unread,
Oct 3, 2019, 11:04:59 AM10/3/19
to Python Programming for Autodesk Maya
Hi,

I know this group is for Python programming for maya but i am not able to see any example of the issue which i am facing in python, so that i can replicate the same in Maya C++ API,

What i am trying to do:

We are using the Maya Unity Live link plugin and we are extending it to support UDIMs,

1. I have figured out the code for knowing the UDIMs that mesh UV belong to by using 
    Formula: (floor(u) + 1 * 1000) + floor(v) * 1000) and it works fine.

2. After this i am stuck in how to select the UVs and from that mesh faces so that i can apply different materials to the faces which belong to different udims to export the mesh to Unity.


Thanks in advance.

Panupat Chongstitwattana

unread,
Feb 7, 2020, 4:03:09 AM2/7/20
to Python Programming for Autodesk Maya
the color_palette only exist inside display function. It does not exist inside applyColor function which is why this error popped up when clicking Apply

# Error: NameError: file <maya console> line 37: global name 'color_palette' is not defined #

Quick fix is to give your palette a name and use that same name in applyColor.

in display():
    color_palette = cmds. palettePort ('myPalette', dimensions = ......)


in applyColor():
    color_index = cmds.palettePort('myPalette', q=True, setCurCell=True)


-i /0

unread,
May 20, 2020, 4:37:23 AM5/20/20
to Python Programming for Autodesk Maya
this is Paul Leon Diaz FYI 
Reply all
Reply to author
Forward
0 new messages