Light Flow problem... what did I do wrong?


(bmax) #1

Ok, I use Blender Creator 2.23, i want to export to LightFlow using i-dont-remember-who’s export script, and the console spits out the following message:

PYTHON SCRIPTING ERROR:
Traceback (most recent call last):
File “LFexport.py”, line 8, in ?
ImportError: No module named os

Can anybody tell me what i did wrong, maybe i installed python incorrectly. I just installed it into a directory, was i supposed to copy some dll’s too?

Please Help!
Tom


(S68) #2

Hi!

1 - eeshlo !!!

2 - you must have the PYTHONPATH environment variable correctly set.

Chhers

Stefano


(bmax) #3

Well…
I set the pythonpath in autoexec.bat to “C:GrafixPython 2.2”, thats where i installed python into. But the same error still occurs…

Tom


(beatabix) #4

1: remove spaces from your python path. not always necessary, but better safe than sorry.

2: if you are running winXP then the autoexec.bat serves no real purpose in this situation. you need to go into the control panel and set it from there. i forget how.

3: blender uses python 2.0.1, not 2.2

BEAT


(bmax) #5

Hmm…
I did all that you guys told me, and the error has not changed, always the same thing.
Is there any cure?


(Jamesk) #6

All I remember is that I couldn’t get the LF-thingy to work until I uninstalled my Python 2 and replaced it entirely with Python 1.5 instead. You could try that :slight_smile:


(Condorcet) #7

Lightflow only works with Python 1.5**. It hasn’t been updated in a long time.

C


(bmax) #8

sigh… guess what… yea, you guessed it : it does not work!!

why the hell doesn’t it work?!! do i have to ‘link’ blender to python too, somehow?

oh well, hope someone helps :wink:

Tom

PS:Couldn’t someone just compile a dll out of the exporter? just like that DOF plug-in…


(eeshlo) #9

The export script and Blender use python 2.0 (an maybe higher versions too, I’m not sure), but the current Lightflow version needs python 1.5
So you need both to make it work. Depending on which version you installed first, you need to set the correct path in your autoexec.bat or something equivalent.
I had installed Python2.0 first and after that python1.5, python2.0 is in my main C: directory, and python1.5 in the Program files directory, but that does not really matter, you can place it anywhere you want of course.
The main thing is that you need to set the PYTHONPATH which includes all the relevant directories python needs to know about, not just the main directory, mine looks like this:

SET PYTHONPATH=C:PYTHON20;C:PYTHON20DLLS;C:PYTHON20LIB;C:PYTHON20LIBLIB-TK

Read the Lightflow README file in the main directory on how to install it properly, you need to set a number of other environment variables and copy the Lightflow dlls to the required directories.

And about compiling a dll, the script can’t be compiled this way, but as Lightlfow also provides a C++ interface, someone could try to create a dll that directly interfaces with Lightflow, this would bypass Python completely and so a render-from-blender would again be possible…
But it is better to wait for a new version if this will ever happen, there have been some signs that there will be a new version eventually…

<font size=-1>[ This Message was edited by: eeshlo on 2002-03-26 07:07 ]</font>


(bmax) #10

:o
YEEEEEEEEES!!! :slight_smile: :slight_smile: :slight_smile: :slight_smile:

YES; I GOT BLENDER TO EXPORT; WOOHOO!
BUT…HOW THE HELL DO YOU START LIGHTFLOW? THERE ARE SO MANY EXE FILES; AND NONE OF THEM SEAM TO DO ANYTHING OF USE TO ME…

…If anybody could help…please? :’(

Tom


(eeshlo) #11

You use Lightflow indirectly through python, meaning, if you double-click any of the example .py files in the LightflowPMExamples directory, it should render a .tga file and place it in the same directory.
Of course you can do the same with the .py files produced by the export script.


(bmax) #12

ok… it doesnt do what i want it to do, ie: it doesnt do anything. do i have to set the environment variable to both python versions?

i think i do…:smiley:

if i have to do smthng else, please tell me!

Tom the idiot (that’s what it comes down to doesnt it?)


(Condorcet) #13
  1. You can’t click on one of the lightflow exe files–they must be invoked through a dos command, or by running a lightflow py file.

  2. simply clicking on the lightflow py file probably won’t work because the exported py file doesn’t know how to find Python1.5. It automatically finds Python 2.0 in your autoexec.bat file, which won’t work with lightflow.

So you need to find a way to tell the lightflow file you exported to find Python1.5 (which you’ve installed, right?). You can add a few lines of python at the beginning of the script, but I’m afraid I’ve now forgotten the syntax. Any programmers out there recall?

Back when I was playing around with lightflow I invoked in dos a short .bat file that pointed to the correct python and lightflow path. I’ll see if I can remember how I set this up, but meanwhile perhaps a more experienced computer-wiz can explain what to do more clearly. Eeshlo? Iceman? Is he around here?

C


(bmax) #14

tadaa, tadaa, tadatadatadaAaAaAaAaaaa!
[that was a trumpet ;)]

