POV-Ray : Newsgroups : povray.general : if(condition), don't create an image Server Time
5 Nov 2024 01:23:09 EST (-0500)
  if(condition), don't create an image (Message 1 to 5 of 5)  
From: gregjohn
Subject: if(condition), don't create an image
Date: 18 Aug 2009 07:05:00
Message: <web.4a8a8ad39499caea34d207310@news.povray.org>
I'm working on a project where I want to systematically explore some variables
which are in effect a function of frame_number.  If a condition is met, I want
to have povray render the scene.  If it is not, I don't want an image on my
HDD-- on to the next frame!

I know how to create an error that outright stops the processing of the scene
file. For the moment, I've set up conditions that move the camera so I get a
black scene.
if (condition)  #declare camerapenalty=1E6;
I suppose I can then just sort a directory by filesize to collect the
interesting images.

Is there another way?


Post a reply to this message

From: gregjohn
Subject: Re: if(condition), don't create an image
Date: 18 Aug 2009 07:15:00
Message: <web.4a8a8c64b3160b6234d207310@news.povray.org>
Got it.

if(condition),
else
 create a new condition)
 check again!


Post a reply to this message

From: Chris B
Subject: Re: if(condition), don't create an image
Date: 18 Aug 2009 08:56:51
Message: <4a8aa513$1@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote in message 
news:web.4a8a8c64b3160b6234d207310@news.povray.org...
> Got it.
>
> if(condition),
> else
> create a new condition)
> check again!
>

I think what you're saying might be shorthand for the solution I'd propose, 
which is to make the code execution for a frame dependant upon a counter and 
repeatedly evaluate the condition from the start in each frame until your 
counter of successful conditions equals the current frame number. Sorry for 
the repetition if this is what you meant.

This will mean that the frame numbers appended to the image file names won't 
line up with the successful condition counter, but if that's a problem you 
can use the #write directive to create yourself a little index.

Regards,
Chris B.


Post a reply to this message

From: clipka
Subject: Re: if(condition), don't create an image
Date: 18 Aug 2009 12:56:53
Message: <4a8add55$1@news.povray.org>
gregjohn schrieb:
> I'm working on a project where I want to systematically explore some variables
> which are in effect a function of frame_number.  If a condition is met, I want
> to have povray render the scene.  If it is not, I don't want an image on my
> HDD-- on to the next frame!

Basically, this is not possible for animations: POV-Ray /always/ creates 
an image, or aborts the whole render altogether.

> Is there another way?

You might use "#fopen ... append" and "#write" to generate a shell 
script or batch file to kill off the undesired frames after all have 
been rendered. Or a list of undesired frame numbers which a static shell 
script / batch file could then process.


Post a reply to this message

From: Kenneth
Subject: Re: if(condition), don't create an image
Date: 19 Aug 2009 03:35:01
Message: <web.4a8ba9d2b3160b62f50167bc0@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:
> I'm working on a project where I want to systematically explore some variables
> which are in effect a function of frame_number.  If a condition is met, I want
> to have povray render the scene.  If it is not, I don't want an image on my
> HDD-- on to the next frame!
>

I think I might have a solution to this, something I worked out for my own
animations. But I want to make sure I understand what you're looking for.

Would it be something like this?: Assume that you're running a 1000-frame
animation, but you want to skip over every other batch of 10 frames, without
having to render those 10 frames as black. In other words, 10 rendered frames,
then 10 'skipped' frames, etc. (leaving you with 500 frames in the end.)  Yet
you want the animated 'action' to be at the same overall speed as your original
1000-frame animation, just with 'missing action gaps.'

If so, I have a dandy solution. (I'm going over the code now, to make sure I'm
correct about its operation--I haven't used it in quite a while.)

Ken W.


Post a reply to this message

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