POV-Ray : Newsgroups : povray.animations : more efficient method to program animation? Server Time
28 Mar 2024 09:03:44 EDT (-0400)
  more efficient method to program animation? (Message 1 to 7 of 7)  
From: wieland delepeleire
Subject: more efficient method to program animation?
Date: 15 Jan 2011 08:10:01
Message: <web.4d319c5866c3e57a184c8df90@news.povray.org>
Dear all,

for a project i am using Povray to make an animation. The temporary result can
be seen here (http://dl.dropbox.com/u/279365/Draft04.mov).

My files are getting complicated and I was wondering if there is a more
efficient way to organise my "programming".
So far, I am declaring scene numbers in my .pov file and then tell what should
happen:
 #switch (SceneNr)
 #case (1) // Light searching
  #declare vspot01 = 1;
  #declare vt_ph = 1;
  #declare vt_cp = 1;
  #declare zt_ph = 0;
  #declare zt_cp = 0;

  #declare alpha_g=1-clock;

  #declare CamPos = CamPos_s0;
  #declare CamLook = CamLook_s0;

  #declare w_cp=w_cp/2;
  #declare FlyThrough =
       spline {
           cubic_spline
           -0.250, < 1.3*w_cp, 0, 2>
            0, < 1.2*w_cp, 0, 2>
            1/9, < 1.3*w_cp, 0, 3>
              2/9, < 1.3*w_cp+1, 0, 2>
            3/9, < 1.3*w_cp, 0, 1>
            4/9, < 0.9*w_cp, 0, 2>
              5/9, < 0.5*w_cp, 0, 4>
            6/9, < 0.1*w_cp, 0, 2>
            7/9, < -0.1*w_cp, 0, 1>
              8/9, < -0.4*w_cp, 0, 0>
            1, <w_cp/sin(pi/2/0.7), 0, 0>
            1.250, <w_cp/sin(pi/2/0.7)+1, 0, 0>
              }
  #declare SpotLook = FlyThrough(0.95*clock);
  #declare SpotRadius = 9*pow(sin(clock*pi/2),2);
 #break
 #case (2) // move light right and left
  #declare vspot01 = 1;
  #declare vt_ph = 1;
  #declare vt_cp = 1;
  #declare zt_ph = 0;
  #declare zt_cp = 0;
  #declare alpha_g=0;

  #declare CamPos = CamPos_s0;
  #declare CamLook = CamLook_s0;

  #local o_sp = 0.7; //overshoot spotlight
  #declare SpotLook = <w_cp/(2*sin(pi/2/o_sp))*sin(clock*pi/2/o_sp),0,0>;
  #declare SpotRadius = 9;
 #break
In the .ini file that defines the animation I declare the scene number that
should be rendered as follows:
     ;Declare=SceneNr=1
     ;Final_Frame=50 ;
     ;Output_File_Name=/Users/Wieland/Desktop/RendersMegaPov/NQ/scene01/frame
     Declare=SceneNr=2
     Final_Frame=20
     Output_File_Name=/Users/Wieland/Desktop/RendersMegaPov/NQ/scene02/frame
     ;Declare=SceneNr=3
     ;Final_Frame=20
     ;Output_File_Name=/Users/Wieland/Desktop/RendersMegaPov/NQ/scene03/frame
But when I want to render the full animation I should comment/uncomment every
scene separately in the .ini file which is a repetitive and stupid
time-spending. (At least for a human being, that's why we invented computers,
right?)
Therefore I was looking for a for-loop in the .ini file, but that seems
impossible. How do you guys solve such a problem?

Newbie greetings,
Wieland.


Post a reply to this message

From: StephenS
Subject: Re: more efficient method to program animation?
Date: 15 Jan 2011 13:40:01
Message: <web.4d31e9e09dd3c3a61619aee0@news.povray.org>
"wieland.delepeleire" <wie### [at] gmailcom> wrote:
....
> But when I want to render the full animation I should comment/uncomment every
> scene separately in the .ini file which is a repetitive and stupid
> time-spending. (At least for a human being, that's why we invented computers,
> right?)
> Therefore I was looking for a for-loop in the .ini file, but that seems
> impossible. How do you guys solve such a problem?
>
> Newbie greetings,
> Wieland.

One posible solution is to use the frame number for the whole animation, and use
Subset_Start_Frame/Subset_End_Frame.

Or:
Save the settings in there own .ini file and comment/uncomment the ones you want
from the master .ini file.

Initial_Frame = 1
Final_Frame = 200
+I 'Scene_No_1.ini'
;+I 'Scene_No_2.ini'


*** Scene_No_1.ini ***
Subset_Start_Frame = 1
Subset_End_Frame = 9

*** Scene_No_2.ini ***
Subset_Start_Frame = 10
Subset_End_Frame = 35

I think you will allways have to tell POV-Ray what parts you want rendered;-)

