Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ShowBase Class Reference
Inheritance diagram for ShowBase:
DirectObject ThreeUpShow

Public Member Functions

def __init__ (self, fStartDirect=True, windowType=None)
 
def addAngularIntegrator (self)
 
def addSfxManager (self, extraSfxManager)
 
def adjustWindowAspectRatio (self, aspectRatio)
 
def attachInputDevice (self, device, prefix=None)
 
def backfaceCullingOff (self)
 
def backfaceCullingOn (self)
 
def changeMouseInterface (self, changeTo)
 
def closeWindow (self, win, keepCamera=False, removeWindow=True)
 
def createBaseAudioManagers (self)
 
def createStats (self, hostname=None, port=None)
 
def destroy (self)
 
def detachInputDevice (self, device)
 
def disableAllAudio (self)
 
def disableMouse (self)
 
def disableParticles (self)
 
def enableAllAudio (self)
 
def enableMouse (self)
 
def enableMusic (self, bEnableMusic)
 
def enableParticles (self)
 
def enableSoftwareMousePointer (self)
 
def enableSoundEffects (self, bEnableSoundEffects)
 
def finalizeExit (self)
 
def getAlt (self)
 
def getAspectRatio (self, win=None)
 
def getAxes (self)
 
def getBackgroundColor (self, win=None)
 
def getControl (self)
 
def getExitErrorCode (self)
 
def getMeta (self)
 
def getRepository (self)
 
def getShift (self)
 
def getSize (self, win=None)
 
def initShadowTrav (self)
 
def isParticleMgrEnabled (self)
 
def isPhysicsMgrEnabled (self)
 
def loadMusic (self, name)
 
def loadSfx (self, name)
 
def makeAllPipes (self)
 
def makeCamera (self, win, sort=0, scene=None, displayRegion=(0, 1, 0, 1), stereo=None, aspectRatio=None, clearDepth=0, clearColor=None, lens=None, camName='cam', mask=None, useCamera=None)
 
def makeCamera2d (self, win, sort=10, displayRegion=(0, 1, 0, 1), coords=(-1, 1, -1, 1), lens=None, cameraName=None)
 
def makeCamera2dp (self, win, sort=20, displayRegion=(0, 1, 0, 1), coords=(-1, 1, -1, 1), lens=None, cameraName=None)
 
def makeDefaultPipe (self, printPipeTypes=None)
 
def makeModulePipe (self, moduleName)
 
def movie (self, namePrefix='movie', duration=1.0, fps=30, format='png', sd=4, source=None)
 
def oobe (self, cam=None)
 
def oobeCull (self, cam=None)
 
def openDefaultWindow (self, *args, **kw)
 
def openMainWindow (self, *args, **kw)
 
def openWindow (self, props=None, fbprops=None, pipe=None, gsg=None, host=None, type=None, name=None, size=None, aspectRatio=None, makeCamera=True, keepCamera=False, scene=None, stereo=None, unexposedDraw=None, callbackWindowDict=None, requireWindow=None)
 
def playMusic (self, music, looping=0, interrupt=1, volume=None, time=0.0)
 
def playSfx (self, sfx, looping=0, interrupt=1, volume=None, time=0.0, node=None, listener=None, cutoff=None)
 
def popCTrav (self)
 
def printEnvDebugInfo (self)
 
def pushCTrav (self, cTrav)
 
def removeCameraFrustum (self)
 
def restart (self, clusterSync=False, cluster=None)
 
def reviveInput (self)
 
def run (self)
 
def saveCubeMap (self, namePrefix='cube_map_#.png', defaultFilename=0, source=None, camera=None, size=128, cameraMask=PandaNode.getAllCameraMask(), sourceLens=None)
 
def saveSphereMap (self, namePrefix='spheremap.png', defaultFilename=0, source=None, camera=None, size=256, cameraMask=PandaNode.getAllCameraMask(), numVertices=1000, sourceLens=None)
 
def screenshot (self, namePrefix='screenshot', defaultFilename=1, source=None, imageComment="")
 
def SetAllSfxEnables (self, bEnabled)
 
def setAspectRatio (self, aspectRatio)
 
def setBackgroundColor (self, r=None, g=None, b=None, a=0.0, win=None)
 
def setFrameRateMeter (self, flag)
 
def setMouseOnNode (self, newNode)
 
def setSceneGraphAnalyzerMeter (self, flag)
 
def setSleep (self, amount)
 
def setupDataGraph (self)
 
def setupMouse (self, win, fMultiWin=False)
 
def setupMouseCB (self, win)
 
def setupRender (self)
 
def setupRender2d (self)
 
def setupRender2dp (self)
 
def setupWindowControls (self, winCtrl=None)
 
def showCameraFrustum (self)
 
def shutdown (self)
 
def silenceInput (self)
 
def spawnTkLoop (self)
 
def spawnWxLoop (self)
 
def startDirect (self, fWantDirect=1, fWantTk=1, fWantWx=0)
 
def startTk (self, fWantTk=True)
 
def startWx (self, fWantWx=True)
 
def textureOff (self)
 
def textureOn (self)
 
def tkRun (self)
 
def toggleBackface (self)
 
def toggleParticles (self)
 
def toggleShowVertices (self)
 
def toggleTexMem (self)
 
def toggleTexture (self)
 
def toggleWireframe (self)
 
def updateManagers (self, state)
 
def useDrive (self)
 
def userExit (self)
 
def useTrackball (self)
 
def windowEvent (self, win)
 
def wireframeOff (self)
 
def wireframeOn (self)
 
def wxRun (self)
 
- Public Member Functions inherited from DirectObject
def __init__ (self)
 
def accept (self, event, method, extraArgs=[])
 
def acceptOnce (self, event, method, extraArgs=[])
 
def addTask (self, *args, **kwargs)
 
def detectLeaks (self)
 
def doMethodLater (self, *args, **kwargs)
 
def getAllAccepting (self)
 
def ignore (self, event)
 
def ignoreAll (self)
 
def isAccepting (self, event)
 
def isIgnoring (self, event)
 
