polyColorPerVertex returns a value, so you need to compare that to 0.5.for v in vertexList:
if cmds.polyColorPerVertex(v, q=True, r=True) == [0.5]:
cmds.select(v, add=True)
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/cv7E_-VVtdQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9f8fd2fd-ffd9-4112-8a79-42ec1ce9399f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
if cmds.polyColorPerVertex(i, q=True, r=True)==[.456]:
I suspect a precision problem, where e.g. [0.4560001] == [0.4560002] would return False. Try clamping it before comparing.
if map(round, cmds.polyColorPerVertex(i, q=True, r=True), [2]) == map(round, [0.456], [2]):
This’d compare the two values using two decimal places. round is a native Python operator, that takes two values, round(0.123, 2) and returns the first at the second number of decimal places, in this case 0.12. You could also int(value * 100) as an alternative.
Thats what i thought so i used the actual query value before but it still wouldnt work. I'll try your method as well and see the results.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/77a1c17b-26ca-439e-b3af-fdc2cb79d21d%40googlegroups.com.