I’m converting an imported .svg from curve to mesh. There are hundreds of objects and all can be in a different color. I’ve created a script that does the conversion and cleanup for me but I need to select the objects from the list by hand. This is quite labour-intensive. It would be ideal if the script can select the next object in the list so I only have to change the material name in the script and execute again without having to move the mouse back and forth from object-list to script-window. Ideally it would be great if the script could also prompt me for a material name and use that to make it even easier but just selecting the next object by script would speed up my work already.
The script I have so far (and working):
import bpy for x in bpy.context.selected_objects: bpy.ops.object.convert(target='MESH') bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_all(action='TOGGLE') bpy.ops.mesh.remove_doubles() bpy.ops.mesh.flip_normals() bpy.ops.object.mode_set(mode='OBJECT') mesh = bpy.context.active_object.data mesh.materials = bpy.data.materials['Color26'] mesh.update()
But how to move on to the next automatically?
Thanks in advance for your time and suggestions.