access python API from outside Blender

i’m developing a semibiological simulation for my architecture diploma. as i used to work a lot in Blender i wondered, if it is possible to access the blender geometry calculations from outside Blender without diving into the source code. is it possible to access those functions by using the Python API of Blender via Java or .NET, or does Blender have to run to make the Python functions work correct?

As far as I know, no, at least not simply.

That doesn’t, though, preclude that there could be some painful way of doing it (or an easy way I haven’t seen :wink: ), like setting up Blender to run a python script which executes some commands when Blender is invoked from command line and stores them to file. From there you just invoke Blender from your Python script, grab the newly written contents and use it. Certainly not something you want to loop, though, and there are better alternatives like NumPy, or even “borrowing” the C code as translated Python code from Blender for your script.

yes, certainly not :slight_smile: but thanks for the answer.

python build --compiler=mingw32

or something similar would make Blender able to be run as a python script.
presumably you could call functions from this script with another script.

oh, this sounds like the thing i wanted to do. perfect interpretation of my poor target description.
but could you explain your proposal for a solution a bit more precise please? the first line is the command to compile what? the blender python library thats included in the release?

afaik this is experimental.
I would be surprised if it has been done with blender.
the concept is instead of compiling blender as an .exe file,
you compile blender as a .pyd.
this would be some trick in itself!
but, if you are seeking certain modules that blender uses,
it would be possible just to compile what you need as a .pyd, then go from there.
I don’t know too much more other than this system may be the answer also to importing other python based programs directly into blenders viewport (via script link) after the 2.5ish recode.
I presume it would work with the other way around as well. now.
I guess you would have to look into .pyd compiling on the python site.
the code is sample code from the MH site.

@LaPostal: another approach you might consider is publishing Blender functionality via RPC. That way you do have to run Blender, but it is quite easy to set up and is platform neutral (you can call RPC functions via java, .net, whatever, as long as the platform has an RPC library). This way I am developing very simple networkrendering functionality for blender, so there’s is already working code you can use if you like (see thread )