# of the License, or (at your option) any later version. if bpy.context.selected_objects[1].type == 'MESH' and bpy.context.selected_objects[0].type == 'CURVE ...