Tutorial Problem

Hello,

I have just installed Panda3d latest version and I am working my way through the tutorial. The code was running well and I was getting the panda up to the part where the panda was supposed to walk from one tree to another.

Now I am getting an error and I am not sure what the problem is. I copy and pasted the code from the website. This is the error I am getting:

D:\Garage\School\G3D>ppython first.py
DirectStart: Starting the game.
Warning: DirectNotify: category ‘Interval’ already exists
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)
Traceback (most recent call last):
File “first.py”, line 28, in ?
pandaPosInterval1= pandaActor.posInterval(13,Point3(0,-10,0), Point3(0,10,0)
)
NameError: name ‘Point3’ is not defined

Please let me know how I can fix the problem.

Thank you,

Andrei

put this :

from pandac.PandaModules.Point3 import Point3

after import direct.directbase.DirectStart

I guess you forgot an import.
Add

from pandac.PandaModules import LPoint3f

and it should work
Martin

Crap, another example of “import *” biting us.

Actually, the correct import statement is either:


from pandac.PandaModules import Point3

or just:


from pandac.PandaModules import *

LPoint3f is not correct, since that’s the C++ name and the class is renamed on the Python side to just Point3, and Point3.Point3 is not correct since ever since version 1.1 the PandaModules symbols have been pure Python types, not modules or classes within modules.

But the fundamental problem is code that neglects to do either form of import, assuming that some other module that it did an import * from would take care of it. This is an unsafe assumption. A lot of our sample programs exhibit this mistake. Of course, it’s difficult to tell, when writing code, that you have made this mistake, since your code works just fine–until the day that it mysteriously stops working.

David

David - just so you know, I’ve already written a tool to search our code for occurrences of “import *” and to replace those statements with correct, explicit statements. It’s not flawless, but it’s pretty good.

Thank you for the great help. That worked.

I can see that Panda 3d has great support, which is very encouraging.

Andrei