Tobak30 opened this issue on May 29, 2006 · 9 posts
Tobak30 posted Mon, 29 May 2006 at 3:40 PM
Hi there.
I am pretty new at blender. Have just played with terragen for a while. And now I would like to import the terrains into blender because I would like to use the particel system to make some grass.
The problem I got is that I can't get the ter2blend script to work. I run it and i follow the instructions to the letter. Typing in all the sunheading, camera heading, positon and all. But then I resive a error message. Sorry to say I don't have that error message here at the moment since I am not at home with my computer.
I use the latest ter2blend v4 version and the latest blender buildt.
Anoher thing is that I ter2blend can't get the terrain bigger than 255 loaded into blender. I usually make terrains in 512 due to the limits of the free version of terragen.
Is there any other script that could import .ter files into blender? I like the ease of modeling it in World Machine and wouldn't like to miss that oppurtunity.
haloedrain posted Mon, 29 May 2006 at 3:55 PM
I have never used that script and I haven't used terragen in a looong time, so I can't help you with the script. But if you can't get it to work any other way you might try just exporting an obj (or dxf, or whatever) from terragen and importing into blender. You might not be able get the camera and lighting data that way, but you will be able to get the terrain.
One thing to check on the script is whether you need to have python installed and whether you have the correct version of python. Do post the error message when you get a chance--from a quick google search it looks like ter2blend is pretty much THE way to get things from terragen to blender, so there must be some way to get it working for you.
Enivob posted Wed, 31 May 2006 at 8:18 PM
So what is the correct version of python?
I notice when I launch blender it says I am missing some portion of python. Does anyone else see that kind of message in the DOS box when it starts up?
haloedrain posted Wed, 31 May 2006 at 9:35 PM
Ah! Ok, that could be the problem. You may not have python installed at all, or you may not have it correctly installed. If you haven't installed python before, go to python.org and download the latest version of python (2.4.3, apparently)--if you see anything about development releases do not get those, get the stable one. This is if you're using the current version of blender, older versions require python 2.3.
Run the installers if you get that version, or compile, etc. depending on what version you get. I installed it a long time ago, so I don't know if the installers set the classpath in this version, but probably not. If you have installed it before, this will be where it has gone wrong.
Here's a post over at Elysiun on setting the python path in Windows.
I should create a tutorial with pictures and stuff on that one of these days and put it up here. No time right now, though.
Tobak30 posted Thu, 01 June 2006 at 7:30 AM
Hi there. I use the Python 2.4. Got the whole lot installed.
My error message is.
UnboundLocalError: local variable 'xpts' referenced before assignment.
It also states that there something with line 307, line 325 and line 511. Don't know what that is though. I am really crappy at programming. Don't know anything about it.
nruddock posted Thu, 01 June 2006 at 2:14 PM
What's the name of the file your running ?
If it's Ter2Blend_v4p.py, I think I see what the problem is and can suggest a potential fix.
Tobak30 posted Thu, 01 June 2006 at 3:40 PM
Shure it is Ter2Blend_v4p.py
All help is appreciated.
nruddock posted Thu, 01 June 2006 at 4:53 PM
Ok, try this.
Open the file in a text editor and find this code
keys=['SIZE','XPTS','YPTS','SCAL','CRAD','CRVM','ALTW']
totest = ter.read(4)
while 1:
and change it to
keys=['SIZE','XPTS','YPTS','SCAL','CRAD','CRVM','ALTW']
totest = ter.read(4)
xpts = 0
ypts = 0
while 1:
This will hopefully make the error you mentioned go away.
I can't gaurentee that the problem isn't being caused by there being something wrong with the TER file your trying to read, but if that is the case it should become obvious.
Tobak30 posted Thu, 01 June 2006 at 6:41 PM
Thanks I will try that.