Hi guys !
I’m writing a small script as an exercise, which is meant by now only to import svg (circles), and to convert them into meshes.
And I’ve got context issues.
I’ve wandered a little bit over the internet, and it seems that context is a typical beginner issue. So glad am I, as a beginner ! Yet I couldn’t figure out this thing…yet.
Here are my very few lines of code :
import bpy bpy.ops.object.select_all(action='SELECT') bpy.ops.object.delete(use_global=True) bpy.ops.import_curve.svg(filepath="C:\\Users\\g.svg") bpy.ops.import_curve.svg(filepath="C:\\Users\\pg.svg") for i,j in enumerate(bpy.context.selected_objects): j.location.z+=(i)*0.5/len(bpy.context.selected_objects) bpy.ops.object.convert(target='MESH',keep_original=False) bpy.ops.object.select_all(action='SELECT') bpy.ops.object.join()
My code break is around the bpy.ops.object.convert(target=‘MESH’, keep_original=False).
Console keeps telling me that the related poll function failed, due to an incorrect context. Though I don’t know how to modify this context.
Note as well that if I remove this line, the bpy.ops.object.join() triggers the same error.
Do you have any guidelines or suggestions ?