TypeError: 'BPyOpsSubModOp' object is not iterable?

Help? I am trying to program that selecting multiple objects it will remove the vertex colors from all of those objects. I am a noob at Python.

import bpy
for ob in bpy.context.selected_editable_objects:
    for vcolor in bpy.ops.mesh.vertex_color:
        bpy.ops.mesh.vertex_color_remove(vcolor)

bump10chars

bump10chars2

Nevermind, after 1000s of years searching, I finally got it fixed.

import bpy
for ob in bpy.context.selected_editable_objects:
    for vgroup in ob.data.vertex_colors:  	
        ob.data.vertex_colors.remove(vgroup)
1 Like

Hi. The next time you try to ask the question in a more appropriate section of the forum to get more visibility. In this case here:
https://blenderartists.org/c/coding/python-support/19