POV-Ray : Newsgroups : povray.general : 'IF EXISTS' technique to speed up animation restarts - possible? Server Time
11 Aug 2024 13:23:49 EDT (-0400)
  'IF EXISTS' technique to speed up animation restarts - possible? (Message 1 to 6 of 6)  
From: Cliff Bowman
Subject: 'IF EXISTS' technique to speed up animation restarts - possible?
Date: 21 Jul 1999 14:19:54
Message: <3795c553.91114856@news.povray.org>
I've a silly little animation that I tweak every now and then and
re-render. Because the PC's I use often have to be stopped so that
they can do some "proper work" I have resorted to numerous techniques
to re-start the rendering at the appropriate point (especially since
the person re-starting the rende risn't always me - but sometimes the
wife).

This has brought to mind a possible "improvement" to the way I
currently do this, but I can't see any way of realising it (thus far)
even with a macro.

At present POV always parses a scene, creates bounding slabs, maybe
vector and light buffers, before checking to see if there's a file of
the appropriate name already in place. What I'd *like* to do is to be
able to extract the name of the "about to be rendered" file, increment
it by one, use some (non-existant so far as I can currently find)
"IFEXISTS" command to see if the current _and_ next frame exist. If
that's true then a variable (e.g. ffast) can be set to true and the
POV script can check it and produce a minimal scene for parsing
instead of the full scene. It then whips past all the "full, finished"
frames and only starts parsing the full scene description when it
approaches the end of the segment.

This approach has flaws even if it could be implimented without
patching the code. If someone had to patch the POV code in order to
get "IFEXISTS" functionality then a better approach might be to check
that the current frame file is a complete, finished file - skipping
all of these until the first non-existant or incomplete bitmap is
located and then parsing from that point onwards.

It's not a major headache - when I'm doing the re-starting I can
change the start and end frames in the .ini file I use - but something
along these lines would, I feel, be at least some benefit.


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at http://www.who3d.cwc.net/
PS change ".duffcom" to ".net" if replying via e-mail


Post a reply to this message

From: Dave Tucker
Subject: Re: 'IF EXISTS' technique to speed up animation restarts - possible?
Date: 21 Jul 1999 15:34:55
Message: <37961FEA.DCFE99B2@altatech.com>
This begs the question  "What os are you using?"  Your "IFEXISTS"
functionality does exist on unix platforms.  I don't know if it's on
those other OS's.  One posibility is to try to open the file for read
only (without the O_CREAT flag).  The call would fail if the file
doesn't exist.

dave


Cliff Bowman wrote:
> 
> I've a silly little animation that I tweak every now and then and
> re-render. Because the PC's I use often have to be stopped so that
> along these lines would, I feel, be at least some benefit.
> 
> Cheers,
> 
> Cliff Bowman
> Why not pay my 3D Dr Who site a visit at http://www.who3d.cwc.net/
> PS change ".duffcom" to ".net" if replying via e-mail

-- 
David Tucker
dav### [at] altatechcom
http://www.altatech.com/


Post a reply to this message

From: Martin Crisp
Subject: Re: 'IF EXISTS' technique to speed up animation restarts - possible?
Date: 21 Jul 1999 20:13:03
Message: <3796620f@news.povray.org>
Cliff Bowman wrote in message <3795c553.91114856@news.povray.org>...
>I've a silly little animation that I tweak every now and then and
>re-render. Because the PC's I use often have to be stopped so that
>they can do some "proper work" I have resorted to numerous techniques
>to re-start the rendering at the appropriate point (especially since
>the person re-starting the rende risn't always me - but sometimes the
>wife).

[...]

Hmm, I don't use ini files (coz I use POV on the Mac), but...

can an ini file read/write a file from disk and set the start frame
based on the contents?

Could you write a simple DOS batch job that checks these things and sets
a file to be read by the ini with the appropriate settings?

Have Fun
Martin
--
<Spa### [at] tesseractcomau> is a valid address
If you prefer mnemonic addresses you can use:
<Martin 'at' tesseract.com.au> or <Martin.Crisp 'at' Tourism.tas.gov.au>

My opinions should not be taken as indicative of Tourism Tasmania's
opinions


Post a reply to this message

From: Nieminen Mika
Subject: Re: 'IF EXISTS' technique to speed up animation restarts - possible?
Date: 22 Jul 1999 03:10:13
Message: <3796c3d5@news.povray.org>
I think this is possible without patching povray or using any external
utility.

  Let me think...
  First you have to create a file named, for example, "currentframe" with
a "0" in it. For example:

echo 0 > currentframe

  You set it to "0" each time you start rendering (no matter if it's a
continued render or the first time).
  You also need another file, which you also initialize to "0". Let's name
it "calculatedframes":

echo 0 > calculatedframes

  We don't change this one anymore (until we have finished all the frames).

  Now, in the povray script you open both files and read their contents
into two identifiers (with same names, for example).
  If the 'currentframe' value is less than 'calculatedframes', we skip
this frame.
  AFAIK there's no way to tell povray "stop rendering this image". I think
this would be a good suggestion for the next version. Something like an
#exit directive. The #error directive is not good because it completely
stops povray instead of stopping just the current frame.
  We can however just enclose all the scene inside the #if-block. The scene
could be in another file. For example:

#if(!currentframe<calculatedframes)
  #include "scene.pov"
#end

  This way we save the parsing of the scene when we don't want to calculate
this frame.

  Now we add 1 to 'currentframe' and save it to its correspondent file. If
we rendered the scene we do this also to 'calculatedframes'. Like this:

(read 'currentframe' and 'calculatedframes')
#if(!currentframe<calculatedframes)
  #include "scene.pov"
  #declare calculatedframes=calculatedframes+1;
#end
#declare currentframe=currentframe+1;
(save 'currentframe' and 'calculatedframes' to their files)

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Cliff Bowman
Subject: Re: 'IF EXISTS' technique to speed up animation restarts - possible?
Date: 22 Jul 1999 15:23:58
Message: <37976bad.14714521@news.povray.org>
On Wed, 21 Jul 1999 13:30:50 -0600, Dave Tucker <dav### [at] altatechcom>
wrote:

>This begs the question  "What os are you using?"  Your "IFEXISTS"
>functionality does exist on unix platforms.

It exists in DOS/Windows too. AFAIK it doesn't exist in POV (which is
where I want to use it from - I want to put the decision making in the
scene file rather than inflict complexity on the wife).

>  I don't know if it's on
>those other OS's.  One posibility is to try to open the file for read
>only (without the O_CREAT flag).  The call would fail if the file
>doesn't exist.
>
That's an interesting idea (though I think I'd have to hard-code the
name of the output files).

Hmmm... there's nother suggestion below tha tI need to think about
too.


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at http://www.who3d.cwc.net/
PS change ".duffcom" to ".net" if replying via e-mail


Post a reply to this message

From: Cliff Bowman
Subject: Re: 'IF EXISTS' technique to speed up animation restarts - possible?
Date: 22 Jul 1999 15:24:01
Message: <37976c6e.14908143@news.povray.org>
On 22 Jul 1999 03:10:13 -0400, Nieminen Mika <war### [at] cctutfi> wrote:

>  I think this is possible without patching povray or using any external
>utility.
>
>  Let me think...

Some excellent suggestions which I'll have to re-read and attempt
(although it's slightly complicated by the fact tha tI use up to 4
different PC's to render different segments at the same time - usually
at least 2 are working on it even if there's "work work" occurring).


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at http://www.who3d.cwc.net/
PS change ".duffcom" to ".net" if replying via e-mail


Post a reply to this message

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