Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

March 25, 2013

Vertex Color Map

setting vertex colors

first, run this code only on primitive objects until you understand what it does. this is for setting vertex colors of a vertex color map

getting vertex colors

getting vertex colors is similar but in reverse, remember that 1 vertex can be shared by several polygons and each polygon can set a different color for that vertex/index. Notice how the plane divided into 4 below has one central vertex which is shared by 4 surrounding polygons, each polygon has a different color for that vertex.

Material from vertex color map

this requires setting viewport shading from solid to texture.

8 comments:

  1. I've copied the snippet to the text editor in 2.66a and run it. I did not see the color cube. I guess it is because of the comment section. sorry , I am a newbie here. Could you help me ?

    ReplyDelete
    Replies
    1. In that snippet I assume you know what a vertex color map is and how to view it. Switch from object mode to "vertex paint mode" after running the script. I have now added an automatic switch to the end of that snippet, try running it again.

      Perhaps you want to make a material from a color map? I've added that option at the end of the post.

      Delete
  2. I didn't see this one until today.

    Thanks again Dealga, I think this should be useful for what I am trying to do --> transferring Vertex Color into colored objects (at vertex positions).

    ReplyDelete
  3. it will be.
    but exactly how you propose to colorise? by random or by position in 3D?

    ReplyDelete
  4. could be done depending on coordinate component, face normal, average face normal of surrounding polygons. vertex density.. crazy options.

    ReplyDelete
  5. Thanks a lot for this! I used it to adjust (brighten, colorize) all of my colors in my vertex map.

    ReplyDelete
  6. How do I use this material in cycles?

    ReplyDelete

Please use Blender.StackExchange.com for python scripting questions unrelated to this post.