Movie object

The Movie object is used to store values and attributes associated with a movie file. Upon creation, the Movie object is added to the session.movies repository.

This page discusses:

Access

import animation
session.movies[name]

Movie(...)

This method creates a Movie object from the contents of the specified file.

Path

session.Movie

Required arguments

name

A String specifying the repository name for the movie.

fileName

A String specifying the file from which the movie is to be read. The file extension must be specified and indicates the movie format (.avi, .mov, .mpeg, or .wmv).

Optional arguments

startFrame

An Int specifying the first frame to be displayed from this movie. The default value is 0.

endFrame

An Int specifying the last frame to be displayed from this movie. A negative number will indicate reverse numbering: -1 is the last frame of the movie. The default value is −1.

timelineStartFrame

An Int specifying the global timeline frame number that corresponds to startFrame. A value of 0 will indicate the first frame to be displayed in the viewport. The default value is 0.

timelineEndFrame

An Int specifying the global timeline frame number that corresponds to endFrame. A negative number will indicate reverse numbering: -1 indicates the last frame to be displayed in the viewport. The default value is −1.

timelineStartTime

A Float specifying the global timeline time that corresponds to the time of startFrame. The default value is 0.0.

timelineEndTime

The SymbolicConstant END_FRAME_TIME or a Float specifying the global timeline time that corresponds to the time of endFrame. The SymbolicConstant END_FRAME_TIME indicates the time in this movie corresponding to endFrame. The default value is END_FRAME_TIME.

Return value

A Movie object.

Exceptions

ValueError.

If fileName does not exist or can not be read:

ValueError: Unable to open movie file

If fileName references an unsupported movie file format:

ValueError: Unsupported movie format

If the contents of fileName are corrupt or can not be decoded:

ValueError: Unable to decode movie file

setValues(...)

This method modifies the Movie object.

Required arguments

None.

Optional arguments

startFrame

An Int specifying the first frame to be displayed from this movie. The default value is 0.

endFrame

An Int specifying the last frame to be displayed from this movie. A negative number will indicate reverse numbering: -1 is the last frame of the movie. The default value is −1.

timelineStartFrame

An Int specifying the global timeline frame number that corresponds to startFrame. A value of 0 will indicate the first frame to be displayed in the viewport. The default value is 0.

timelineEndFrame

An Int specifying the global timeline frame number that corresponds to endFrame. A negative number will indicate reverse numbering: -1 indicates the last frame to be displayed in the viewport. The default value is −1.

timelineStartTime

A Float specifying the global timeline time that corresponds to the time of startFrame. The default value is 0.0.

timelineEndTime

The SymbolicConstant END_FRAME_TIME or a Float specifying the global timeline time that corresponds to the time of endFrame. The SymbolicConstant END_FRAME_TIME indicates the time in this movie corresponding to endFrame. The default value is END_FRAME_TIME.

Return value

None.

Exceptions

RangeError.

If startFrame,endFrame,timelineStartFrame,timelineEndFrame,timelineStartTime, ortimelineEndTime are outside their respective valid range.

RangeError: startFrame must be an Integer in the range: 0 to numFrames-1

Members

The Movie object has members with the same names and descriptions as the arguments to the Movie method.

In addition, the Movie object has the following members:

width

An Int specifying the width of the movie in pixels.

height

An Int specifying the height of the movie in pixels.

numFrames

An Int specifying the total number of frames on the movie file.

duration

A Float specifying the duration of the movie in seconds.

memory

An Int specifying the memory taken by the movie frames as selected.