getting the vertex attrs

33 views
Skip to first unread message

James Kim

unread,
Feb 26, 2019, 10:51:47 PM2/26/19
to Python Programming for Autodesk Maya
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


Michael Boon

unread,
Feb 27, 2019, 7:02:13 PM2/27/19
to Python Programming for Autodesk Maya
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.

James Kim

unread,
Feb 27, 2019, 8:01:03 PM2/27/19
to Python Programming for Autodesk Maya
Thank you so much! 



Reply all
Reply to author
Forward
0 new messages