What i need: i want to make a script which will remove all vertex color data in both cases:
several selected objects with several vertex color data
or only one selected object (which also can contain multiple Col.).
Im trying this script:
import bpy
for obj in bpy.context.selected_objects:
for col_attr in obj.data.vertex_colors:
obj.data.vertex_colors.remove(col_attr)
But it cases when some object have something like:
Col
Col.001
Script can throw an error in some cases:
Traceback (most recent call last):
File “\Text.001”, line 5, in
RuntimeError: Error: Vertex color ‘NGon Face-Vertex’ not found