def removeAllTasks (self)
 
def removeTask (self, taskOrName)
 

Public Attributes

 a2dBackground
 
 a2dBottom
 The Z position of the bottom border of the aspect2d screen. More...
 
 a2dBottomCenter
 
 a2dBottomCenterNs
 
 a2dBottomLeft
 
 a2dBottomLeftNs
 
 a2dBottomRight
 
 a2dBottomRightNs
 
 a2dLeft
 The X position of the left border of the aspect2d screen. More...
 
 a2dLeftCenter
 
 a2dLeftCenterNs
 
 a2dpBottom
 The Z position of the bottom border of the aspect2dp screen. More...
 
 a2dpBottomCenter
 
 a2dpBottomLeft
 
 a2dpBottomRight
 
 a2dpLeft
 The X position of the left border of the aspect2dp screen. More...
 
 a2dpLeftCenter
 
 a2dpRight
 The X position of the right border of the aspect2dp screen. More...
 
 a2dpRightCenter
 
 a2dpTop
 The Z position of the top border of the aspect2dp screen. More...
 
 a2dpTopCenter
 
 a2dpTopLeft
 
 a2dpTopRight
 
 a2dRight
 The X position of the right border of the aspect2d screen. More...
 
 a2dRightCenter
 
 a2dRightCenterNs
 
 a2dTop
 The Z position of the top border of the aspect2d screen. More...
 
 a2dTopCenter
 
 a2dTopCenterNs
 
 a2dTopLeft
 
 a2dTopLeftNs
 
 a2dTopRight
 
 a2dTopRightNs
 
 app_runner
 
 AppHasAudioFocus
 
 appRunner
 This contains the global appRunner instance, as imported from AppRunnerGlobal. More...
 
 appTrav
 
 aspect2d
 The normal 2-d DisplayRegion has an aspect ratio that matches the window, but its coordinate system is square. More...
 
 aspect2dp
 The normal 2-d DisplayRegion has an aspect ratio that matches the window, but its coordinate system is square. More...
 
 backfaceCullingEnabled
 
 bboard
 The global bulletin board, as imported from BulletinBoardGlobal. More...
 
 bufferViewer
 
 buttonThrowers
 
 cam
 This is a NodePath pointing to the Camera object set up for the 3D scene. More...
 
 cam2d
 
 cam2dp
 
 camera
 This is the NodePath that should be used to manipulate the camera. More...
 
 camera2d
 
 camera2dp
 
 camFrustumVis
 
 camLens
 Convenience accessor for base.camNode.get_lens() More...
 
 camList
 This is a list of all cameras created with makeCamera, including base.cam. More...
 
 camNode
 Convenience accessor for base.cam.node() More...
 
 clientSleep
 
 cluster
 
 clusterSyncFlag
 
 cTrav
 This is a placeholder for a CollisionTraverser. More...
 
 cTravStack
 
 dataRoot
 
 dataRootNode
 
 debugRunningMultiplier
 
 deviceButtonThrowers
 
 devices
 This is the global input device manager, which keeps track of connected input devices. More...
 
 dgTrav
 
 direct
 
 drive
 
 eventMgr
 The global event manager, as imported from EventManagerGlobal. More...
 
 exitFunc
 Fill this in with a function to invoke when the user "exits" the program by closing the main window. More...
 
 finalExitCallbacks
 Add final-exit callbacks to this list. More...
 
 frameRateMeter
 
 graphics_engine
 
 graphicsEngine
 The global graphics engine, ie. More...
 
 hidden
 
 jobMgr
 The global job manager, as imported from JobManagerGlobal. More...
 
 loader
 
 main_dir
 
 mainDir
 The directory containing the main Python file of this application. More...
 
 mainWinForeground
 
 mainWinMinimized
 
 messenger
 The global messenger, as imported from MessengerGlobal. More...
 
 mouse2cam
 
 mouseInterface
 
 mouseInterfaceNode
 
 mouseWatcher
 
 mouseWatcherNode
 
 multiClientSleep
 
 musicActive
 
 musicManager
 
 musicManagerIsValid
 
 nextWindowIndex
 
 onScreenDebug
 
 oobe2cam
 
 oobeCamera
 
 oobeCameraTrackball
 
 oobeCullFrustum
 
 oobeLens
 
 oobeMode
 
 oobeTrackball
 
 oobeVis
 
 particleMgr
 Particle manager. More...
 
 particleMgrEnabled
 
 physicsMgr
 Physics manager. More...
 
 physicsMgrAngular
 
 physicsMgrEnabled
 
 pipe
 
 pipeList
 
 pixel2d
 This special root, pixel2d, uses units in pixels that are relative to the window. More...
 
 pixel2dp
 This special root, pixel2d, uses units in pixels that are relative to the window. More...
 
 pointerWatcherNodes
 
 recorder
 
 render
 This is the root of the 3-D scene graph. More...
 
 render2d
 This is the root of the 2-D scene graph. More...
 
 render2dp
 
 requireWindow
 
 run
 
 sceneGraphAnalyzerMeter
 
 screenshotExtension
 
 sfxActive
 
 sfxManagerIsValidList
 
 sfxManagerList
 
 sfxPlayer
 
 shadowTrav
 
 showVertices
 
 task_mgr
 
 taskMgr
 The global task manager, as imported from TaskManagerGlobal. More...
 
 texmem
 
 textureEnabled
 
 timeButtonThrower
 A special ButtonThrower to generate keyboard events and include the time from the OS. More...
 
 tkDelay
 
 tkRoot
 
 tkRootCreated
 
 trackball
 
 transitions
 
 wantDirect
 
 wantFog
 
 wantRender2dp
 
 wantStats
 
 wantTk
 
 wantWx
 
 win
 This is the main, or only window; see winList for a list of all windows. More...
 
 winControls
 
 windowType
 This is set to the value of the window-type config variable, but may optionally be overridden in the Showbase constructor. More...
 
 winList
 
 wireframeEnabled
 
 wxApp
 This is used to store the wx.Application object used when want-wx is set or base.startWx() is called. More...
 
 wxAppCreated
 
 wxTimer
 

