Preferred importing method?

It probably goes without saying that I am completely new to panda3d.

I’ve seen several ways to import various panda3d classes/modules, but they don’t seem consistent and I can’t figure out what the preferred way to do it is. For example, the “helloWorld” part of the manual seems to import things from “direct” (which I can’t find in the modules list):

from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from import Actor
from direct.interval.IntervalGlobal import Sequence

Is “direct” somehow equivalent to “panda3d”? Also, how do you import/use the “core” panda3d classes this way? Do you use for example:

from direct.core import Camera

I’ve also seen this:

from pandac.PandaModules import * 

I can’t find a reference to “pandac.PandaModules” in the documentation, but it seems to import all of the core stuff?

How do people normally handle this? Thanks.

“direct” is Panda engine components that are written in Python (like Actor).

“pandac.PandaModules” is the older (but still works) method of importing Panda classes.

“panda3d” is the newer method of importing Panda classes, and is split into a few sub groups:
“panda3d.core” is generally all you need for your game.
“panda3d.egg” for classes used to write out EGG files.
There are more I think but those are the ones I use.

Generally in most of my Python files I will have “from panda3d.core import *”, and if I have a need of something from direct such as Actor I will import that as well like “from import Actor”.

Great, thanks for the explanation!