joseph
July 26, 2022, 4:48pm
2
Welcome to BA
While not possible in vanilla Blender, there are some workarounds. For example, this script:
hey motorsep! I just did a script that select all face with black vertex color.
select_black_faces.blend (172 KB)
Test it ,maybe it can help
open the file
select the mesh
enter edit mode
and press alt-p in the text areaā¦
Or this, updated, script:
import bpy
from mathutils import Color
threshold = .1
obj = bpy.context.object
bpy.ops.object.mode_set(mode="OBJECT")
colors = obj.data.vertex_colors.active.data
selected_polygons = list(filter(lambda p: p.select, obj.data.polygons))
if len(selected_polygons):
p = selected_polygons[0]
r = g = b = 0
for i in p.loop_indices:
c = colors[i].color
r += c[0]
g += c[1]
b += c[2]
r /= p.loop_total
g /= p.loop_total
b /= p.loop_total
target ā¦
Thereās also this add-on:
And this add-on:
select_by_color.py
import bpy
from mathutils import Color
bl_info = {
'name': 'Select By Color',
'author': 'Tamas Kemenczy, updated for 2.8 by Piotr ZgodziÅski',
'version': (0, 2),
'blender': (2, 80, 3),
'location': 'View3D > Specials > Select By Color',
'description': 'Select all faces with the same vertex color of the selected face',
This file has been truncated. show original
Of the two add-ons, the second one will probably work better, as the first one seems to be having some kind of error, and the second one is a 2.8+ specific fork.