Recording scene programs as an animated gif image
abcabc last edited by
Here is the code to record scene programs as an animated gif image.
The program calls "draw_snapshot" method of SceneView to take snapshots of the node at each update call and coverts them to a gif file using images2gif module. Creating gif file is performed in a background thread and hence it does not affect the performance. The "draw_snapshot" method is very costly and it slows down the frame rate considerably. It may not be ok for recording games but for creating animated scenes particularly with shader could be useful. May be there is a faster way to capture data using objc_util. (Note that codea has a facility to record games.)
There has been discussion before on this.
The code works only with 2.7. images2gif module gives problem with 3.5.
I hope this is useful.