POV-Ray : Newsgroups : povray.general : Help - Shelling out to the Operating system from Povray : Re: Help - Shelling out to the Operating system from Povray Server Time
4 Nov 2024 13:01:48 EST (-0500)
  Re: Help - Shelling out to the Operating system from Povray  
From: Hughes, B 
Date: 28 Nov 2003 09:00:06
Message: <3fc754e6@news.povray.org>
"wisher" <nomail@nomail> wrote in message
news:web.3fc6de42308645416a00b1d70@news.povray.org...
>
> I have a program called povplan.exe that I need to call after every frame,
> and pass it the new time value as a parametre.
>
> I'm doing this so that I can automatically increment his internal clock
and
> render an animation of a solar eclipse. Which I'd be more than happy to
> share with everyone once I solve this.
>
> So I'm using Pre_Frame_Command.

Unfortunately, this isn't going to work for that. At least I don't believe
so. You can't pass command-line variables from within a scene file, or an
INI file either. Looks like it might have been an assumption made by the
author at the time of writing the Planetarium doc. If povplan.exe could
accept a text file that would be a different story, because that way you
could have POV write out the variables to a file and invoke them from there.
I don't see any way of going about this as is, since even writing a file
named as the variables, like:  yyyy mm dd hh mm ss.f  could not be told from
within the INI file to see it in a usable way. Well, it would be... only if
Pre_Frame_Command=povplan Variable were possible to say.

> What I don't follow how to do (from the docs on the planetarium) :
> "PPTIME.INC returns two sets of variables :
>
> time_string
>
> and
>
> new_yr
> new_mo
> new_dy
> new_hr
> new_mi
> new_se
>
> where the 'new' variables have the same format of the 'was' variables, and
> time_string is a string in a format compatible with the command line
> arguments
> of the POVPLAN.EXE program.<b> You can invoke POVPLAN.EXE from within your
> scene file using POV-Ray's Pre_Frame_Command and the string concatenation
> function.  See the POV-Ray documentation, SAMPLE.INI and SAMPLE.POV for
the
> details.</b>
>
> <i>This is the crux of the problem right here. Sample.INI and Sample.pov
> don't contain useful info, and the docs don't really explain it
either.</i>
>
> Am I actually supposed to include the Pre_Frame_Command in what file?  The
> Pov?  An INI?  Right now it's in the master.INI file.  Is that part of the
> problem?

INI file... but as I said, it won't accept variables from a scene file
directly. Only those kinds mentioned in the POV-Ray doc. I.e., file name of
the scene being rendered, image res., frame count. Other than just manually
entering the numbers after the executable.

> Once you have called the POVPLAN.EXE program with time_string as the
command
> line argument, you can create the command line argument for the next frame
> by doing the following :
>
> #declare was_yr = new_yr
> #declare was_mo = new_mo
> #declare was_dy = new_dy
> #declare was_hr = new_hr
> #declare was_mi = new_mi
> #declare was_se = new_se"
>
> Like I said, I've just never worked with passing files strings, and I
don't
> know how to go about it exactly.

Been a very long time since I saw the Planetarium. I got it to render here
by putting a #version 3.0 directive in and commenting out the 'halo' which
was used for the Earth's atmosphere. Those variables mentioned above needed
to be declared initially with date/time numbers before I could start using
the scene file.

My best idea for a solution to this is impossible simply because doing a
#write from within the POV or INC can't be seen by povplan.exe in a usable
manner. Again, where povplan fails here, it can't take a file as input;
otherwise it'd be possible to do.

> Another thing about povray is that the output is always a graphic, so a
> debugger or something like cout>> would be so nice, but it's just not
> available afaik.

There is... in a way. The message stream output tells all it can. :-)

> By the by, Happy Thanksgiving.

And a Happy post-Thanksgiving to you as well. And if lucky enough maybe
somebody else will prove my observations concerning this as being at least
partially incorrect.

Bob H.


Post a reply to this message

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