First - thanks for all the insight over the last couple of days. Your input has saved me time and helped me make a lot of decisions.
So, I’ve got a small list of projects to complete, the sole purpose of which is to learn the engine. The first thing I did was install Panda on Fedora 12. After a couple hours of dependency heartache, I got Panda in and even ran the first bit of the manual - where you get a gray screen.
The next section uses this code:
from direct.showbase.ShowBase import ShowBase class MyApp(ShowBase): def __init__(self): ShowBase.__init__(self) # Load the environment model. self.environ = self.loader.loadModel("models/environment") # Reparent the model to render. self.environ.reparentTo(self.render) # Apply scale and position transforms on the model. self.environ.setScale(0.25, 0.25, 0.25) self.environ.setPos(-8, 42, 0) app = MyApp() app.run()
I created the file in vi and saved it. I immediately get an error saying that “self” had not been properly declared or something - (I’m in Windows right now…). Then, I read that Python is picky about tab indents - which I had used in vi. So, I took them out and saved - got the same error.
In despair, I installed Panda on XP, copied the code off the site into Notepad and ran - no errors and the scene rendered. I put the tabs back in - it STILL RAN.
Could vi be putting in characters that Python can see and doesn’t like?
Ok, the actual error is:
self.environ = self.laoder.loadModel("models/environment") NameError: name 'self' is not defined
I copied and pasted the same code from the site into Gedit, saved it and ran it - it ran fine. So, I set vi encoding to UTF-8 and saved its file and ran - still no go.
So, it looks like a Python syntax issue.