Skip to main content
1 of 2
Fweeb
  • 7.3k
  • 2
  • 33
  • 37

I, too, have had issues in the past using the mesh select_all operator from within Edit mode. As an alternative, try looping through all of the vertices and setting their select property to True. Then, switch into Edit mode before doing the Remove Doubles operator. Your code should look something like this:

for obj in bpy.data.objects:

    if obj.name[0:4] == "Text" and obj.type == "MESH":

        bpy.context.scene.objects.active = obj
        for vert in obj.vertices:
            vert.select = True
        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.mesh.remove_doubles(0.0001)
        bpy.ops.object.mode_set(mode = 'OBJECT')
Fweeb
  • 7.3k
  • 2
  • 33
  • 37