animator.inc - multi-shot animation controls

This include file allows users to create an .ini file to run their animations in POV-Ray. I developed this include file for the original Pellet Power video, and updated it for the 2021 redux.

You can download the latest version here.

Example Usage
#declare shotlengths = array[4] {1, 3, 2.4, 0.5}

#declare scriptname = "camerascript.inc";
#if(!file_exists(scriptname))
    #include "animator.inc"
    CreateScript(shotlengths, scriptname, "Example")
#end // if not file_exists
    

The CreateScript macro generates two files. An include file to get the variables needed in the animation, and the INI file to render the animation.

Warning: The INI file assumes the output images will go into a folder with the same name as the input file, and the default name for each frame is "frame.png"

The Generated Include File

animator.inc uses the conciet that the clock variable is counting the number of seconds in the total animation, so clock=12 implies 12 seconds into the animation.

The inculude file will define the following 8 variables in the scene:

The Generated .ini File

animator.inc also generates an .ini file to pass to the rendering engine. Here is a sample from an animator test file:

; POV-Ray Animation Control File
; Generated by animator.inc
Initial_Frame = 1
Final_Frame = 414 ; 60 frames per second
Initial_Clock = 0.0
Final_Clock = 6.9
Cyclic_Animation=off;

; Shot 0 Subsets
; Subset_Start_Frame = 1
; Subset_End_Frame = 60

; Shot 1 Subsets
; Subset_Start_Frame = 61
; Subset_End_Frame = 240

; Shot 2 Subsets
; Subset_Start_Frame = 241
; Subset_End_Frame = 384

; Shot 3 Subsets
; Subset_Start_Frame = 385
; Subset_End_Frame = 414

Input_File_Name = animatortest.pov
Output_File_Name =  animatortest/frame.png
    

Each shot is listed using Subset_Start_Frame and Subset_End_Frame so shots can be test rendered as needed just by uncommenting those lines.

You can change the default frame rate from 60 (in fps) by declaring Animator_Frame_Rate.

You can also call CreateScript multiple times in your scene as long as you use different filename and prefix values. The include and .ini files will start with clock=0, so if you need an animation control that starts after the initial scene, you'll need to use an initial shot length to take up the time before the animated object begins.