Movie: Server basics

A Movie is a plug-in server that can write a series of frames as a file in movie format.

Overview

When rendering animations in modo the user has the option to save as a movie. The dialog presents some of these servers for the choices, and as images are produced they are sent to the server to be saved.

Headers

  • ‘’’image (lx-image.hpp)’’’
    • ‘’CLxImpl_Movie’’

    • ‘’CLxUser_Image’’

  • LXsMOVIE_SAVESTEREO – if set, this server acutally saves pairs of images as stereo pairs.

  • LXsSAV_DOSTYPE – the three-character file extension to be used by default (e.g. ‘’MP4’’).

The plug-in server class derives from CLxImpl_Movie, and exports the ILxMovie interface.

Movie::BeginMovie()

The BeginMovie() method is called to initiate saving. The path and size of the frame are given.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
         LxResult
 mov_BeginMovie (
         const char              *fname,
         int                      w,
         int                      h,
         int                      flags)      LXx_OVERRIDE
 {
         if (open_output_file (fname, w, h))
                 return LXe_OK;
         else
                 return LXe_FAILED;
 }

Movie::SetFramerate()

Default framerate is defined to be 15 FPS. That can be overridden with this method.

1
2
3
4
5
6
7
         LxResult
 mov_SetFramerate (
         int                      fps)
 {
         rate = fps;
         return LXe_OK;
 }

Movie::AddImage()

The AddImage() method is called sequentially to append frames to the growing movie.

1
2
3
4
5
         LxResult
 mov_AddImage (
         ILxUnknownID             frame)
 {
         CLxUser_Image            image (frame);
1
2
3
         add_frame_at_end (image);
         return LXe_OK;
 }

Movie::EndMovie()

When complete, or aborted, the movie file is closed.

1
2
3
4
5
         LxResult
 mov_EndMovie (void)
 {
         close_file ();
 }