Skip to main content
6 of 15
deleted 10 characters in body
ideasman42
  • 48k
  • 10
  • 144
  • 226

There doesn't exist a way to do this in the options of the obj importer it seems so what you could do is run a script that loops over the items in your scene, check if it is as mesh and export the current selection to its own file relative to the path your blend file is saved.

import bpy

# get the path where the blend file is located
path = bpy.path.abspath('//')

# deselect all objects
bpy.ops.object.select_all(action='DESELECT')    

# loop through all the objects in the scene
scene = bpy.context.scene
for ob in scene.objects:
    # make the current object active and select it
    scene.objects.active = ob
    ob.select = True
    
    # make sure that we only export meshes
    if ob.type == 'MESH':
        # export the currently selected object to its own file based on its name
        bpy.ops.export_scene.obj(filepath=str(path + ob.name + '.obj'), use_selection=True)
    # deselect the object and move on to another if any more are left
    ob.select = False

To further tweak your export options, see the parameters that bpy.ops.export_scene_obj() accepts. For example, you can include normals with use_normals=True, change forward axis with axis_forward etc.

There are more stringent checks that could be made but for simple use cases and if used properly, this should suffice.

Also see How to batch import Wavefront OBJ files?.

iKlsR
  • 43.7k
  • 12
  • 157
  • 190