POV-Ray : Newsgroups : povray.pov4.discussion.general : Conditional Directives within the inifile Server Time
21 Dec 2024 13:34:21 EST (-0500)
  Conditional Directives within the inifile (Message 1 to 3 of 3)  
From: H  Karsten
Subject: Conditional Directives within the inifile
Date: 2 Jun 2011 20:35:01
Message: <web.4de82b4da1aea573a3bfeb720@news.povray.org>
I've done some animation for the election-day on my little island, using PovRay.

To set-up the project was a little to complex for the ini-files.

It would be a very cool thing, heaving conditional directives within the
ini-files, like:

##########################################################
Antialias=Off
Input_File_Name=election.pov
Initial_Frame=1
Final_Frame=23
Display_Gamma=2.0

Width=1440
Height=115

Declare=FileToImport=2

#switch (FileToImport)
  #case (1)
   Output_File_Name=Canditates-01-a
   Declare=GlobalDivider=20
   Declare=FramesAtTheEnd=250
  #break
  #case (2)
   Output_File_Name=;02 = Canditates-01-b
   Declare=GlobalDivider=25
   Declare=FramesAtTheEnd=250
  #break
 ....
 #end
##########################################################

In this case, I would only need to edit the "Declare=FileToImport=..." entry and
everything else is done automatically.

I had more then 17 different files to import and all with different conditions
ahead...

The result can be watched here:
http://www.youtube.com/watch?v=SQcsNXEpTRQ

After rendering, I've used Avisynth for the quick-compositing. The rendering
took just a view seconds, it was "almost realtime" ;) but the fiddling with the
inifile took unnecessary long time.

Best rgds,
Holger


Post a reply to this message

From: clipka
Subject: Re: Conditional Directives within the inifile
Date: 3 Jun 2011 04:20:58
Message: <4de8996a$1@news.povray.org>
Am 03.06.2011 02:31, schrieb H. Karsten:

> ##########################################################
> Antialias=Off
> Input_File_Name=election.pov
> Initial_Frame=1
> Final_Frame=23
> Display_Gamma=2.0
>
> Width=1440
> Height=115
>
> Declare=FileToImport=2
>
> #switch (FileToImport)
>    #case (1)
>     Output_File_Name=Canditates-01-a
>     Declare=GlobalDivider=20
>     Declare=FramesAtTheEnd=250
>    #break
>    #case (2)
>     Output_File_Name=;02 = Canditates-01-b
>     Declare=GlobalDivider=25
>     Declare=FramesAtTheEnd=250
>    #break
>   ....
>   #end
> ##########################################################

Why wait for POV-Ray 4.0 when you can nest ini files /now/?

     --------------------------------foo.ini
     Antialias=Off
     Input_File_Name=election.pov
     Initial_Frame=1
     Final_Frame=23
     Display_Gamma=2.0

     Width=1440
     Height=115

     candidates.ini[2]

     --------------------------------candidates.ini
     [1]
     Output_File_Name=Canditates-01-a
     Declare=GlobalDivider=20
     Declare=FramesAtTheEnd=250

     [2]
     Output_File_Name=Canditates-01-b
     Declare=GlobalDivider=25
     Declare=FramesAtTheEnd=250

;-)

You can also move the "candidates.ini[2]" line on the command line 
instead, for the benefit of not having to edit the ini file over and 
over again before rendering.


Post a reply to this message

From: H  Karsten
Subject: Re: Conditional Directives within the inifile
Date: 3 Jun 2011 16:00:00
Message: <web.4de93c52de65399ba3bfeb720@news.povray.org>
That sounds very good :)


Post a reply to this message

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