Do you have to use .egg?

Hi,I am new to this programe and didnt see it in the help thing. I’m having some problems with rendering my scenery. I got a scenery but not in the format .egg its in .x will when I run the code it tells me theres a error with the line with the code telling it to render. I could have been doing this wrong tooXD but I think its right.
Code
import direct.directbase.DirectStart
environ = loader.loadModel(‘town’)
environ.reparentTo(render)
run()

You can load an .x file (Panda will convert it on-the-fly). But you will have to give the full filename with extension, e.g.:


environ = loader.loadModel('town.x')

As a simpler test, see if you can run the command:


pview town.x

If that works, then you should be able to load it up in Python.

David

Still no luck.
^
Unknown template: TextureFileName

Error in ./town.x at line 48, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 49, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 56, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 58, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 59, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 66, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 68, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 69, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 76, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 78, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 79, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 86, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 88, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 89, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 96, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 98, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 99, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 106, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 108, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 109, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 116, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 118, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 119, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 126, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 128, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 129, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 136, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 138, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 139, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 146, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 148, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 149, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 156, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 158, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 159, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 166, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 168, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 169, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 176, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 178, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 179, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 186, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 188, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 189, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 196, column 21:
TextureFileName {
^
Unknown template: TextureFileName

Error in ./town.x at line 198, column 5:
}
^
Too many data elements in structure.

Error in ./town.x at line 199, column 1:
}
^
Too many data elements in structure.

Error in ./town.x at line 201, column 16:
Material Wall 8 {
^
parse error

Unable to open X file: ./town.x
:loader(error): Couldn’t load file town.x: all matching files on model path inva
lid.
Traceback (most recent call last):
File “D.py”, line 3, in ?
environ.reparentTo(render)
AttributeError: ‘NoneType’ object has no attribute ‘reparentTo’

C:\Panda3D-1.0.5\samples\MyStuff>

See this thread:

https://discourse.panda3d.org/viewtopic.php?t=38

For someone with a similar problem. The solution is to open the .x file with a text editor, and do a global search-and-replace from “TextureFileName” to “TextureFilename”.

David

LOL ok about there… 1 more error
Microsoft Windows XP [Version 5.1.2600]
© Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Owner\Desktop>cd C:\Panda3D-1.0.5\samples\MyStuff\

C:\Panda3D-1.0.5\samples\MyStuff>ppython D.py
DirectStart: Starting the game.
Warning: DirectNotify: category ‘Interval’ already exists
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)

Error in ./town.x at line 201, column 16:
Material Wall 8 {
^
parse error

Unable to open X file: ./town.x
:loader(error): Couldn’t load file town.x: all matching files on model path inva
lid.
Traceback (most recent call last):
File “D.py”, line 3, in ?
environ.reparentTo(render)
AttributeError: ‘NoneType’ object has no attribute ‘reparentTo’

C:\Panda3D-1.0.5\samples\MyStuff>

Wow, does your material name really have a space in it, and is that really legal in X format?

Try replacing “Wall 8” with “Wall8”.

David