Does bpy.ops.import_scene.obj return imported obj?

I’d like to apply a modifier as soon as a mesh is imported.
So, I would like to make the currently imported obj active.

Something like:

newObj = bpy.ops.import_scene.obj(…) = newObj

Is this the correct way?


Operators don’t have return values other than single-item sets to indicate if they were successful.

But import operators should clear the current selection and select the newly imported objects. Therefore, you can do:

obs = bpy.context.selected_editable_objects[:] # editable = not linked from library
for ob in obs: = ob
    # call operator here, that runs the operation on the active object here