Stephen S


Post a reply to this message

From: StephenS
Subject: Re: more efficient method to program animation?
Date: 15 Jan 2011 14:20:01
Message: <web.4d31f2a59dd3c3a61619aee0@news.povray.org>
"StephenS" <nomail@nomail> wrote:
....
> Save the settings in there own .ini file and comment/uncomment the ones you want
> from the master .ini file.
....
Oops, better the other way around.

Master .ini file for the whole animation, and Scene .ini files to override the
parts you want.

** Master.ini
Width = 1280
Height = 960
Antialias = On
ampling_Method = 1
Antialias_Threshold = 0.100
Jitter = Off
Antialias_Depth = 3
Output_To_File = On
Output_File_Type = N
Initial_Frame = 0
Final_Frame = 200
.... all the regular things you want

** Scene_1_
+I 'Master.ini'   ; include the master file
Subset_Start_Frame = 0
Subset_End_Frame = 10
Output_File_Name = P:\Scene_1_images\   ; this sets a location only
.... all the things you want to change

Run the Scene_XX.ini file you want, or the whole thing.

Stephen S


Post a reply to this message

From: wieland delepeleire
Subject: Re: more efficient method to program animation?
Date: 16 Jan 2011 05:55:01
Message: <web.4d32cdf49dd3c3abd9ff6800@news.povray.org>
Thanks for that help, it makes sense indeed. But it won't run all the different
scenes when I would run main.ini since I need to define the SceneNr variable due
to the structure of my file.

Maybe I should find a way to run the sceneXX-ini-files by using the terminal,
and then write a script to run all those files. Do you know if and how that is
possible? (I am using MegaPov for Mac OSX.)

Thank you for your response anyway!
Wieland


Post a reply to this message

From: Christian Froeschlin
Subject: Re: more efficient method to program animation?
Date: 16 Jan 2011 19:50:43
Message: <4d339263@news.povray.org>
wieland.delepeleire wrote:

> Thanks for that help, it makes sense indeed. But it won't run all the different
> scenes when I would run main.ini since I need to define the SceneNr variable due
> to the structure of my file.

Since you need to decide the overall structure of the animation too,
you could derive SceneNr from clock value (e.g., scene 1 goes from 0
to 0.1, scene 2 from 0.1 to 0.4, ...). Then define a scene_clock
variable as (clock-min)/(max-min) for the scene clock limits to
again get a subcounter from 0 to 1.


Post a reply to this message

From: wieland delepeleire
Subject: Re: more efficient method to program animation?
Date: 22 Jan 2011 06:35:00
Message: <web.4d3abfc49dd3c3a15dc46370@news.povray.org>
> Then define a scene_clock
> variable as (clock-min)/(max-min) for the scene clock limits to
> again get a subcounter from 0 to 1.

Great solution! I'll use that.


Post a reply to this message

From: Chrisir
Subject: Re: more efficient method to program animation?
Date: 15 Mar 2011 18:05:00
Message: <web.4d7fe1769dd3c3a6327bdb20@news.povray.org>
Hello,

Just for completeness:

I use an external program, e.g. processing or even Word-VBA, to generate my
Pov-ray-files (1500 files or what ever), one file for each picture in the
animation:

output0000000000.pov
output0000000001.pov
output0000000002.pov
.....

When I find a problem, I debug in POV-Ray, check the image there and paste the
Code back to processing. I then delete the *.pov and start the program in
processing again, which now generates the new code for pov-ray.

Then I use one additional PovRAY-file in the same folder, with just one line:

#include concat("output", str(frame_number, -10, 0), ".pov")

which renders all my 1500 pov-files in a queue.

and the master-ini has among others these lines:

initial_clock = 100;
final_clock = 200000;
initial_frame = 100;
final_frame =  200000;


Done.

Greetings.

C


Post a reply to this message

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