I have a very large number of curves (OpenStreetMap data imported as curves) on which I wish to array objects (streetlights). Since there are thousands of curve objects, duplicating my streetlight object and then manually adding an array and curve modifier and point them to the right curve is a slow if not impossible process when there is this many curve objects.
The best solution I can think of is a script, however I am not familiar with the process. I've only gone as far as making the script add an array modifier.
The imported curves are all numbered as Road0, Road1, Road2, Road3, etc
Here is my script so far
import bpy
bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(-0, 0, 0), "orient_type":'GLOBAL', "orient_matrix":((1, 0, 0), (0, 1, 0), (0, 0, 1)), "orient_matrix_type":'GLOBAL', "constraint_axis":(False, False, False), "mirror":True, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False, "use_accurate":False})
bpy.ops.object.modifier_add(type='ARRAY')
bpy.context.object.modifiers["Array"].fit_type = 'FIT_CURVE'
bpy.context.object.modifiers["Array"].relative_offset_displace[0] = 50
bpy.context.object.modifiers["Array"].curve = bpy.data.objects["RoadTertartiary0"]
I basically need a way to make that last 0 increment every time I run the script
Any help is appreciated.