Answering the original mail: - Blender as a python module compiles blender headless, there is no way to have the interface usable at the moment and probably wont be added near term. ... updated cmake description of this option so its more clear.
- IPython embed: >>> from IPython import embed >>> embed() This works for me with no hanging/crashing, but it opens the terminal in the terminal used to start blender (which you probably dont want). So there are a few options... - Make blenders python terminal a _real_ terminal, that uses stdin/stdout, possibly emulates vt100 - this way we could get embedding of any command line apps interactive stuff automatic. ... for me this is too much work to do - but it is an option :S. - Go for some own-implementation, could extend the text editor for eg to execute ipython functionality. ... not a fan of this option but including since its been done before and fairly straightforward. - Use the existing console but make use of ipython modules: ... would involve editing ./release/scripts/modules/console_python.py I think this is a fairly simple task - but to be added into blender we would need to have it optional. Last option is best imho - we may have even bundled ipython with blender but at the time of writing the console ipython wasnt updated to python3. On Tue, Jun 26, 2012 at 10:26 AM, klo uo <[email protected]> wrote: > Hi, > > Hopefully I picked right list from many available, presented here: > http://lists.blender.org/mailman/listinfo/ > > I'm starting to learn Blender and sure I have many misconceptions right now. > I'm running Blender compiled on Ubuntu 12.04 with cmake with Python > support (WITH_PYTHON_INSTALL), so I have Python 3 system modules > available. Previously I compiled with WITH_PYTHON_MODULE to bpy.so > which I could call with Python interpreter, but it's not what I'm > after as there is no UI, no interaction, only option to pick > intermediate result seem to be rendering to image file... > > FYI, I would like to translate VTK objects to Blender, together with > color LUT. VTK isn't ported to Python 3 yet, but it probably will be > when major Linux distributions start to treat Python 3 as default > interpreter (as main VTK Python porter wrote). That's just to make the > problem harder. But other than that Blender is huge environment for > many interesting things, and for user interested in 3D and multimedia > exploration, Blender is inevitable at some point, like for me right > now :) > > Blender has Python console and that's great. However I'm used to > IPython console and headed to solution where I can interface Blender > with IPython console if anyhow possible. > I found some blog posts by Stani (author of SPE IDE) and see he tried > at least two times to do this, although with older Blender and older > IPython, which now have different APIs. Looking at what he did here > http://pythonide.blogspot.com/2009/03/resumable-ipython-inside-blender_31.html > and in later try to embed IPython in Blender's text "panel" it doesn't > feel very convenient and it's like partial solution. I didn't try it > as those API call to both Blender and IPython are obsolete, although I > guess portable. Other than this there is no other info indexed by > Google > > Here is some info about IPython embeddable potential: > http://ipython.org/ipython-doc/dev/interactive/reference.html#embedding-ipython > but I guess knowledge about underlying layers in Blender are needed to > make it work. > > With simple: > > from IPython import embed > embed() > > in Blender Python console, I get maxed CPU and pumping memory, until I > terminate Blender. Some other similar tries resulted in freezing > Blender. > I contacted IPython devs but they advise I ask Blender devs for > details, mainly info about hooking event loop > > So can someone maybe suggest how to load IPython (or potentially > arbitrary Python wrapper, interactively to running Blender > application) that is synced with the Blender event loop? > > > Thanks in advance > _______________________________________________ > Bf-python mailing list > [email protected] > http://lists.blender.org/mailman/listinfo/bf-python -- - Campbell _______________________________________________ Bf-python mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-python
