Created
September 28, 2012 15:42
-
-
Save AngryLoki/3800594 to your computer and use it in GitHub Desktop.
Obj to dae Blender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple script to batch convert collada to obj. | |
# run as: | |
# blender --background --python dae2obj.py -- input_dir output_dir | |
import os | |
import sys | |
import glob | |
import bpy | |
if len(sys.argv) != 7: | |
print("Must provide input and output path") | |
else: | |
for infile in glob.glob(os.path.join(sys.argv[5], '*.dae')): | |
bpy.ops.object.select_all(action='SELECT') | |
bpy.ops.object.delete() | |
bpy.ops.wm.collada_import(filepath=infile) | |
outfilename = os.path.splitext(os.path.split(infile)[1])[0] + ".obj" | |
bpy.ops.export_scene.obj(filepath=os.path.join(sys.argv[6], outfilename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment