animated texture

Hi everyone…I’ve been working on setting up an interactive storytelling kiosk but I had to drop processing because I’m animating nearly 2400png’s (3 scenes…)

In panda, i know how to do do texture cards:

egg-texture-cards tree.egg -fps 30 AA
_00000.png AA_00001.png AA_00002.png AA_00003.png AA_00004.png AA_00005.png AA_0
0006.png AA_00007.png AA_00008.png AA_00009.png AA_00010.png AA_00011.png … (601 images!!!)

Is there any other way to do this through the texture cards or do I have to code a sequence?

If that’s the case, anyone has an example I can reffer to? The goal is to trigger the different animations by pressing different keys (but 2 animations can be triggered simultaneously :wink:)

Thank you so much


forgot to mention, i tried:

egg-texture-cards -o tree.egg -fps 30 AA_*.png but it says that some textures couldn’t be found…even though they are all there --’

Hmm, I don’t know why egg-texture-cards would fail after a certain number of cards, but maybe the operating system has cut off the command line? Or maybe there’s a file pointer leak in egg-texture-cards and it fails to read additional files after opening a certain number?

You can, of course, write a simple Python script to generate the egg file that egg-texture-cards would generate. Or you can do it at runtime, by generating a bunch of cards and putting them all under a SequenceNode, which is the same thing that egg-texture-cards ends up with anyway (you can experiment with a fewer number of textures to see what egg-texture-cards is supposed to do).

But with that many textures, you might be better off creating a movie file, for instance with QuickTime pro or some other software tools, to load up all of those images and make a .mov or .avi out of them. Then you can simply load that one file in Panda and apply it to a card, which might give better performance.


Thank you David, for the reply!

As for movies, I need to keep the transparency since I want to be able to load 2 sequences at once so I have to stick to the script I guess…

I’ll try and I’ll let you know if it worked

I don’t know what you mean.

Movies can support transparency (if you mean you want to have an animated alpha channel). Few movie file formats support alpha, but you can load an RGB movie file and a separate grayscale movie file together as a single four-channel movie in Panda, using the two-parameter form of loadTexture(); this is described in the manual.

As to loading and playing two movies at once, there’s absolutely no reason you can’t do this with movies as well as egg-texture-cards sequences.

I worry that with the egg-texture-cards approach, though, you will run into performance issues with being unable to load and decode each frame from disk fast enough to achieve 30fps. It might work, but I’ve never tried it.


Well that’s definitely good to know!

I did managed to create the egg-texture-cards through cygwin and it runs quite well except for the loading time but i’ll try your suggestion!