I have seen a few examples on how to use set the vertex colors of geometry using Python, but the problem is that they all depend on the geometry already existing, being editable, and having a material pointing to a vertex color tag that is already on the object.
What I don't understand is how I would do this if the geometry is being created within a Python generator. If I add a material to the Python generator, I can't point the Vertex Map Shader to a vertex color tag because I can't add a vertex color tag to the Python generator without making it editable (which I don't want to do). I can use c4d.VertexColorTag to add it to the geometry, but it doesn't show up in the object manager, so I can't point the material to it.
Really, all I want is a way to color geometry that is generated within a Python generator based on the vertices specified. Does anybody have a simplified example of how I can do this?
For example, how would I have a Python generator create a cube and set a random color at each of its 8 vertices in such a way that the material with a Vertex Map Shader can display visibly? The key here is that the Python generator is not made editable, and the geometry of the cube itself is created within the Python generator.
So basically this:
entirely from within a Python generator. How can I do that?