Question: Is it possible to automate vertex painting?

Hey all you artists and coders out there! I’ve got a really interesting problem for someone to solve and let me know if it’s actually possible to do with Blender.

So I work on projects that involve me using vertex paint to color different sections on models of cars that I’m given. These colors are read by a computer that uses the colors to segment and organize the model against 2D photographs in its inventory.

What I’m wondering is, is it possible to automate this process using some sort of code, where the individual pieces of the model could be colored (if they all had the same naming conventions)? Or is that sort of thing only resigned to human interaction, because the program might not be able to tell the difference between one part or another?

I would love to discuss more about this. Let me know if I need to be more descriptive, but there is only so much description I can go into, as my company doesn’t want me to reveal too much information. :slight_smile: They gave me permission to reach out to the Blender community, though. I don’t know anything about coding, and I don’t know if this would even be a coding problem.

It only depends in the parameters you choose for automation… :confused:
You can even code a mesh analyser to create vertex_color_layers based on the shape of the mesh.
So the problem is not if it’s possible to create, delete or modify a vertex_color_layer, which it is. You need to carefully define what parameters should be used for giving some parts one color, and other parts another.

So what this means is that say I name the hood “front_hood” and it needs to be blue, and then I name the windshield “front_windshield” and it needs to be colored pink, and then I tell the computer that every front windshield should be pink, and every hood should be blue?

Another problem is that not all the car models are made the same by the vendor who provides them. Sometimes the fenders and panels are separated, which is good, and then other times, they are one piece, which makes it harder on me to manually color segment them. So if a model were like that, not separated, would I still be able to tell the code to select fenders and panels even though they are connected, or would I have to tell the modeling vendor that they NEED to separate every piece?

A proof that is possible is the ocean modifier.
Painting of a vertex color layer is automated to generate foam.

https://docs.blender.org/manual/en/dev/modeling/modifiers/simulate/ocean.html#simulation-data-generation-options

Well if it’s just a matter of painting red that thing that has “_hood" or "_door” in its name then it’s possible.

Moved from “General Forums > Blender and CG Discussions” to “Coding > Python Support”

Thanks for the info, guys. :slight_smile: I will let my coworkers know that this is possible, and they will probably be able to find someone who can set up the code. I appreciate it!