I believe that polyColorPerVertex will work if and only if the object has at least one colorSet. You can use polyColorSet(query=True, allColorSets=True) to find out if the object has a colorSet.
On Wednesday, 27 February 2019 14:51:47 UTC+11, James Kim wrote: > > I'm currently trying to make and object get default vertex colors if the > object does not currently have vertex colors. however i have come across an > issue where if the object has no colors on it already polyColorPerVertex > cannot query anything and just errors out. > I'm trying to write an if statement saying if none of the vertexes have > colors then add a color. However I am unable to figure out how to get that > info. I've tried using a getAttr but i dont know how to access the vertexes > attrs as every attr i tried using cmds.attributeInfo gives me the error "no > object matches name". > Any help would be appreciated. Thank you > > > -- 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/4c9ab1ce-09ee-4cd6-a288-797a2177a0b8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.