Static Public Attributes

def add_angular_integrator = addAngularIntegrator
 
def add_sfx_manager = addSfxManager
 
def attach_input_device = attachInputDevice
 
def backface_culling_off = backfaceCullingOff
 
def backface_culling_on = backfaceCullingOn
 
def change_mouse_interface = changeMouseInterface
 
def close_window = closeWindow
 
 config = DConfig
 
def create_stats = createStats
 
def detach_input_device = detachInputDevice
 
def disable_all_audio = disableAllAudio
 
def disable_mouse = disableMouse
 
def disable_particles = disableParticles
 
def enable_all_audio = enableAllAudio
 
def enable_mouse = enableMouse
 
def enable_music = enableMusic
 
def enable_particles = enableParticles
 
def enable_software_mouse_pointer = enableSoftwareMousePointer
 
def enable_sound_effects = enableSoundEffects
 
def get_aspect_ratio = getAspectRatio
 
def get_background_color = getBackgroundColor
 
def get_size = getSize
 
def init_shadow_trav = initShadowTrav
 
def make_all_pipes = makeAllPipes
 
def make_camera = makeCamera
 
def make_camera2d = makeCamera2d
 
def make_camera2dp = makeCamera2dp
 
def make_default_pipe = makeDefaultPipe
 
def make_module_pipe = makeModulePipe
 
 notify = directNotify.newCategory("ShowBase")
 
def oobe_cull = oobeCull
 
def open_default_window = openDefaultWindow
 
def open_main_window = openMainWindow
 
def open_window = openWindow
 
def remove_camera_frustum = removeCameraFrustum
 
def revive_input = reviveInput
 
def save_cube_map = saveCubeMap
 
def save_sphere_map = saveSphereMap
 
def set_aspect_ratio = setAspectRatio
 
def set_background_color = setBackgroundColor
 
def set_frame_rate_meter = setFrameRateMeter
 
def set_mouse_on_node = setMouseOnNode
 
def set_scene_graph_analyzer_meter = setSceneGraphAnalyzerMeter
 
def set_sleep = setSleep
 
def setup_data_graph = setupDataGraph
 
def setup_mouse = setupMouse
 
def setup_mouse_cb = setupMouseCB
 
def setup_render = setupRender
 
def setup_render2d = setupRender2d
 
def setup_render2dp = setupRender2dp
 
def setup_window_controls = setupWindowControls
 
def show_camera_frustum = showCameraFrustum
 
def silence_input = silenceInput
 
def start_direct = startDirect
 
def start_tk = startTk
 
def start_wx = startWx
 
def texture_off = textureOff
 
def texture_on = textureOn
 
def toggle_backface = toggleBackface
 
def toggle_particles = toggleParticles
 
def toggle_show_vertices = toggleShowVertices
 
def toggle_tex_mem = toggleTexMem
 
def toggle_texture = toggleTexture
 
def toggle_wireframe = toggleWireframe
 
def use_drive = useDrive
 
def use_trackball = useTrackball
 
def wireframe_off = wireframeOff
 
def wireframe_on = wireframeOn
 
- Static Public Attributes inherited from DirectObject
def accept_once = acceptOnce
 
def add_task = addTask
 
def detect_leaks = detectLeaks
 
def do_method_later = doMethodLater
 
def get_all_accepting = getAllAccepting
 
def ignore_all = ignoreAll
 
def is_accepting = isAccepting
 
def is_ignoring = isIgnoring
 
def remove_all_tasks = removeAllTasks
 
def remove_task = removeTask
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  fStartDirect = True,
  windowType = None 
)

Member Function Documentation

◆ addAngularIntegrator()

def addAngularIntegrator (   self)

◆ addSfxManager()

def addSfxManager (   self,
  extraSfxManager 
)

◆ adjustWindowAspectRatio()

def adjustWindowAspectRatio (   self,
  aspectRatio 
)
This function is normally called internally by
windowEvent(), but it may also be called to explicitly adjust
the aspect ratio of the render/render2d DisplayRegion, by a
class that has redefined these. 

◆ attachInputDevice()

def attachInputDevice (   self,
  device,
  prefix = None 
)
This function attaches an input device to the data graph, which will
cause the device to be polled and generate events.  If a prefix is
given and not None, it is used to prefix events generated by this
device, separated by a hyphen.

If you call this, you should consider calling detachInputDevice when
you are done with the device or when it is disconnected.

◆ backfaceCullingOff()

def backfaceCullingOff (   self)

◆ backfaceCullingOn()

def backfaceCullingOn (   self)

◆ changeMouseInterface()

def changeMouseInterface (   self,
  changeTo 
)
Switch mouse action

◆ closeWindow()

def closeWindow (   self,
  win,
  keepCamera = False,
  removeWindow = True 
)
Closes the indicated window and removes it from the list of
windows.  If it is the main window, clears the main window
pointer to None.

◆ createBaseAudioManagers()

def createBaseAudioManagers (   self)

◆ createStats()

def createStats (   self,
  hostname = None,
  port = None 
)

◆ destroy()

def destroy (   self)
Call this function to destroy the ShowBase and stop all
its tasks, freeing all of the Panda resources.  Normally, you
should not need to call it explicitly, as it is bound to the
exitfunc and will be called at application exit time
automatically.

This function is designed to be safe to call multiple times.

◆ detachInputDevice()

def detachInputDevice (   self,
  device 
)
This should be called after attaching an input device using
attachInputDevice and the device is disconnected or you no longer wish
to keep polling this device for events.

