oobe support

This commit is contained in:
Joe Shochet 2002-09-12 16:37:18 +00:00
parent 4444891ba3
commit 443dae5523

View File

@ -767,27 +767,33 @@ class DisplayRegionList(PandaObject):
self.displayRegionLookup = {} self.displayRegionLookup = {}
i = 0 i = 0
for cameraGroup in base.cameraList: # Things are funky if we are oobe
# This is following the old way of setting up if (hasattr(base, 'oobeMode') and base.oobeMode):
# display regions. A display region is set up for # assume we only have one cam at this point
# each camera node in the scene graph. This was done self.displayRegionList.append(DisplayRegionContext(base.win, base.cam, base.groupList[0]))
# so that only display regions in the scene graph are else:
# considered. The right way to do this is to set up for cameraGroup in base.cameraList:
# a display region for each real display region, and then # This is following the old way of setting up
# keep track of which are currently active (e.g. use a flag) # display regions. A display region is set up for
# processing only them. # each camera node in the scene graph. This was done
camList=cameraGroup.findAllMatches('**/+Camera') # so that only display regions in the scene graph are
for cameraIndex in range(camList.getNumPaths()): # considered. The right way to do this is to set up
camera = camList[cameraIndex] # a display region for each real display region, and then
if camera.getName()=='<noname>': # keep track of which are currently active (e.g. use a flag)
camera.setName('Camera%d' % cameraIndex) # processing only them.
group = base.groupList[cameraIndex] camList=cameraGroup.findAllMatches('**/+Camera')
self.displayRegionList.append( for cameraIndex in range(camList.getNumPaths()):
DisplayRegionContext(base.win, camera = camList[cameraIndex]
camera,group)) if camera.getName()=='<noname>':
if camera.getName()!='<noname>' or len(camera.getName())==0: camera.setName('Camera%d' % cameraIndex)
self.displayRegionLookup[camera.getName()]=i group = base.groupList[cameraIndex]
i = i + 1 self.displayRegionList.append(
DisplayRegionContext(base.win,
camera,group))
if camera.getName()!='<noname>' or len(camera.getName())==0:
self.displayRegionLookup[camera.getName()]=i
i = i + 1
self.accept("CamChange",self.camUpdate) self.accept("CamChange",self.camUpdate)
self.accept("DIRECT-mouse1",self.mouseUpdate) self.accept("DIRECT-mouse1",self.mouseUpdate)
self.accept("DIRECT-mouse2",self.mouseUpdate) self.accept("DIRECT-mouse2",self.mouseUpdate)