I can’t seem to figure out how Panda’s initial python objects are loaded. Searching through all the files, I can’t find the line that defines base. ie., "base = … " How is it initialized?
It is in showbase.py, on line 305 of the init method for showebase.
__builtin__.base = self
__builtin__.render2d = self.render2d
__builtin__.aspect2d = self.aspect2d
__builtin__.render = self.render
__builtin__.hidden = self.hidden
__builtin__.camera = self.camera
__builtin__.loader = self.loader
__builtin__.taskMgr = self.taskMgr
__builtin__.jobMgr = self.jobMgr
__builtin__.eventMgr = self.eventMgr
__builtin__.messenger = self.messenger
__builtin__.bboard = self.bboard
# Config needs to be defined before ShowBase is constructed
#__builtin__.config = self.config
__builtin__.run = self.run
__builtin__.ostream = Notify.out()
__builtin__.directNotify = directNotify
__builtin__.giveNotify = giveNotify
__builtin__.globalClock = globalClock
__builtin__.vfs = vfs
__builtin__.cpMgr = ConfigPageManager.getGlobalPtr()
__builtin__.cvMgr = ConfigVariableManager.getGlobalPtr()
__builtin__.pandaSystem = PandaSystem.getGlobalPtr()
__builtin__.wantUberdog = base.config.GetBool('want-uberdog', 1)
if __debug__:
__builtin__.deltaProfiler = DeltaProfiler.DeltaProfiler("ShowBase")
__builtin__.onScreenDebug = OnScreenDebug.OnScreenDebug()
if self.wantRender2dp:
__builtin__.render2dp = self.render2dp
__builtin__.aspect2dp = self.aspect2dp
Ah. ok. thanks. I don’t know Python very well, and didn’t know about
builtin