Does anybody know how to invoke lightflow with the correct python version? Any Python freaks and buffs out there… EESHLO?!! ICEMAN?!! , where the f…iddle-sticking hell are you?!

IF YOU SEE THIS POST YOU ARE ENCOURAGED TO HELP.
(in other words : “ya better help, or else…!” :smiley: )

Cheers,
Tom


(bmax) #15

HELP, GUYS… PLEEEEAAASE!!!
;(:(:(:(:(:(:frowning:

tom the dumbass [sigh…]


(eeshlo) #16

What happens when you try to execute one of the lightflow example files? Do you briefly see a dosbox appear?

You have installed Python1.5?
You did read the lightflow readme file?
You have added the necessary environment variables to your autoexec.bat?, something like this (I have Lighflow in my ‘Program files’ directory):

SET LIGHTFLOWPATH=C:PROGRA~1LIGHTF~1
SET LIGHTFLOWTEMP=C:WINDOWSTEMP
SET PATH=%PATH%;C:PROGRA~1LIGHTF~1

And you also copied the lightflowPM.dll to the python1.5 DLLs directory and the Lightflow.dll to your WindowsSystem directory?


(Condorcet) #17

Wouldn’t that only work if he had Python20 AND Python15 in the same directory?


(bmax) #18

eeshlo,
i have exactly that done… the thing that happens is when i DOUBLECLICK on a lighflow py file is in exactly what you said, a dosbox appears for a fraction of a second, and then disappeares again, leaving no render.

On the other hand, i found a different method, marcel_goené emailed it to me. i just go to the python dir, and then type something like this:


python d:gfxlighf~1ball_o~1ball_o~1.py

:wink:
That’s what mine looks like. This actually iniciates lightflow, but there is an error in about every line. The first error that appears is the radiosity file is invalid. :o


'radiosity-file', ball_on_wood.rad, 'save',

When i comment it out, lightwave cannot open the ball.mesh although it is in the same directory as the python script.

I really do not know what is wrong, i emailed marcel_goené, but he hasnt responded yet.

Cheers,
Tom :smiley:


(infinder) #19

You can download a small program named LFProgress(sorry I can’t remember the URL find it with google search engine). This prog helps for seeing the rendering progress. It doesn’t work with eeshlo’s export script files unless you delete manualy at the end of the exporting .py file in the line
saver = s.newImager(‘tga-saver’, [ ‘file’, ‘lf_test_0059.tga’]) everything follows the tga file except from the brackets of course.
This is a only a helping utility but in your case it wan’t work either. Open a DOS window and give python to see if the python exe comes up properly. Otherwise there is problem with the path. If everything is ok and you have UVmapped your model make sure your textures are in tga format and put them in the same folder your .py file exist. Edit manualy the py file and change the textures path leaving only the name of the texture: for example c:texturesball.tga becomes ball.tga.
That’s it, render your scene now. I have problems with uv mapping textures don’t export right and it took me one day to figure out what I’ve already said. I believe eeshlo’s script is great but it needs some work because users don’t have the patience to find out how it works(some instructions maybe?). And definitely it needs a gui and simple image mapping not only UV. I’m not complaining I just have to say this.

<font size=-1>[ This Message was edited by: infinder on 2002-03-28 00:31 ]</font>


(eeshlo) #20

To 3DGamer:
You should probably be able to start python1.5 from the ‘Start’ menu, select the one that says ‘Python (command line)’
Then type this:


&gt;&gt;&gt; execfile("D:\GFX\LIGHTF~1\Pm\Examples\ball1.py")

I am not sure if I got the path right, so change it to wherever the ball1.py file is located.
If there are any errors you will be able to see them without the dosbox disappearing again.

To Infinder:
I understand that a lot of people might find the script almost impossible to use. It was all a relatively quick hack, I can think of lots of things (and ways of how) to improve it. But I’m not sure if it is really worth it. There are things that still cannot be done, like regular image mapping, Lightflow can do spherical/planar/cylindrical mapping, but Blender’s python API does not (yet?) have access to the mapping methods used for images.
Also, I think it is better to wait for a new Lightflow version.
It might be possible to bypass Python entirely with Lightflow’s C++ interface, but that is a lot of work of course, although that would have the advantage of rendering directly from Blender.
As for your problems with UV-textures, if the path is correct in Blender then it should work with lightflow.
As for other image formats, I can of course create a extension module to do conversion of textures so other image formats can be used as well, similar to Blenderman, but I don’t really want to compete with that…
But I am willing improve things when I find the time, anyone who has specific suggestions, your welcome to mail them to me…