cut scene video

What is the easiest way to just play cut scene video of an avi file during the game?

Should I create a plane model and do the render to texture with this movie avi file?

Use the CardMaker class to create a flat polygon, and apply the avi to the polygon as a texture. Then parent the polygon to render2d or aspect2d.

You might want to use to ensure the movie starts when you want it to, and then set a timeout (e.g. with taskMgr.doMethodLater()) to move on when the movie is over.


Thank you.

But it will be no sound then.
I would like to play a cut scene video with movie and SOUND from an avi file

I found out that using DirectLabel. It can show the avi movie with no sound like this.

splashScreen = DirectLabel(parent=render2d,image=“movie.avi”, )

Hmm, you will probably need to extract the sound into a separate file, and play the sound file at the same time you play the video. Panda’s video texture class doesn’t currently have support for sound.


hmmm… the linux guy is having a question again ^^
Once upon a time…
there was a system that plays AVIs only on Windows based system. I suppose it was the texture based playback - is that still the case?

Regards, Bigfoot29

Panda now uses the ffmpeg library to play AVI’s (or mpeg’s, or any of a variety of movie formats), and this library appears to work well on both Linux and Windows.


I can vouch for the video/audio splitting technique.

We did a world called “Cast the First Stone” in the ETC’s Building Virtual Worlds class. The majority of the onscreen action was a sequence of AVI textures of a monster, which were playing on a “background” polygon (i.e. setDepthWrite was off, the polygon was parented to the camera). Players could attack the monster, which then caused an AVI texture and corresponding audio clip to be chosen by a FSM.

The Panda engine does a fine job of keeping the texture and sound synchronized (assuming you start both on the same frame), and since the AVI was pre-rendered, we could take advantage of Maya’s full lighting, shading, and materials models to get ourselves a very funky-looking monster. I’d definitely recommend the technique in situations where you have the memory (RAM and harddisk) to support the AVI content and you can pre-generate your visuals.

Take care,

I need to set up an intro too and i have no problems there but I’m having a big problem with taskMgr.doMethodLater
I don’t understand how to use it :slight_smile:
I have read everything in the manual and I have tried many different approaches but I either get an error (mostly about number of arguments - fixable) either it doesn’t make the task wait at all.
Can anyone give me a short example of propper usage?


First of all, you’ll want a task-like function, which means either:

def myFunc(task):
print “I was called later!”


class myClass(object):
def myFunc(self,task):
print “I was called later!”

then just call:




The only other complication is if you want to pass arguments. In that
case, panda does not allow you to pass the task into the function. so…

def myNewFunc(val):
print "value is "+str(val)

taskMgr.doMethodLater(3, myNewFunc, “new func” , extraArgs=[5])

Will call myNewFunc after 3 seconds, and pass 5 to val

Thanks a lot, I finally did it :smiley: