Seite 1 von 1

ter2blend

Verfasst: Samstag 13. August 2005, 10:26
von Tadaki
Hallo zusammen,
ich bin in Python noch ein ziemlicher Anfänger (genauer gesagt habe ich erst gestern davon erfahren) und habe doch schon ein kleines Problem: ich arbeite mit Terragen[ http://terradreams.de/MainIndex.php ] und Blender [ http://blender.org/cms/Home.2.0.html ]. Es gibt da ein kleines Tool, mit dem man Landschaften aus Terragen in Blender importieren kann, dieses Tool heißt Terra2Blend [ http://home.pacbell.net/c_keith/project ... rial1.html ] (Vielleicht erzähle ich euch nichts neues, ich schreib mal alles hin).
terra2blend funktioniert mithilfe eines python-scripts, deshalb habe ich mir python 2.4.1 runtergeladen.

edit:ab hier nicht mehr aktuell


jetzt stehe ich allerdings vor dem problem, dass ich da ein script habe, das programm auch, aber ich weiß nicht wie ich das verbinden könnte... ich muss das script ja irgendwie mit python in Blender ausführen. Vielleicht hat ja jemand schon Erfahrung mit Terra2Blend und kann mir weiterhelfen? Is wahrscheinlich ne ziemliche Anfängerfrage, aber ich habe wie gesagt mit Python noch nie gearbeitet.
lg
tadaki

Verfasst: Samstag 13. August 2005, 10:35
von Tadaki
so, ich bin jetzt soweit, dass ich weiß, wie man das script ausführt. dann jedoch kommt eine fehlermeldung:
"Python script error, check console"
und der scheiont irgendwie Probleme mit der Zeile "import os, glob" zu haben. kann mir da einer weiterhelfen?

Verfasst: Samstag 13. August 2005, 10:46
von gerold
Hi!

Vielleicht kann dir jemand aus dem Blender-Forum weiter helfen.

http://blendpolis.serverpool.org/f/index.php

Hier ein Link zu einem für dich evt. interessanten Thema:

http://blendpolis.serverpool.org/f/view ... ght=python

mfg
Gerold
:-)

Verfasst: Samstag 13. August 2005, 11:25
von Tadaki
Vielen Dank für die Antwort, bin auch schon ne ganze Menge weitergekommen: Ich hab jetzt raus, dass man den pythonpfad umändern muss um python zu starten. zitat:

"After installing python you need to set your Python path in Blender, so Blender knows where to look for the libraries:

Setting the PYTHONPATH

If you have installed Python 2.2.X and Blender 2.28c but ter2blend still does not work after activating it with ALT P then it is time to check your PYTHONPATH!!

1. Go to your windows START button and select programs . Then search for the Python 2.2 folder and start IDLE (Python GUI) . Type after the prompt:

import sys
print sys.path

2. You will get an answer which will look similar like this:

['D:\\Python22', 'D:\\PYTHON22\\Tools\\idle', 'd:\\python22', 'd:\\python22\\dlls', 'd:\\python22\\lib', 'd:\\python22\\lib\\plat-win', 'd:\\python22\\lib\\lib-tk']

3. Now it is time to check the same in Blender. Start Blender, open the text window with SHIFT F11 and create a new text with ALT SHIFT F . Type again:

import sys
print sys.path

Start the script with ALT P

4. Check now in the DOS windows:



5. If you don't find the path back you saw in step 2 then it is time to edit your AUTOEXEC.BAT. This can be done like this (there are indeed other ways to do this but this somewhat blunderproof):

* Go to your windows START button and select RUN . In the pop up window type sysedit and click on OK .
* Now a new window appears. Select the c:\autoexec.bat window.
* look again at answer you got in step 2:

['D:\\Python22', 'D:\\PYTHON22\\Tools\\idle', 'd:\\python22', 'd:\\python22\\dlls', 'd:\\python22\\lib', 'd:\\python22\\lib\\plat-win', 'd:\\python22\\lib\\lib-tk']

* convert it like this:
1. delete all '
2. delete the [ and ]
3. replace all \\ with a single \
4. delete all spaces after the ,
5. replace all , with ;

so you get something like:

d:\python22\dlls;d:\python22\lib;d:\python22\lib\plat-win;d:\python22\lib\lib-tk

* type the following line in your autoexec.bat:

SET PYTHONPATH=d:\python22\dlls;d:\python22\lib;d:\python22\lib\plat-win;d:\python22\lib\lib-tk

* Save your autoexec.bat and reboot your machine. I'll bet ter2blend will work now Smile
"

[bisserl längerer text, sry Wink ]


Tjoa, und das geht nun nicht, das Pythonscript stopt nun sogar zwei zeilen früher. Muss man den pythonpfad wirklich umändern?

Verfasst: Samstag 13. August 2005, 11:57
von ProgChild
Du musst das Script in den Unterordner "scripts" im Blender Ordner tun. Dann kannst du im Menü über Export das Script benutzen...

Unter umständen liegt der Ordner "scripts" auch in einem Blender Ordner in deinem Heim Verzeichniss.

Edit: In dem Ordner sind schon ganz viele .py Dateien. Wenn du den Ordner nicht findest, dann such doch mal nach der Datei "raw_import.py". Die sollte auf jeden Fall in dem Ordner liegen. Du brauchst außerdem Python nicht installieren, da Blender den Python Interpreter schon eingebunden hat.

Verfasst: Samstag 13. August 2005, 12:09
von Gast
ok problem gelöst ;-) ich hab den pythonpfad verändert [ http://home.pacbell.net/c_keith/project ... orial.html -->setting the pythonpath] dann gings ;-) vielen dank trotzdem für die antworten
lg
tadaki