Posts Tagged ‘Blender’

Convert 3ds files to obj with Blender

Tuesday, January 24th, 2012


3DS is an aging binary interchange format for 3D models. OBJ is another aging, but ASCII-based format for 3D models.

Here is a simple Python script that converts one or more files from 3DS format to OBJ format using Blender:

# Convert 3ds to obj using Blender
# Run as follows:
#   blender -b dummy.blend -P -- file.3ds ...
# dummy.blend is just an empty Blender file needed as an argument.
# Put one or more .3ds files on the end of the command.
# The .obj files will be created with the same name (and path) as
# the .3ds file, but with the .obj extension.
# The export creates a .mtl file for each .obj file also.

import bpy
import sys
import os.path

for i in range(1, len(sys.argv)):
    if sys.argv[i] == "--":

for file in sys.argv[i+1:]:
    # Start with an empty scene

    # Read a .3ds file

    # Write a .obj file
    outfile = os.path.splitext(file)[0]+".obj"


Save the script code in a file named  You will also need a Blender file to use as a placeholder in the command line.  You can save an empty file from Blender, or use an existing one.  Assume it is called dummy.blend.

To convert 3DS files, use the following command:

blender -b dummy.blend -P -- file1.3ds file2.3ds file3.3ds

Tack on as many 3DS files to the end of the command as you want.

Note:  This assumes that dummy.blend and are in the same folder as your 3DS files.  If not, you will need to specify the proper path to each.