-1
$\begingroup$

I was wondering how is it possible to have a blender program run exclusively from a python program? I am wanting to create an application that calls a python code to run blender. But is it even possible? If you know any tutorials on this, let me know.

$\endgroup$
2
  • $\begingroup$ Is this different from your other question? blender.stackexchange.com/questions/58124/… $\endgroup$ Commented Jul 19, 2016 at 16:32
  • $\begingroup$ well in my other question Im asking if i can use just eh addons, this one im asking if you can call a python script to run the blender, without having to use the interface $\endgroup$ Commented Jul 19, 2016 at 16:34

1 Answer 1

1
$\begingroup$

You could run blender from python like this:

import subprocess
subprocess.Popen(["blender", "myScene.blend"])

Or, if you want, could run your python script from blender like this:

blender myscene.blend --background --python myscript.py
$\endgroup$
8
  • $\begingroup$ Okay, so where would i run the code $\endgroup$ Commented Jul 19, 2016 at 16:56
  • $\begingroup$ if you are running your python script from blender, you would enter the code into the command line. If you are running blender from python, just put the code in your python script. If you have any problems or questions, just comment again. $\endgroup$
    – krypticbit
    Commented Jul 19, 2016 at 17:15
  • $\begingroup$ so do you by chance know how to run a blender python script by command prompt $\endgroup$ Commented Jul 19, 2016 at 17:20
  • $\begingroup$ To run a python script from the command line, type python absolutePathToScript.py $\endgroup$
    – krypticbit
    Commented Jul 19, 2016 at 17:49
  • $\begingroup$ how could i use addons through scripting mode $\endgroup$ Commented Jul 19, 2016 at 18:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .