POV-Ray : Newsgroups : povray.newusers : How to create multiple images in a batch Server Time
1 Nov 2024 11:16:12 EDT (-0400)
  How to create multiple images in a batch (Message 1 to 9 of 9)  
From: ttread
Subject: How to create multiple images in a batch
Date: 10 Sep 2005 03:10:01
Message: <web.4322863eda380feda02959570@news.povray.org>
I want to create multiple images that differ only by one or two variables,
such as the width of one object and the value of a text string.

I was trying to find a way to do this by passing parameters to povray from a
batch file, but couldn't find a way to do it.

The animation feature allows external control of the Clock value, but it's
not suited for the purpose I need.

I thought of using an internal #while loop, but didn't see any way to output
an image file from inside the loop.

Right now the only way I can think of to do it is to write a tool that
creates multiple similar .pov files, one for each image I want to make, and
then run a batch file to invoke povray on all the created files.  Seems
clumsy though.

Any suggestions will be greatly appreciated.  I'm running POV-Ray 3.6 on
Debian Linux 3.1.

-Ted


Post a reply to this message

From: Slime
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 03:20:37
Message: <43228945$1@news.povray.org>
> I was trying to find a way to do this by passing parameters to povray from
a
> batch file, but couldn't find a way to do it.

3.1.2.5.1  Constant

"Declare=IDENTIFIER=FLOAT  Declares an identifier with a float value

You can now declare a constant in an INI file, and that constant will be
available to the scene. Since INI file statements may also be laced on the
command-line, you can therefore also declare on the command-line (though
there is no switch for it)."

See the docs for an example.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Christoph Hormann
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 03:30:01
Message: <dfu1ui$3fb$1@chho.imagico.de>
ttread wrote:
> I want to create multiple images that differ only by one or two variables,
> such as the width of one object and the value of a text string.
> 
> I was trying to find a way to do this by passing parameters to povray from a
> batch file, but couldn't find a way to do it.

povray [options] Declare=identifier=value

> The animation feature allows external control of the Clock value, but it's
> not suited for the purpose I need.

Huh?  There are lost of sample scenes coming with POV-Ray that do 
exactly this.  For example

incdemo/i_internal.pov
incdemo/glasses/samp_demo.pov
incdemo/glasses/glass.pov
textures/patterns/crackle_form.pov
portfolio/*

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: ttread
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 13:25:01
Message: <web.4323165f7ba95ca1a02959570@news.povray.org>
Thank you very much, that's exactly what I was looking for.


Post a reply to this message

From: ttread
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 13:35:00
Message: <web.432318687ba95ca1a02959570@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> ttread wrote:
> > I want to create multiple images that differ only by one or two variables,
> > such as the width of one object and the value of a text string.
> >
> > I was trying to find a way to do this by passing parameters to povray from a
> > batch file, but couldn't find a way to do it.
>
> povray [options] Declare=identifier=value

Yep, thanks, that's what I was looking for.

>
> > The animation feature allows external control of the Clock value, but it's
> > not suited for the purpose I need.
>
> Huh?  There are lost of sample scenes coming with POV-Ray that do
> exactly this.  For example
>
> incdemo/i_internal.pov
> incdemo/glasses/samp_demo.pov
> incdemo/glasses/glass.pov
> textures/patterns/crackle_form.pov
> portfolio/*
>

You are correct;  however, I thought there must be a better way.


Post a reply to this message

From: ttread
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 14:40:01
Message: <web.432327de7ba95ca1a02959570@news.povray.org>
Ok, I have tried passing a string value through the command line using the
syntax:

Declare=TEXT_VAR="Foo"

This does not work because the value gets converted to a float type.
Apparently it's not possible to pass a string on the command line.

I guess I will use the animation clock value and test it against a case
statement to select different strings.


Post a reply to this message

From: Mike Williams
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 15:21:54
Message: <KUThqNASIzIDFwGP@econym.demon.co.uk>
Wasn't it ttread who wrote:
>
>I guess I will use the animation clock value and test it against a case
>statement to select different strings.

It would be easier to use frame_number to index an array of strings.

#declare Params = array[3] {"Foo","Bar","Baz"}
#declare MyParam = Params[frame_number-1];

Remember that frame_number starts at 1, but arrays number from 0.
-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 15:44:51
Message: <iVtULBAqezIDFwCU@econym.demon.co.uk>
Wasn't it ttread who wrote:
>I guess I will use the animation clock value and test it against a case
>statement to select different strings.

If you've got several parameters to set for each frame, you might
consider storing them in a data file, and reading them like this:

#fopen DATA "data.txt" read
#declare i=0;
#while (i < frame_number)
  #read (DATA, Text_var, Float_var, Vector_var)
  #declare i=i+1;
#end

The data.txt file would be formatted like this:

"Foo",  1.3,  <1.0,2.0,3.0>,
"Bar",  2.2,  <1.1,2.1,3.1>,
"Baz",  3.1,  <1.2,2.2,3.2>,

(Don't forget the commas on the ends of the lines)

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: ttread
Subject: Re: How to create multiple images in a batch
Date: 10 Sep 2005 15:45:00
Message: <web.432336af7ba95ca1a02959570@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> It would be easier to use frame_number to index an array of strings.

Yes, thanks, I should have said frame_number

-Ted


Post a reply to this message

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