POV-Ray : Newsgroups : povray.general : Animation feature request. : Re: Animation feature request. Server Time
28 Mar 2026 15:00:50 EDT (-0400)
  Re: Animation feature request.  
From: jr
Date: 23 Mar 2026 03:30:00
Message: <web.69c0eb53f7a2776448bf72fa6cde94f1@news.povray.org>
"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.


Post a reply to this message

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