How can I set my favorite color to all of the selected objects?
I can't attach my objects not at all.
The number of objects is high and I can not adjust their color vertex one by one.
Sorry for my bad english.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
this answer is for vertex color of single object
I converted it to multiple objects:
import bpy import random import time # start in object mode objects = bpy.context.scene.objects for obj in objects: mesh = obj.data if not mesh.vertex_colors: mesh.vertex_colors.new() color_layer = mesh.vertex_colors["Col"] # or you could avoid using the color_layer name # color_layer = mesh.vertex_colors.active i = 0 for poly in mesh.polygons: for idx in poly.loop_indices: color_layer.data[i].color = (0, 1, 0, 1) i += 1 # set to vertex paint mode to see the result bpy.ops.object.mode_set(mode='VERTEX_PAINT')