I'm looking for a way to store selected object / curve name so that I can reference it in a script.
The idea is to select a curve (with the mouse), then copy another object to its location(with a script). I would also need to reference the original object so I can fill in some modifiers. Problems I'm having now: In order to duplicate that "other" object, I need to select it... which causes me to lose focus from the currently selected original object.
rough code is...
bpy.context.selected_objects bpy.data.objects['OBJ1'].select = True #select an already created object bpy.ops.object.duplicate() #duplicate OBJ1 # move duplicated object to same place as originally selected. # figure out a way to copy location info from original selection. bpy.data.objects.new.location bpy.ops.object.modifier_add(type='ARRAY') bpy.context.object.modifiers["Array"].fit_type = 'FIT_CURVE' #curvename would be the original thing selected bpy.context.object.modifiers["Array"].curve = bpy.data.objects[curveName]
Thank you very much for your help.