from bpy import context def color_from_active(): active = context.active_object selection = context.selected_objects objs = [o for o in selection if not o is active and o.type == 'MESH'] if not objs or not 'OBJECT' in context.mode: print("No selection") return # set to True to use color from active (assumes any vertex is colored) color_from_active = True # or use a solid color (r,g,b,a) color = [0,0,1,1] if color_from_active: if active.data.vertex_colors: v_col = active.data.vertex_colors[0] color = list(v_col.data[0].color) else: objs.append(active) if objs: for o in objs: if not o.data.vertex_colors: v_col = o.data.vertex_colors.new() else: v_col = o.data.vertex_colors[0] for data in v_col.data: data.color = color if __name__ == "__main__": color_from_active()