Access blender from linux console/shell

Hi

I recently read a job description, in which a guy wants to use/target blender’ s python api outside blender.

E.g is it possible to have a reference to a running blender instance in linux…like
$blender = new Blender();//start/run blender
$blender.someApiFunction();
$blender.render();

and when its done, have/save the rendered result on hard drive.

Basically, it looks like they want to control a running blender using some other scripting languages.
Could that be possible?

I think my replies are a bit transparent :smiley: maybe its a bug in my render engine :smiley:

anyway as I posted in that thread yes its possible by having blender python and another python communicate with each other and I recommended execnet which is what it does making it possible 2 python intepreters to communicate , it wont have to be even cpython , it could be cpython , pypy and jython. And they dont even have to be in the same computer you could have your python in your computer control the blender python in a computer in another country. So you can do some pretty mind blowing stuff.

http://codespeak.net/execnet/

Thanks for the reply

That seems exactly whats needed for it.
Ill give it a try and see what it can do.

You can compile blender as a python module and use it just like any other python module.

Probably a bit buggy/not fully supported though, can’t really say for sure since I haven’t tried it myself but do have a pretty good track record of running into bpy bugs.

----edit----

Hmm… job description? I totally need a new job…

That job requires php and web programming too.
The way i see it, they want to create a web interface, where users can upload their models as “templates” and other users would be able to upload images for those template model’ s faces, then use blender to render a an image or a movie, and then display it to the user on screen.

I wont be applying to that job anyways, i was simply curious if it was possible, so …if you think its something for you, …then you can try and apply for that job.

Do you know how to compile blender as a python module ??? because I’ve try the ideasman42 tutorial on a windows machine and it doesn’t working for me