In going through these tutorials, I’ve noticed a lot of objects that are assumed to exist, even though I can’t find a mention of them in any of the reference material. I’ve been help()ing my way through the packages, but that’s slow going, so I’ll just ask:
Where are objects like “base”, “camera”, “render”, etc. defined?
I can kinda figure out where the classes are, but…where (and why) are they (already) instantiated? Is there a list of these objects somewhere?
Hello,
I assume this is the first tutorial you are talking about:
import direct.directbase.DirectStart
run( )
When you import DirectStart (file: Panda3D-1.3.0\direct\src\directbase\DirectStart.py) a single instance of Class ShowBase (file: Panda3D-1.3.0\direct\src\showbase\ShowBase.py) is created.
On creation this class modified the builtins namespace, by adding names like “base”, “camera”, “render”, “bboard” and so on to the namespace. Have a look yourself to see what names are available: around line 236 in file ShowBase.py.