You do not strictly need to call this if you expect the device to be
reconnected (but be careful that you don't reattach it).

◆ disableAllAudio()

def disableAllAudio (   self)

◆ disableMouse()

def disableMouse (   self)
Temporarily disable the mouse control of the camera, either
via the drive interface or the trackball, whichever is
currently in use.

◆ disableParticles()

def disableParticles (   self)

◆ enableAllAudio()

def enableAllAudio (   self)

◆ enableMouse()

def enableMouse (   self)
Reverse the effect of a previous call to disableMouse().
useDrive() also implicitly enables the mouse.

◆ enableMusic()

def enableMusic (   self,
  bEnableMusic 
)

◆ enableParticles()

def enableParticles (   self)

◆ enableSoftwareMousePointer()

def enableSoftwareMousePointer (   self)
Creates some geometry and parents it to render2d to show
the currently-known mouse position.  Useful if the mouse
pointer is invisible for some reason.

◆ enableSoundEffects()

def enableSoundEffects (   self,
  bEnableSoundEffects 
)

◆ finalizeExit()

def finalizeExit (   self)

◆ getAlt()

def getAlt (   self)

◆ getAspectRatio()

def getAspectRatio (   self,
  win = None 
)

◆ getAxes()

def getAxes (   self)

◆ getBackgroundColor()

def getBackgroundColor (   self,
  win = None 
)
Returns the current window background color.  This assumes
the window is set up to clear the color each frame (this is
the normal setting).

◆ getControl()

def getControl (   self)

◆ getExitErrorCode()

def getExitErrorCode (   self)

◆ getMeta()

def getMeta (   self)

◆ getRepository()

def getRepository (   self)

◆ getShift()

def getShift (   self)

◆ getSize()

def getSize (   self,
  win = None 
)

◆ initShadowTrav()

def initShadowTrav (   self)

◆ isParticleMgrEnabled()

def isParticleMgrEnabled (   self)

◆ isPhysicsMgrEnabled()

def isPhysicsMgrEnabled (   self)

◆ loadMusic()

def loadMusic (   self,
  name 
)

◆ loadSfx()

def loadSfx (   self,
  name 
)

◆ makeAllPipes()

def makeAllPipes (   self)
Creates all GraphicsPipes that the system knows about and fill up
self.pipeList with them.

◆ makeCamera()

def makeCamera (   self,
  win,
  sort = 0,
  scene = None,
  displayRegion = (0, 1, 0, 1),
  stereo = None,
  aspectRatio = None,
  clearDepth = 0,
  clearColor = None,
  lens = None,
  camName = 'cam',
  mask = None,
  useCamera = None 
)
Makes a new 3-d camera associated with the indicated window,
and creates a display region in the indicated subrectangle.

If stereo is True, then a stereo camera is created, with a
pair of DisplayRegions.  If stereo is False, then a standard
camera is created.  If stereo is None or omitted, a stereo
camera is created if the window says it can render in stereo.

If useCamera is not None, it is a NodePath to be used as the
camera to apply to the window, rather than creating a new
camera.

Reimplemented in ThreeUpShow.

◆ makeCamera2d()

def makeCamera2d (   self,
  win,
  sort = 10,
  displayRegion = (0, 1, 0, 1),
  coords = (-1, 1, -1, 1),
  lens = None,
  cameraName = None 
)
Makes a new camera2d associated with the indicated window, and
assigns it to render the indicated subrectangle of render2d.

◆ makeCamera2dp()

def makeCamera2dp (   self,
  win,
  sort = 20,
  displayRegion = (0, 1, 0, 1),
  coords = (-1, 1, -1, 1),
  lens = None,
  cameraName = None 
)
Makes a new camera2dp associated with the indicated window, and
assigns it to render the indicated subrectangle of render2dp.

◆ makeDefaultPipe()

def makeDefaultPipe (   self,
  printPipeTypes = None 
)
Creates the default GraphicsPipe, which will be used to make
windows unless otherwise specified.

◆ makeModulePipe()

def makeModulePipe (   self,
  moduleName 
)
Returns a GraphicsPipe from the indicated module,
e.g. 'pandagl' or 'pandadx9'.  Does not affect base.pipe or
base.pipeList.

◆ movie()

def movie (   self,
  namePrefix = 'movie',
  duration = 1.0,
  fps = 30,
  format = 'png',
  sd = 4,
  source = None 
)
Spawn a task to capture a movie using the screenshot function.
- namePrefix will be used to form output file names (can include
  path information (e.g. '/i/beta/frames/myMovie')
- duration is the length of the movie in seconds
- fps is the frame rate of the resulting movie
- format specifies output file format (e.g. png, bmp)
- sd specifies number of significant digits for frame count in the
  output file name (e.g. if sd = 4, movie_0001.png)
- source is the Window, Buffer, DisplayRegion, or Texture from which
  to save the resulting images.  The default is the main window.

The task is returned, so that it can be awaited.

◆ oobe()

def oobe (   self,
  cam = None 
)
Enable a special "out-of-body experience" mouse-interface
mode.  This can be used when a "god" camera is needed; it
moves the camera node out from under its normal node and sets
the world up in trackball state.  Button events are still sent
to the normal mouse action node (e.g. the DriveInterface), and
mouse events, if needed, may be sent to the normal node by
holding down the Control key.

This is different than useTrackball(), which simply changes
the existing mouse action to a trackball interface.  In fact,
OOBE mode doesn't care whether useDrive() or useTrackball() is
in effect; it just temporarily layers a new trackball
interface on top of whatever the basic interface is.  You can
even switch between useDrive() and useTrackball() while OOBE
mode is in effect.

This is a toggle; the second time this function is called, it
disables the mode.

◆ oobeCull()

def oobeCull (   self,
  cam = None 
)
While in OOBE mode (see above), cull the viewing frustum as if
it were still attached to our original camera.  This allows us
to visualize the effectiveness of our bounding volumes.

◆ openDefaultWindow()

def openDefaultWindow (   self,
args,
**  kw 
)

◆ openMainWindow()

def openMainWindow (   self,
args,
**  kw 
)
Creates the initial, main window for the application, and sets
up the mouse and render2d structures appropriately for it.  If
this method is called a second time, it will close the
previous main window and open a new one, preserving the lens
properties in base.camLens.

The return value is true on success, or false on failure (in
which case base.win may be either None, or the previous,
closed window).

◆ openWindow()

def openWindow (   self,
  props = None,
  fbprops = None,
  pipe = None,
  gsg = None,
  host = None,
  type = None,
  name = None,
  size = None,
  aspectRatio = None,
  makeCamera = True,
  keepCamera = False,
  scene = None,
  stereo = None,
  unexposedDraw = None,
  callbackWindowDict = None,
  requireWindow = None 
)
Creates a window and adds it to the list of windows that are
to be updated every frame.

props is the WindowProperties that describes the window.

type is either 'onscreen', 'offscreen', or 'none'.

If keepCamera is true, the existing base.cam is set up to
render into the new window.

If keepCamera is false but makeCamera is true, a new camera is
set up to render into the new window.

If unexposedDraw is not None, it specifies the initial value
of GraphicsWindow.setUnexposedDraw().

If callbackWindowDict is not None, a CallbackGraphicWindow is
created instead, which allows the caller to create the actual
window with its own OpenGL context, and direct Panda's
rendering into that window.

If requireWindow is true, it means that the function should
raise an exception if the window fails to open correctly.

◆ playMusic()

def playMusic (   self,
  music,
  looping = 0,
  interrupt = 1,
  volume = None,
  time = 0.0 
)

◆ playSfx()

def playSfx (   self,
  sfx,
  looping = 0,
  interrupt = 1,
  volume = None,
  time = 0.0,
  node = None,
  listener = None,
  cutoff = None 
)

◆ popCTrav()

def popCTrav (   self)

◆ printEnvDebugInfo()

def printEnvDebugInfo (   self)
Print some information about the environment that we are running
in.  Stuff like the model paths and other paths.  Feel free to
add stuff to this.

◆ pushCTrav()

def pushCTrav (   self,
  cTrav 
)

◆ removeCameraFrustum()

def removeCameraFrustum (   self)

◆ restart()

def restart (   self,
  clusterSync = False,
  cluster = None 
)

◆ reviveInput()

def reviveInput (   self)
Restores inputs after a previous call to silenceInput.

◆ run()

def run (   self)
This method runs the TaskManager when self.appRunner is
None, which is to say, when we are not running from within a
p3d file.  When we *are* within a p3d file, the Panda
runtime has to be responsible for running the main loop, so
we can't allow the application to do it. 

◆ saveCubeMap()

def saveCubeMap (   self,
  namePrefix = 'cube_map_#.png',
  defaultFilename = 0,
  source = None,
  camera = None,
  size = 128,
  cameraMask = PandaNode.getAllCameraMask(),
  sourceLens = None 
)
Similar to screenshot(), this sets up a temporary cube map
Texture which it uses to take a series of six snapshots of the
current scene, one in each of the six cube map directions.
This requires rendering a new frame.

Unlike screenshot(), source may only be a GraphicsWindow,
GraphicsBuffer, or DisplayRegion; it may not be a Texture.

camera should be the node to which the cubemap cameras will be
parented.  The default is the camera associated with source,
if source is a DisplayRegion, or base.camera otherwise.

The return value is the filename if successful, or None if
there is a problem.

◆ saveSphereMap()

def saveSphereMap (   self,
  namePrefix = 'spheremap.png',
  defaultFilename = 0,
  source = None,
  camera = None,
  size = 256,
  cameraMask = PandaNode.getAllCameraMask(),
  numVertices = 1000,
  sourceLens = None 
)
This works much like saveCubeMap(), and uses the graphics
API's hardware cube-mapping ability to get a 360-degree view
of the world.  But then it converts the six cube map faces
into a single fisheye texture, suitable for applying as a
static environment map (sphere map).

For eye-relative static environment maps, sphere maps are
often preferable to cube maps because they require only a
single texture and because they are supported on a broader
range of hardware.

The return value is the filename if successful, or None if
there is a problem.

◆ screenshot()

def screenshot (   self,
  namePrefix = 'screenshot',
  defaultFilename = 1,
  source = None,
  imageComment = "" 
)
Captures a screenshot from the main window or from the
specified window or Texture and writes it to a filename in the
current directory (or to a specified directory).

If defaultFilename is True, the filename is synthesized by
appending namePrefix to a default filename suffix (including
the filename extension) specified in the Config variable
screenshot-filename.  Otherwise, if defaultFilename is False,
the entire namePrefix is taken to be the filename to write,
and this string should include a suitable filename extension
that will be used to determine the type of image file to
write.

Normally, the source is a GraphicsWindow, GraphicsBuffer or
DisplayRegion.  If a Texture is supplied instead, it must have
a ram image (that is, if it was generated by
makeTextureBuffer() or makeCubeMap(), the parameter toRam
should have been set true).  If it is a cube map texture as
generated by makeCubeMap(), namePrefix should contain the hash
mark ('#') character.

The return value is the filename if successful, or None if
there is a problem.

◆ SetAllSfxEnables()

def SetAllSfxEnables (   self,
  bEnabled 
)

◆ setAspectRatio()

def setAspectRatio (   self,
  aspectRatio 
)
Sets the global aspect ratio of the main window.  Set it
to None to restore automatic scaling. 

◆ setBackgroundColor()

def setBackgroundColor (   self,
  r = None,
  g = None,
  b = None,
  a = 0.0,
  win = None 
)
Sets the window background color to the indicated value.
This assumes the window is set up to clear the color each
frame (this is the normal setting).

The color may be either a VBase3 or a VBase4, or a 3-component
tuple, or the individual r, g, b parameters.

◆ setFrameRateMeter()

def setFrameRateMeter (   self,
  flag 
)
Turns on or off (according to flag) a standard frame rate
meter in the upper-right corner of the main window.

◆ setMouseOnNode()

def setMouseOnNode (   self,
  newNode 
)

◆ setSceneGraphAnalyzerMeter()

def setSceneGraphAnalyzerMeter (   self,
  flag 
)
Turns on or off (according to flag) a standard frame rate
meter in the upper-right corner of the main window.

◆ setSleep()

def setSleep (   self,
  amount 
)
Sets up a task that calls python 'sleep' every frame.  This is a simple
way to reduce the CPU usage (and frame rate) of a panda program.

◆ setupDataGraph()

def setupDataGraph (   self)
Creates the data graph and populates it with the basic input
devices.

◆ setupMouse()

def setupMouse (   self,
  win,
  fMultiWin = False 
)
Creates the structures necessary to monitor the mouse input,
using the indicated window.  If the mouse has already been set
up for a different window, those structures are deleted first.

The return value is the ButtonThrower NodePath created for
this window.

If fMultiWin is true, then the previous mouse structures are
not deleted; instead, multiple windows are allowed to monitor
the mouse input.  However, in this case, the trackball
controls are not set up, and must be set up by hand if
desired.

◆ setupMouseCB()

def setupMouseCB (   self,
  win 
)

◆ setupRender()

def setupRender (   self)
Creates the render scene graph, the primary scene graph for
rendering 3-d geometry.

◆ setupRender2d()

def setupRender2d (   self)
Creates the render2d scene graph, the primary scene graph for
2-d objects and gui elements that are superimposed over the
3-d geometry in the window.

◆ setupRender2dp()

def setupRender2dp (   self)
Creates a render2d scene graph, the secondary scene graph for
2-d objects and gui elements that are superimposed over the
2-d and 3-d geometry in the window.

◆ setupWindowControls()

def setupWindowControls (   self,
  winCtrl = None 
)

◆ showCameraFrustum()

def showCameraFrustum (   self)

◆ shutdown()

def shutdown (   self)

◆ silenceInput()

def silenceInput (   self)
This is a heavy-handed way of temporarily turning off
all inputs.  Bring them back with reviveInput().

◆ spawnTkLoop()

def spawnTkLoop (   self)
Call this method to hand the main loop over to Tkinter.
This sets up a timer callback so that Panda still gets
updated, but Tkinter owns the main loop (which seems to make
it happier than the other way around). 

◆ spawnWxLoop()

def spawnWxLoop (   self)
Call this method to hand the main loop over to wxPython.
This sets up a wxTimer callback so that Panda still gets
updated, but wxPython owns the main loop (which seems to make
it happier than the other way around). 

◆ startDirect()

def startDirect (   self,
  fWantDirect = 1,
  fWantTk = 1,
  fWantWx = 0 
)

◆ startTk()

def startTk (   self,
  fWantTk = True 
)

◆ startWx()

def startWx (   self,
  fWantWx = True 
)

◆ textureOff()

def textureOff (   self)

◆ textureOn()

def textureOn (   self)

◆ tkRun()

def tkRun (   self)
This method replaces base.run() after we have called
spawnTkLoop().  Since at this point Tkinter now owns the main
loop, this method is a call to tkRoot.mainloop(). 

◆ toggleBackface()

def toggleBackface (   self)

◆ toggleParticles()

def toggleParticles (   self)

◆ toggleShowVertices()

def toggleShowVertices (   self)
Toggles a mode that visualizes vertex density per screen
area. 

◆ toggleTexMem()

def toggleTexMem (   self)
Toggles a handy texture memory watcher.  See TexMemWatcher
for more information. 

◆ toggleTexture()

def toggleTexture (   self)

◆ toggleWireframe()

def toggleWireframe (   self)

◆ updateManagers()

def updateManagers (   self,
  state 
)

◆ useDrive()

def useDrive (   self)
Switch mouse action to drive mode

◆ userExit()

def userExit (   self)

◆ useTrackball()

def useTrackball (   self)
Switch mouse action to trackball mode

◆ windowEvent()

def windowEvent (   self,
  win 
)

◆ wireframeOff()

def wireframeOff (   self)

◆ wireframeOn()

def wireframeOn (   self)

◆ wxRun()

def wxRun (   self)
This method replaces base.run() after we have called
spawnWxLoop().  Since at this point wxPython now owns the main
loop, this method is a call to wxApp.MainLoop(). 

Member Data Documentation

◆ a2dBackground

a2dBackground

◆ a2dBottom

a2dBottom

The Z position of the bottom border of the aspect2d screen.

◆ a2dBottomCenter

a2dBottomCenter

◆ a2dBottomCenterNs

a2dBottomCenterNs

◆ a2dBottomLeft

a2dBottomLeft

◆ a2dBottomLeftNs

a2dBottomLeftNs

◆ a2dBottomRight

a2dBottomRight

◆ a2dBottomRightNs

a2dBottomRightNs

◆ a2dLeft

a2dLeft

The X position of the left border of the aspect2d screen.

◆ a2dLeftCenter

a2dLeftCenter

◆ a2dLeftCenterNs

a2dLeftCenterNs

◆ a2dpBottom

a2dpBottom

The Z position of the bottom border of the aspect2dp screen.

◆ a2dpBottomCenter

a2dpBottomCenter

◆ a2dpBottomLeft

a2dpBottomLeft

◆ a2dpBottomRight

a2dpBottomRight

◆ a2dpLeft

a2dpLeft

The X position of the left border of the aspect2dp screen.

◆ a2dpLeftCenter

a2dpLeftCenter

◆ a2dpRight

a2dpRight

The X position of the right border of the aspect2dp screen.

◆ a2dpRightCenter

a2dpRightCenter

◆ a2dpTop

a2dpTop

The Z position of the top border of the aspect2dp screen.

◆ a2dpTopCenter

a2dpTopCenter

◆ a2dpTopLeft

a2dpTopLeft

◆ a2dpTopRight

a2dpTopRight

◆ a2dRight

a2dRight

The X position of the right border of the aspect2d screen.

◆ a2dRightCenter

a2dRightCenter

◆ a2dRightCenterNs

a2dRightCenterNs

◆ a2dTop

a2dTop

The Z position of the top border of the aspect2d screen.

◆ a2dTopCenter

a2dTopCenter

◆ a2dTopCenterNs

a2dTopCenterNs

◆ a2dTopLeft

a2dTopLeft

◆ a2dTopLeftNs

a2dTopLeftNs

◆ a2dTopRight

a2dTopRight

◆ a2dTopRightNs

a2dTopRightNs

◆ add_angular_integrator

def add_angular_integrator = addAngularIntegrator
static

◆ add_sfx_manager

def add_sfx_manager = addSfxManager
static

◆ app_runner

app_runner

◆ AppHasAudioFocus

AppHasAudioFocus

◆ appRunner

appRunner

This contains the global appRunner instance, as imported from AppRunnerGlobal.

This will be None if we are not running in the runtime environment (ie. from a .p3d file).

◆ appTrav

appTrav

◆ aspect2d

aspect2d

The normal 2-d DisplayRegion has an aspect ratio that matches the window, but its coordinate system is square.

This means anything we parent to render2d gets stretched. For things where that makes a difference, we set up aspect2d, which scales things back to the right aspect ratio along the X axis (Z is still from -1 to 1)

◆ aspect2dp

aspect2dp

The normal 2-d DisplayRegion has an aspect ratio that matches the window, but its coordinate system is square.

This means anything we parent to render2dp gets stretched. For things where that makes a difference, we set up aspect2dp, which scales things back to the right aspect ratio along the X axis (Z is still from -1 to 1)

◆ attach_input_device

def attach_input_device = attachInputDevice
static

◆ backface_culling_off

def backface_culling_off = backfaceCullingOff
static

◆ backface_culling_on

def backface_culling_on = backfaceCullingOn
static

◆ backfaceCullingEnabled

backfaceCullingEnabled

◆ bboard

bboard

The global bulletin board, as imported from BulletinBoardGlobal.

◆ bufferViewer

bufferViewer

◆ buttonThrowers

buttonThrowers

◆ cam

cam

This is a NodePath pointing to the Camera object set up for the 3D scene.

This is usually a child of self.camera.

◆ cam2d

cam2d

◆ cam2dp

cam2dp

◆ camera

camera

This is the NodePath that should be used to manipulate the camera.

This is the node to which the default camera is attached.

◆ camera2d

camera2d

◆ camera2dp

camera2dp

◆ camFrustumVis

camFrustumVis

◆ camLens

camLens

Convenience accessor for base.camNode.get_lens()

◆ camList

camList

This is a list of all cameras created with makeCamera, including base.cam.

◆ camNode

camNode

Convenience accessor for base.cam.node()

◆ change_mouse_interface

def change_mouse_interface = changeMouseInterface
static

◆ clientSleep

clientSleep

◆ close_window

def close_window = closeWindow
static

◆ cluster

cluster

◆ clusterSyncFlag

clusterSyncFlag

◆ config

config = DConfig
static

◆ create_stats

def create_stats = createStats
static

◆ cTrav

cTrav

This is a placeholder for a CollisionTraverser.

If someone stores a CollisionTraverser pointer here, we'll traverse it in the collisionLoop task.

◆ cTravStack

cTravStack

◆ dataRoot

dataRoot

◆ dataRootNode

dataRootNode

◆ debugRunningMultiplier

debugRunningMultiplier

◆ detach_input_device

def detach_input_device = detachInputDevice
static

◆ deviceButtonThrowers

deviceButtonThrowers

◆ devices

devices

This is the global input device manager, which keeps track of connected input devices.

◆ dgTrav

dgTrav

◆ direct

direct

◆ disable_all_audio

def disable_all_audio = disableAllAudio
static

◆ disable_mouse

def disable_mouse = disableMouse
static

◆ disable_particles

def disable_particles = disableParticles
static

◆ drive

drive

◆ enable_all_audio

def enable_all_audio = enableAllAudio
static

◆ enable_mouse

def enable_mouse = enableMouse
static

◆ enable_music

def enable_music = enableMusic
static

◆ enable_particles

def enable_particles = enableParticles
static

◆ enable_software_mouse_pointer

def enable_software_mouse_pointer = enableSoftwareMousePointer
static

◆ enable_sound_effects

def enable_sound_effects = enableSoundEffects
static

◆ eventMgr

eventMgr

The global event manager, as imported from EventManagerGlobal.

◆ exitFunc

exitFunc

Fill this in with a function to invoke when the user "exits" the program by closing the main window.

◆ finalExitCallbacks

finalExitCallbacks

Add final-exit callbacks to this list.

These will be called when sys.exit() is called, after Panda has unloaded, and just before Python is about to shut down.

◆ frameRateMeter

frameRateMeter

◆ get_aspect_ratio

def get_aspect_ratio = getAspectRatio
static

◆ get_background_color

def get_background_color = getBackgroundColor
static

◆ get_size

def get_size = getSize
static

◆ graphics_engine

graphics_engine

◆ graphicsEngine

graphicsEngine

The global graphics engine, ie.

GraphicsEngine.getGlobalPtr()

◆ hidden

hidden

◆ init_shadow_trav

def init_shadow_trav = initShadowTrav
static

◆ jobMgr

jobMgr

The global job manager, as imported from JobManagerGlobal.

◆ loader

loader

◆ main_dir

main_dir

◆ mainDir

mainDir

The directory containing the main Python file of this application.

◆ mainWinForeground

mainWinForeground

◆ mainWinMinimized

mainWinMinimized

◆ make_all_pipes

def make_all_pipes = makeAllPipes
static

◆ make_camera

def make_camera = makeCamera
static

◆ make_camera2d

def make_camera2d = makeCamera2d
static

◆ make_camera2dp

def make_camera2dp = makeCamera2dp
static

◆ make_default_pipe

def make_default_pipe = makeDefaultPipe
static

◆ make_module_pipe

def make_module_pipe = makeModulePipe
static

◆ messenger

messenger

The global messenger, as imported from MessengerGlobal.

◆ mouse2cam

mouse2cam

◆ mouseInterface

mouseInterface

◆ mouseInterfaceNode

mouseInterfaceNode

◆ mouseWatcher

mouseWatcher

◆ mouseWatcherNode

mouseWatcherNode

◆ multiClientSleep

multiClientSleep

◆ musicActive

musicActive

◆ musicManager

musicManager

◆ musicManagerIsValid

musicManagerIsValid

◆ nextWindowIndex

nextWindowIndex

◆ notify

notify = directNotify.newCategory("ShowBase")
static

◆ onScreenDebug

onScreenDebug

◆ oobe2cam

oobe2cam

◆ oobe_cull

def oobe_cull = oobeCull
static

◆ oobeCamera

oobeCamera

◆ oobeCameraTrackball

oobeCameraTrackball

◆ oobeCullFrustum

oobeCullFrustum

◆ oobeLens

oobeLens

◆ oobeMode

oobeMode

◆ oobeTrackball

oobeTrackball

◆ oobeVis

oobeVis

◆ open_default_window

def open_default_window = openDefaultWindow
static

◆ open_main_window

def open_main_window = openMainWindow
static

◆ open_window

def open_window = openWindow
static

◆ particleMgr

particleMgr

Particle manager.

◆ particleMgrEnabled

particleMgrEnabled

◆ physicsMgr

physicsMgr

Physics manager.

◆ physicsMgrAngular

physicsMgrAngular

◆ physicsMgrEnabled

physicsMgrEnabled

◆ pipe

pipe

◆ pipeList

pipeList

◆ pixel2d

pixel2d

This special root, pixel2d, uses units in pixels that are relative to the window.

The upperleft corner of the window is (0, 0), the lowerleft corner is (xsize, -ysize), in this coordinate system.

◆ pixel2dp

pixel2dp

This special root, pixel2d, uses units in pixels that are relative to the window.

The upperleft corner of the window is (0, 0), the lowerleft corner is (xsize, -ysize), in this coordinate system.

◆ pointerWatcherNodes

pointerWatcherNodes

◆ recorder

recorder

◆ remove_camera_frustum

def remove_camera_frustum = removeCameraFrustum
static

◆ render

render

This is the root of the 3-D scene graph.

◆ render2d

render2d

This is the root of the 2-D scene graph.

◆ render2dp

render2dp

◆ requireWindow

requireWindow

◆ revive_input

def revive_input = reviveInput
static

◆ run

run

◆ save_cube_map

def save_cube_map = saveCubeMap
static

◆ save_sphere_map

def save_sphere_map = saveSphereMap
static

◆ sceneGraphAnalyzerMeter

sceneGraphAnalyzerMeter

◆ screenshotExtension

screenshotExtension

◆ set_aspect_ratio

def set_aspect_ratio = setAspectRatio
static

◆ set_background_color

def set_background_color = setBackgroundColor
static

◆ set_frame_rate_meter

def set_frame_rate_meter = setFrameRateMeter
static

◆ set_mouse_on_node

def set_mouse_on_node = setMouseOnNode
static

◆ set_scene_graph_analyzer_meter

def set_scene_graph_analyzer_meter = setSceneGraphAnalyzerMeter
static

◆ set_sleep

def set_sleep = setSleep
static

◆ setup_data_graph

def setup_data_graph = setupDataGraph
static

◆ setup_mouse

def setup_mouse = setupMouse
static

◆ setup_mouse_cb

def setup_mouse_cb = setupMouseCB
static

◆ setup_render

def setup_render = setupRender
static

◆ setup_render2d

def setup_render2d = setupRender2d
static

◆ setup_render2dp

def setup_render2dp = setupRender2dp
static

◆ setup_window_controls

def setup_window_controls = setupWindowControls
static

◆ sfxActive

sfxActive

◆ sfxManagerIsValidList

sfxManagerIsValidList

◆ sfxManagerList

sfxManagerList

◆ sfxPlayer

sfxPlayer

◆ shadowTrav

shadowTrav

◆ show_camera_frustum

def show_camera_frustum = showCameraFrustum
static

◆ showVertices

showVertices

◆ silence_input

def silence_input = silenceInput
static

◆ start_direct

def start_direct = startDirect
static

◆ start_tk

def start_tk = startTk
static

◆ start_wx

def start_wx = startWx
static

◆ task_mgr

task_mgr

◆ taskMgr

taskMgr

The global task manager, as imported from TaskManagerGlobal.

◆ texmem

texmem

◆ texture_off

def texture_off = textureOff
static

◆ texture_on

def texture_on = textureOn
static

◆ textureEnabled

textureEnabled

◆ timeButtonThrower

timeButtonThrower

A special ButtonThrower to generate keyboard events and include the time from the OS.

This is separate only to support legacy code that did not expect a time parameter; it will eventually be folded into the normal ButtonThrower, above.

◆ tkDelay

tkDelay

◆ tkRoot

tkRoot

◆ tkRootCreated

tkRootCreated

◆ toggle_backface

def toggle_backface = toggleBackface
static

◆ toggle_particles

def toggle_particles = toggleParticles
static

◆ toggle_show_vertices

def toggle_show_vertices = toggleShowVertices
static

◆ toggle_tex_mem

def toggle_tex_mem = toggleTexMem
static

◆ toggle_texture

def toggle_texture = toggleTexture
static

◆ toggle_wireframe

def toggle_wireframe = toggleWireframe
static

◆ trackball

trackball

◆ transitions

transitions

◆ use_drive

def use_drive = useDrive
static

◆ use_trackball

def use_trackball = useTrackball
static

◆ wantDirect

wantDirect

◆ wantFog

wantFog

◆ wantRender2dp

wantRender2dp

◆ wantStats

wantStats

◆ wantTk

wantTk

◆ wantWx

wantWx

◆ win

win

This is the main, or only window; see winList for a list of all windows.

◆ winControls

winControls

◆ windowType

windowType

This is set to the value of the window-type config variable, but may optionally be overridden in the Showbase constructor.

Should either be 'onscreen' (the default), 'offscreen' or 'none'.

◆ winList

winList

◆ wireframe_off

def wireframe_off = wireframeOff
static

◆ wireframe_on

def wireframe_on = wireframeOn
static

◆ wireframeEnabled

wireframeEnabled

◆ wxApp

wxApp

This is used to store the wx.Application object used when want-wx is set or base.startWx() is called.

◆ wxAppCreated

wxAppCreated

◆ wxTimer

wxTimer