Blog --- MA_Screenplay ready to use
29.12.2024 - 2:00 pm
Tutorial at second 5
With
MA_Screenplay one of my most complex Povray packages to date has finally been completed. It helps in realizing long animations without losing overview and patience.
Central component is a timeline in which the tasks to be done can be conveniently specified. Separate from this is the subsequent creation and representation of the objects.
Due to the strict separation of both parts, it is possible to concentrate on one thing. First you let your thoughts run free and indicate when something has to be done, later you take care of the actual implementation without worrying about the course of time.
A short example of what a simple screenplay script looks like.
#version 3.7;
#include "ma_helpers.inc"
#include "ma_screenplay.inc"
#declare LigVector = <0,10,0>*100;
#declare CamLookAt = <0,3,0>;
#declare CamLocation = <1 , 5 ,-15>;
#declare CamAngle = 60;
#declare SCR_FPS = 10;
#declare SCR_SecondStart = 0;
#declare SCR_SecondEnd = 10;
#declare SCR_SecondFreeze = 5;
#macro SCR_Init ()
SCR_RegisterScene ("first", 10)
#end
#macro SCR_Timeline ( mSimulation )
//Say what scene you define
SCR_SetScene("first")
//Define the screenplay
#local mName = "sphere";
#local mProp = "translate-y";
#local mValueStart = 0;
#local mValueEnd = 8;
#local mSecond0 = 0.0;
#local mSecond1 = 0.0;
#local mSecond2 = 10;
#local mSecond3 = 10;
SCR_SetNumber (mName, mProp, mValueStart, mValueEnd, "", mSecond0, mSecond1, mSecond2, mSecond3, 1)
//Handle the actor(s)
#local mTransY = SCR_GetFloat ("sphere", "", "translate-y", 0);
sphere {
<0,0.5,0> 0.5
texture { pigment { color rgb <0,1,0> } }
translate <0,mTransY, 0>
}
//Do some other stuff
MA_Testarea (5)
sky_sphere { pigment { color Gray05 } }
#end
SCR_Start()
MA_CameraAndLight_Set()
Explanation second 0 to 3
For everything that moves or changes, values are set with
SCR_Set*() in the first part of the script and put into action by
SCR_Get*() in the lower part. Although this has to be precisely defined for each action, it still works surprisingly well even with longer animations from my point of view. A certain amount of discipline is required in the design of the script, and an editor with syntax highlighting is never wrong anyway.
To illustrate this, I have put together an extensive, executable tutorial and packed the complete script of the first flight of the
Tussi spaceship in it. Based on the approximately 2000 lines of sample code, it should become clear how the use of Screenplay is intended and what advantages it has compared to manual use of
clock and
clock_on.
More animations will follow, I have big plans.
Source code and further explanations can be found on the project page
MA_Screenplay.
Have fun with it,
Martin