1

I have a simple script

import bpy

bpy.ops.import_scene.autodesk_3ds(filepath="C:\\Temp\\Blender\\3DS\\5004.3ds")

bpy.ops.object.select_all(action='INVERT')

bpy.ops.wm.addon_expand(module="threejs")

bpy.ops.export.three(filepath="C:\\Temp\\Blender\\JSON\\Output.js")

which I execute using

blender --background --python c:\temp\blender\Test.py

The script runs, the 3DS model is loaded, an output file is produced, but it only contains "CubeGeometry" and not the 3DS model I have loaded. I am presuming this is the cube that Blender loads by default. I tried after loading to invert the selection expecting that I would then get my imported model, but with no success.

Any ideas?

  • After saving, the file must be loaded.https://blender.stackexchange.com/questions/1365/how-can-i-run-blender-from-command-line-or-a-python-script-without-opening-a-gui/1366#1366 – mml Nov 15 '22 at 18:05

0 Answers0