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.

On Sun, 23 Dec 2018 at 10:53, James Kim <jamesjk1...@gmail.com> wrote:

> 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_maya+unsubscr...@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
> <https://groups.google.com/d/msgid/python_inside_maya/77a1c17b-26ca-439e-b3af-fdc2cb79d21d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAFRtmOADvZBd_NuJ7CXfs%3DMtdJ8cW1%3DDu_v6_Mv7MsnNU10ZbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to