POV-Ray : Newsgroups : povray.general : Animation feature request. : Re: Animation feature request. Server Time
28 Mar 2026 15:00:46 EDT (-0400)
  Re: Animation feature request.  
From: m@b
Date: 23 Mar 2026 21:50:00
Message: <web.69c1ec3ef7a277641463fe62d568493a@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> "m@b" <nomail@nomail> wrote:
> > "jr" <cre### [at] gmailcom> wrote:
> > > ...
> > > another option, not yet mentioned, is having a (shell) script run from the
> > > 'pre_frame_command' which writes the values to a simple CSV type file that you
> > > can read from within the scene.
> >
> > Hmm, yes, I could shell out to a Python script that parses the resolution.ini
> > file.
>
> too complex, really, for the need.  apologies.  it can (should) all be done "in
> scene", the following quick test works, assuming ten frames and you only want 4
> through 6:
>
> - create a simple "CSV" file with (subset) end and start frame numbers:
>
>   $ echo '6,4' > framenos.csv
>
>
> - my ini file ("mb.ini"):
>
>   initial_frame = 1
>   final_frame = 10
>   cyclic_animation = off
>   subset_start_frame = 4
>   subset_end_frame = 6
>
>   input_file_name = mb.pov
>   output_file_name = mb_
>
>
> - and your scene, ie only the code inside the conditional:
>
>   #version 3.7;
>
>   global_settings {assumed_gamma 1}
>
>   #declare datafn_ = "framenos.csv";
>
>   #fopen tmp_fp_ datafn_ read
>   #read (tmp_fp_,last_,first_)
>   #fclose tmp_fp_
>
>   #if (first_ < last_ & first_ <= frame_number)
>
>     /* scene stuff */
>     box {0,1}
>
>
>     #declare first_ = first_ + 1;  /* 'incr()' ?! ;-) */
>     #fopen tmp_fp_ datafn_ write
>     #write (tmp_fp_,last_,",",first_)
>     #fclose tmp_fp_
>
>   #end
>
>
> hth, let me know if I got "the wrong end of the stick" :-).
>
>
> regards, jr.

Yes - that would work but, as others have sated, the whole thing is getting more
complicated than it merits.

For now I am happy just to pass the numbers from resolution.ini thus:

    Subset_End_Frame=3755
    Declare=SEF=3755

Typing the number twice must be quicker than editing a second file each time.

m@b


Post a reply to this message

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