woo

Woo integration into Blender?

Asked by Nabil

Hi,
Is it possible to import woo (as a python module) into Blender to conduct simulations and post-processing? My scenario:

->I do not know very much Python (just importing modules), I am asking this on behalf of a colleague who is working with woo and requires some "fancy" simulations (something ParaView is not capable of).
->woodaily is installed on my system
->latest Blender version (2.69) is also installed (in which I am fairly proficient)
->Ubuntu 14.04(amd64) LTS

The logic:
I can import woo in a regular python terminal like so: "import woo". However this module is not found in the Blender Python console, I know for a fact that this an issue with the environment variables, but I don't know what ones I need to configure.

Any help would be MUCH appreciated!
-Nabil

Question information

Language:
English Edit question
Status:
Answered
For:
woo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Václav Šmilauer (eudoxos) said :
#1

Hi Nabil,

I tried to import woo in Blender and there are two obstacles.

1. The module path does not contain the directory where woo resides, but this is due to the fact that

2. blender integrates Python 3.4, whereas Woo is compiled against Python 2.7.

I filed #1349916 to address this, and did some fixes in setup.py so that at least the compilation starts, but there are for sure issues to be expected. Some modules (e.g. xlrd, xlwt) do not even exist for python3 yet AFAIK.

If you are willing to test the first python3 version once it's ready, I will be happy to give a help.

What is the scenario you plan to use Woo for, with Blender? Just curious.

Cheers, Vaclav

Revision history for this message
Nabil (nmiri127) said :
#2

Generally, we are dealing with ice simulations in various scenarios and the team appreciates the fancy static photos I have generated in Blender. So, instead of going woo->Paraview->Blender, I would like to streamline it into more of a Woo/Blender workflow.

I'd definitely be happy to test the python3 version, just tell me what to do :D

Thanks again,
-Nabil

Revision history for this message
Václav Šmilauer (eudoxos) said :
#3

I looked at python3 support, most of the changes made it to trunk in last commits. setup.py supports use_2to3 to convert python files at install-time, but there are a few outstanding and blocking issues:

* py/_monkey/io.py: unicode vs. str vs. bytes (introduced in py3k), not clear how to make this compatible with both py2k and py3k.
* boost::python iterators are not accepted as iterators in py3k (must look at that in more depth)

For the rest, it seems to be fine, but be patient, it may take a few weeks/months to iron that out. For now, stay on the safe side and use py2k.

I am surprised that blender in 14.04 embeds python3.4, since 2.7 is the default version in the archive (which we support just fine).

Vaclav

Revision history for this message
Nabil (nmiri127) said :
#4

Here is an explanation from their team:

"Since Blender 2.5 we've moved on to Python 3.x This means it is not possible to use Python 2.x for scripting in Blender.

Now it's impossible to build against Python 2.x, and even if you did manage by editing the source-code, you'd probably run into problems running Blender, since Blender's own scripts are coded in Python 3.

Setting PYTHONPATH to a non Python 3.3 installation like Python 2.7 will cause Blender to crash and die horribly. (So always make sure you don't have PYTHONPATH set to a non-compatible Python version. But you can use it to point to an external Python 3.3 installation that has extra modules installed that don't come bundled with Blender).

Note: with current Blender pointing to Python 3.1 or Python 3.2 will also fail. So make always sure you point your PYTHONPATH to same version as used in Blender, should you need the external one."

Revision history for this message
Václav Šmilauer (eudoxos) said :
#5

Hi Nabil, good news -- I commited changes which make Woo work under Python 3.x. Packages are currently being built in the PPA. There might be glitches, but all big problems have been overcome. Cheers, Václav

Can you help with this problem?

Provide an answer of your own, or ask Nabil for more information if necessary.

To post a message you must log in.