16-02-2006 10:00:50

Hi folks,

i want to write my frames to single .png Files. I got the hint to use the "writeContentsToFile" method from "RenderTarget". Can you please help with the implementation ? For example in the "SkeletalAnimationDemo.py" ( ogre_demos folder ). Excuse me, but i'm not that firm in object-oriented programming languages, but working hard on it :wink:

( of course in Python :wink: )

ciao and thanks,


17-02-2006 02:45:27

To capture a screenshot from the SkeletalAnimationDemo press 'PrintScreen' on your keyboard.

The code is in SampleFrameWork.py's FrameListener class:

def frameStarted(self, frameEvent):
if not self._processUnbufferedKeyInput(frameEvent):
return False

def _processUnbufferedKeyInput(self, frameEvent):
if self._isToggleKeyDown(ogre.KC_SYSRQ, 0.5):
path = 'screenshot_%d.png' % self.numScreenShots
self.numScreenShots += 1
self.renderWindow.debugText = 'screenshot taken: ' + path

and called from SkeletalAnimationFrameListener:

def frameStarted(self, frameEvent):
--> return sf.FrameListener.frameStarted(self, frameEvent)


17-02-2006 05:59:29

I don't believe "WriteContentsToFile" if fully implemented in the Ogre 1.0.7 API you should check in the Change notes for the Dagon release of Ogre, because I am not sure whether it was RenderTargets or RenderTextures that got full support of "WriteContentsToFile".


17-02-2006 07:28:20

Thanks dermont !


k game_ender i'll have a look on it. But for now i'm working with 1.0.6 for testing reasons.


17-02-2006 12:48:02

I just tried the Skeletal animation demo and it worked fine with PyOgre 1.0.6. Thanks a lot, dermont!! (To the rescue once again.) :)