Invoke blender with the --help
option to get all available options.
In your case you might simply use the --python
option to load a script.
Note: The order of the arguments are given in is important.
.\blender.exe Subprocess.blend --python your_script.py
or
subprocess.Popen([blenderPath, , "Subprocess.blend", "--python", "your_script.py"])
This way the blended is loaded first and then the python script is executed.
Blender 2.78 (sub 0)
Usage: blender [args ...] [file] [args ...]
-P or --python
Run the given Python script file
--python-text
Run the given Python script text block
--python-expr
Run the given expression as a Python script
Argument Parsing:
Arguments must be separated by white space, eg:
# blender -ba test.blend
...will ignore the 'a'
# blender -b test.blend -f8
...will ignore '8' because there is no space between the '-f' and the frame value
Argument Order:
Arguments are executed in the order they are given. eg:
# blender --background test.blend --render-frame 1 --render-output '/tmp'
...will not render to '/tmp' because '--render-frame 1' renders before the output path is set
# blender --background --render-output /tmp test.blend --render-frame 1
...will not render to '/tmp' because loading the blend-file overwrites the render output that was set
# blender --background test.blend --render-output /tmp --render-frame 1
...works as expected.
By the way, I think you don't need the -r
option.
-r
Silently register blend-file extension, then exit (Windows only)