# ShowBase

from direct.showbase.ShowBase import ShowBase

## Inheritance:

ShowBase:

## Methods of ShowBase:

__audioLoop
__collisionLoop
__dataLoop
__doStartDirect
__igLoop
__init__
__ivalLoop
__oobeButton
__resetPrevTransform
__shadowCollisionLoop
__windowEvent
_movieTask
addAngularIntegrator
addSfxManager
backfaceCullingOff
backfaceCullingOn
changeMouseInterface
closeWindow
createBaseAudioManagers
createStats
destroy
disableAllAudio
disableMouse
disableParticles
enableAllAudio
enableMouse
enableMusic
enableParticles
enableSoftwareMousePointer
enableSoundEffects
exitfunc
finalizeExit
getAlt
getAspectRatio
getBackgroundColor
getControl
getExitErrorCode
getMeta
getShift
initShadowTrav
isMainWindowOpen
isParticleMgrEnabled
isPhysicsMgrEnabled
loadMusic
loadSfx
makeAllPipes
makeCamera
makeCamera2d
makeCamera2dp
makeDefaultPipe
makeModulePipe
movie
oobe
oobeCull
openDefaultWindow
openMainWindow
openWindow
playMusic
playSfx
popCTrav
printEnvDebugInfo
pushCTrav
removeCameraFrustum
restart
reviveInput
run
saveCubeMap
saveSphereMap
screenshot
SetAllSfxEnables
setBackgroundColor
setFrameRateMeter
setMouseOnNode
setSleep
setupDataGraph
setupMouse
setupRender
setupRender2d
setupRender2dp
setupWindowControls
showCameraFrustum
shutdown
silenceInput
sleepCycleTask
startDirect
startTk
startWx
textureOff
textureOn
toggleBackface
toggleParticles
toggleShowVertices
toggleTexMem
toggleTexture
toggleWireframe
updateManagers
useDrive
userExit
useTrackball
wireframeOff
wireframeOn

__audioLoop def __audioLoop(self, state) Undocumented function.

__collisionLoop def __collisionLoop(self, state) Undocumented function.

__dataLoop def __dataLoop(self, state) Undocumented function.

__doStartDirect def __doStartDirect(self) Undocumented function.

__igLoop def __igLoop(self, state) Undocumented function.

__init__ def __init__(self) Undocumented function.

__ivalLoop def __ivalLoop(self, state) Undocumented function.

__oobeButton def __oobeButton(self, suffix, button) Undocumented function.

__resetPrevTransform def __resetPrevTransform(self, state) Undocumented function.

__shadowCollisionLoop def __shadowCollisionLoop(self, state) Undocumented function.

__windowEvent def __windowEvent(self, win) Undocumented function.

_movieTask def _movieTask(self, state) Undocumented function.

addAngularIntegrator def addAngularIntegrator(self) Undocumented function.

addSfxManager def addSfxManager(self, extraSfxManager) Undocumented function.

backfaceCullingOff def backfaceCullingOff(self) Undocumented function.

backfaceCullingOn def backfaceCullingOn(self) Undocumented function.

changeMouseInterface def changeMouseInterface(self, changeTo) Switch mouse action

closeWindow def closeWindow(self, win, keepCamera=0) 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) Undocumented function.

createStats def createStats(self, hostname=None, port=None) Undocumented function.

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.

disableAllAudio def disableAllAudio(self) Undocumented function.

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) Undocumented function.

enableAllAudio def enableAllAudio(self) Undocumented function.

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

enableMusic def enableMusic(self, bEnableMusic) Undocumented function.

enableParticles def enableParticles(self) Undocumented function.

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) Undocumented function.

exitfunc def exitfunc(self) This should be assigned to sys.exitfunc to be called just before Python shutdown. It guarantees that the Panda window is closed cleanly, so that we free system resources, restore the desktop and keyboard functionality, etc.

finalizeExit def finalizeExit(self) Undocumented function.

getAlt def getAlt(self) Undocumented function.

getAspectRatio def getAspectRatio(self, win=None) Undocumented function.

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) Undocumented function.

getExitErrorCode def getExitErrorCode(self) Undocumented function.

getMeta def getMeta(self) Undocumented function.

getShift def getShift(self) Undocumented function.

initShadowTrav def initShadowTrav(self) Undocumented function.

isMainWindowOpen def isMainWindowOpen(self) Undocumented function.

isParticleMgrEnabled def isParticleMgrEnabled(self) Undocumented function.

isPhysicsMgrEnabled def isPhysicsMgrEnabled(self) Undocumented function.

loadMusic def loadMusic(self, name) Undocumented function.

loadSfx def loadSfx(self, name) Undocumented function.

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.

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=True) 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.

oobe def oobe(self) 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) 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) Undocumented function.

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, pipe=None, gsg=None, type=None, name=None, size=None, aspectRatio=None, makeCamera=1, keepCamera=0, scene=None, stereo=None, rawmice=0) Creates a window and adds it to the list of windows that are to be updated every frame.

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

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

popCTrav def popCTrav(self) Undocumented function.

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) Undocumented function.

removeCameraFrustum def removeCameraFrustum(self) Undocumented function.

restart def restart(self) Undocumented function.

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

run def run(self) Undocumented function.

saveCubeMap def saveCubeMap(self, namePrefix='cube_map_#.png', defaultFilename=0, source=None, camera=None, size=128, cameraMask=PandaNode.getAllCameraMask()) 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) 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) Undocumented function.

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) Undocumented function.

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) 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.

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) Undocumented function.

showCameraFrustum def showCameraFrustum(self) Undocumented function.

shutdown def shutdown(self) Undocumented function.

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

sleepCycleTask def sleepCycleTask(self, task) Undocumented function.

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

startTk def startTk(self, fWantTk=1) Undocumented function.

startWx def startWx(self, fWantWx=1) Undocumented function.

textureOff def textureOff(self) Undocumented function.

textureOn def textureOn(self) Undocumented function.

toggleBackface def toggleBackface(self) Undocumented function.

toggleParticles def toggleParticles(self) Undocumented function.

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) Undocumented function.

toggleWireframe def toggleWireframe(self) Undocumented function.

updateManagers def updateManagers(self, state) Undocumented function.

useDrive def useDrive(self) Switch mouse action to drive mode

userExit def userExit(self) Undocumented function.

useTrackball def useTrackball(self) Switch mouse action to trackball mode

wireframeOff def wireframeOff(self) Undocumented function.

wireframeOn def wireframeOn(self) Undocumented function.