2

I'm using Blender python api as one part of a larger pipeline, to convert between Collada versions (1.5 --> 1.4). The simple script is this:

import bpy
import sys

argv = sys.argv

dae_in = argv[4] dae_out = argv[5]

bpy.ops.wm.collada_import(filepath=dae_in) bpy.ops.wm.collada_export(filepath=dae_out)

This little scriptlet is itself wrapped in a bigger subprocess call in a much longer script, farming it out to Blender's python instance to handle just this conversion piece.

It works fine but somewhat amusingly, even a background instance of blender appears to still load the default cube model into memory.

What is the command line option to get a background instance of blender without the cube?

auslander
  • 121
  • 3

1 Answers1

1

Put this at the head of your script.

bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
default
  • 11
  • 2