mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
start movie on the next frame
This commit is contained in:
parent
0f01f99d2a
commit
4ceb6ccb17
@ -1725,13 +1725,14 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
globalClock.setMode(ClockObject.MNonRealTime)
|
globalClock.setMode(ClockObject.MNonRealTime)
|
||||||
globalClock.setDt(1.0/float(fps))
|
globalClock.setDt(1.0/float(fps))
|
||||||
t = taskMgr.add(self._movieTask, namePrefix + '_task')
|
t = taskMgr.add(self._movieTask, namePrefix + '_task')
|
||||||
t.frameIndex = 1
|
t.frameIndex = 0 # Frame 0 is not captured.
|
||||||
t.numFrames = int(duration * fps)
|
t.numFrames = int(duration * fps)
|
||||||
t.source = source
|
t.source = source
|
||||||
t.outputString = namePrefix + '_%0' + `sd` + 'd.' + format
|
t.outputString = namePrefix + '_%0' + `sd` + 'd.' + format
|
||||||
t.uponDeath = lambda state: globalClock.setMode(ClockObject.MNormal)
|
t.uponDeath = lambda state: globalClock.setMode(ClockObject.MNormal)
|
||||||
|
|
||||||
def _movieTask(self, state):
|
def _movieTask(self, state):
|
||||||
|
if state.frameIndex != 0:
|
||||||
frameName = state.outputString % state.frameIndex
|
frameName = state.outputString % state.frameIndex
|
||||||
self.notify.info("Capturing frame: " + frameName)
|
self.notify.info("Capturing frame: " + frameName)
|
||||||
self.screenshot(namePrefix = frameName, defaultFilename = 0,
|
self.screenshot(namePrefix = frameName, defaultFilename = 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user