title: Blender, convert .stl to .obj with prompt commande
body: <p>I want to convert an .stl file to .obj, without using blender interface.</p>
  
  <p>To do that, i want to do it in two step :</p>
  
  <p>1 STL to BLEND</p>
  
  <p>2 BLEND to OBJ</p>
  
  <p>Actually BLEND to OBJ work ok with this python code :</p>
  
  <pre><code>import bpy
  import sys
  
  
  argv = sys.argv
  argv = argv[argv.index("--") + 1:] # get all args after "--"
  
  obj_out = argv[0]
  
  bpy.ops.export_scene.obj(filepath=obj_out, axis_forward='-Z', axis_up='Y')
  </code></pre>
  
  <p>and with this batch :</p>
  
  <pre><code>@echo off
  
  rem Put the path of the blender folder
  set PATH=C:\Program Files\Blender Foundation\Blender
  
  set FILENAME=guitar.blend
  set TARGET=guitar.obj
  rem Launch
  blender %FILENAME% --background --python convert_blend_to_obj.py -- %TARGET%
  
  
  pause
  </code></pre>
  
  <p>This work perfectly.</p>
  
  <p>The problem is with the STL to BLEND, its not working with this python code :</p>
  
  <pre><code>import bpy
  import sys
  
  argv = sys.argv
  argv = argv[argv.index("--") + 1:] # get all args after "--"
  
  blend_out = argv[0]
  
  bpy.ops.import_mesh.stl(filepath=blend_out, axis_forward='-Z', axis_up='Y')
  </code></pre>
  
  <p>And the batch associated :</p>
  
  <pre><code>@echo off
  
  rem Put the path of the blender folder
  set PATH=C:\Program Files\Blender Foundation\Blender
  
  set FILENAME=turbine.stl
  
  set TARGET=turbine.blend
  
  rem Launch
  blender %FILENAME% --background --python convert_stl_to_blend.py -- %TARGET%
  
  
  pause
  </code></pre>
  
  <p>i got as an error : File format is not supported in file C:..\turbine.stl
  Blender quit</p>
  
  <p>I think the problem is in my python code, but i don't know what to change.</p>
  
  <p>I found help for the first script here : <a href="https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Wavefront_OBJ" rel="nofollow">https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Wavefront_OBJ</a></p>
  
  <p>I thank you in advance for the help, maybe there is a better way to that. I don't want to have to launch blender and do it manually. I only need a prompt commande.</p>