panda3d.core.MovieTexture

from panda3d.core import MovieTexture
class MovieTexture

Bases: Texture

A texture that fetches video frames from an underlying object of class Movie.

Inheritance diagram

Inheritance diagram of MovieTexture

__init__(video: MovieVideo) → None

Creates a texture playing the specified movie.

__init__(name: str) → None

Creates a blank movie texture. Movies must be added using do_read_one or do_load_one.

getVideoLength() → float

Returns the length of the video.

getVideoWidth() → int

Returns the width in texels of the source video stream. This is not necessarily the width of the actual texture, since the texture may have been expanded to raise it to a power of 2.

getVideoHeight() → int

Returns the height in texels of the source video stream. This is not necessarily the height of the actual texture, since the texture may have been expanded to raise it to a power of 2.

getColorCursor(page: int) → MovieVideoCursor

Returns the MovieVideoCursor that is feeding the color channels for the indicated page, where 0 <= page < get_num_pages().

Return type

MovieVideoCursor

getAlphaCursor(page: int) → MovieVideoCursor

Returns the MovieVideoCursor that is feeding the alpha channel for the indicated page, where 0 <= page < get_num_pages().

Return type

MovieVideoCursor

restart() → None

Start playing the movie from where it was last paused. Has no effect if the movie is not paused, or if the movie’s cursor is already at the end.

stop() → None

Stops a currently playing or looping movie right where it is. The movie’s cursor remains frozen at the point where it was stopped.

play() → None

Plays the movie from the beginning.

setTime(t: float) → None

Sets the movie’s cursor.

getTime() → float

Returns the current value of the movie’s cursor. If the movie’s loop count is greater than one, then its length is effectively multiplied for the purposes of this function. In other words, the return value will be in the range 0.0 to (length * loopcount).

setLoop(enable: bool) → None

If true, sets the movie’s loop count to 1 billion. If false, sets the movie’s loop count to one.

getLoop() → bool

Returns true if the movie’s loop count is not equal to one.

setLoopCount(count: int) → None

Sets the movie’s loop count to the desired value.

getLoopCount() → int

Returns the movie’s loop count.

setPlayRate(play_rate: float) → None

Sets the movie’s play-rate. This is the speed at which the movie’s cursor advances. The default is to advance 1.0 movie-seconds per real-time second.

getPlayRate() → float

Gets the movie’s play-rate.

isPlaying() → bool

Returns true if the movie’s cursor is advancing.

synchronizeTo(sound: AudioSound) → None

Synchronize this texture to a sound. Typically, you would load the texture and the sound from the same AVI file.

unsynchronize() → None

Stop synchronizing with a sound.

static getClassType() → TypeHandle
Return type

TypeHandle

property video_length

Returns the length of the video.

Return type

float

property video_width

Returns the width in texels of the source video stream. This is not necessarily the width of the actual texture, since the texture may have been expanded to raise it to a power of 2.

Return type

int

property video_height

Returns the height in texels of the source video stream. This is not necessarily the height of the actual texture, since the texture may have been expanded to raise it to a power of 2.

Return type

int

property time
Getter

Returns the current value of the movie’s cursor. If the movie’s loop count is greater than one, then its length is effectively multiplied for the purposes of this function. In other words, the return value will be in the range 0.0 to (length * loopcount).

Setter

Sets the movie’s cursor.

Return type

float

property loop
Getter

Returns true if the movie’s loop count is not equal to one.

Setter

If true, sets the movie’s loop count to 1 billion. If false, sets the movie’s loop count to one.

Return type

bool

property loop_count
Getter

Returns the movie’s loop count.

Setter

Sets the movie’s loop count to the desired value.

Return type

int

property play_rate
Getter

Gets the movie’s play-rate.

Setter

Sets the movie’s play-rate. This is the speed at which the movie’s cursor advances. The default is to advance 1.0 movie-seconds per real-time second.

Return type

float

property playing

Returns true if the movie’s cursor is advancing.

Return type

bool