POV-Ray : Newsgroups : povray.text.scene-files : Animator.inc - new version Server Time
12 Nov 2024 16:20:42 EST (-0500)
  Animator.inc - new version (Message 1 to 1 of 1)  
From: Uncle Josh
Subject: Animator.inc - new version
Date: 2 Apr 2021 21:02:48
Message: <6067beb8$1@news.povray.org>
I know somewhere in the documents it advises keeping your clock value 
between 0 and 1, but for more complex animations I find it easier to 
think of the clock as an actual clock, going from 0 to however long the 
animation takes in seconds. I wanted to be able to adjust the timing of 
each shot in the final render. So I wrote this include file that 
generates both an include file and an .ini file to control the animation.

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, "Variable")
    #end // if not file_exists
    #include scriptname

The include file adds 8 variables to the scene:

    VariableShot // sequential shot number; 1, 2, 3, ...
    VariableLength // length of clock time (number of seconds if clock=1 
is 1 second)
    VariableSceneClock // clock value starting at 0 and ending at 
VariableLength
    VariableLocalClock // normalized value of 0 to 1 through length of shot
    VariableStart // first clock value
    VariableEnd // last clock value
    VariableFirstFrame // first frame number of the scene
    VariableLastFrame // last frame number of the scene

This provides much needed flexibility in managing the action in each shot.

The INI file provides options to render each scene individually for testing.

I re-wrote this for my Pellet Power redo last year and I've been wanting 
to share it ever since.

If you reset the shotlengths, delete the include file and both the 
include and ini file will be recreated.


Post a reply to this message


Attachments:
Download 'animator.inc.txt' (7 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.