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) On Thursday, October 3, 2019 at 10:04:59 PM UTC+7, tushar sankhala wrote: > > 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. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6b5be48c-5a9f-40ac-a179-6b04938b69a5%40googlegroups.com.