I have an old script that assigns vertex colors to a mesh, based on the vert's position (can be used to create worldspace gradients - useful for world position offset vertex animation in real-time applications). Anyway, I'm working on re-writing this tool using the python API to hopefully make it quicker on dense meshes. This is my first time really trying to use the api, so I'm kind of stumbling my way through it. I've found a way to get the point positions and a list of vertex IDs on a given mesh. However, those two lists don't correspond to each other so when I run the below code, it doesn't assign the right vert colors to the correct mesh. Is there some way I can make the two lists, or two sets of information match together to fix this issue? (Note: Currently I'm just trying to create a Y gradient which is why I am just getting 2nd value for each point).
https://pastebin.com/s3fGRPNG -- 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/8fb826dd-2094-4ecc-824e-dee96f3973d5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.