return filename from base.screenshot(), etc.

This commit is contained in:
David Rose 2006-06-15 00:17:55 +00:00
parent 0b93deaa03
commit 2b1941a12b

View File

@ -1677,7 +1677,11 @@ class ShowBase(DirectObject.DirectObject):
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. """
mark ('#') character.
The return value is the filename if successful, or None if
there is a problem.
"""
if source == None:
source = self.win
@ -1695,10 +1699,12 @@ class ShowBase(DirectObject.DirectObject):
else:
saved = source.saveScreenshot(filename, imageComment)
# Announce to anybody that a screenshot has been taken
messenger.send('screenshot', [filename])
if saved:
# Announce to anybody that a screenshot has been taken
messenger.send('screenshot', [filename])
return filename
return saved
return None
def saveCubeMap(self, namePrefix = 'cube_map_#.png',
defaultFilename = 0, source = None,
@ -1716,7 +1722,11 @@ class ShowBase(DirectObject.DirectObject):
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."""
if source is a DisplayRegion, or base.camera otherwise.
The return value is the filename if successful, or None if
there is a problem.
"""
if source == None:
source = base.win
@ -1770,6 +1780,9 @@ class ShowBase(DirectObject.DirectObject):
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.
"""
if source == None:
source = base.win