POV-Ray : Newsgroups : povray.animations : Passing variables between files?? Server Time
28 Jul 2024 18:24:24 EDT (-0400)
  Passing variables between files?? (Message 1 to 7 of 7)  
From: Michael Soda
Subject: Passing variables between files??
Date: 14 Jun 1999 19:37:26
Message: <3765920A.B16A2958@erols.com>
Does anyone know how to pass values from one file into another?
Almost exactely like "clock" in an .ini file.  The value is
increased/changed
in  one file, and used in another?

I'm trying to render different "legs" of an entire animation sequence,
and
for each count of clock from 0 to 1, I need to render different things,
and
I just want to set a variable in Clock ("leg" or something) that would
be
passed into the main POV file, and based on this "leg" value, render
different legs of the overall animation.

either it's not possible, or if it is, I'm a dunce, and can't find info
on it
in the documentation.


Post a reply to this message

From: Bill DeWitt
Subject: Re: Passing variables between files??
Date: 15 Jun 1999 06:49:58
Message: <37662fd6@news.povray.org>
#declare Yada = NUMBER;
#include "The File That needs Yada.inc"


Michael Soda <mso### [at] erolscom> wrote in message
news:3765920A.B16A2958@erols.com...
> Does anyone know how to pass values from one file into another?
> Almost exactely like "clock" in an .ini file.  The value is
> increased/changed
> in  one file, and used in another?
>
> I'm trying to render different "legs" of an entire animation sequence,
> and
> for each count of clock from 0 to 1, I need to render different things,
> and
> I just want to set a variable in Clock ("leg" or something) that would
> be
> passed into the main POV file, and based on this "leg" value, render
> different legs of the overall animation.
>
> either it's not possible, or if it is, I'm a dunce, and can't find info
> on it
> in the documentation.
>


Post a reply to this message

From: Michael Soda
Subject: Re: Passing variables between files??
Date: 18 Jun 1999 17:53:10
Message: <376ABF75.3B4D8D79@erols.com>
let me give more detail as to what I'm trying to do

I want to simulate moving water, so I want my *.inc file, which
contains an object full of water to translate the water based on
the clock value.  BUT, I only want to do this if I'm animating.
So...I was going to set a variable in my main *.pov file called
"animation" to true, when animating...and I want the *.inc file
to translate the water, based on this variable. If it's true...than
translate it by the clock...if not, translate it ZERO.

So...I have this

*.ini  -->  *.pov  <-- *.inc

I have the variable in the *.pov file, but the *.inc file can't see it....
and the *.inc file is used for other things, so I don't want to set the
animation variable in there.

You see what I'm saying?  I kinda wanted to declare a GLOBAL
type variable that can be used by ALL files being used at that time...

I guess the include is only way to do this.

Also, I wanted to set a variable in the *.pov file that specifies what "leg"
of the animation I was on, and based on this variable, my *ini file would
have different starting frames, and stopping frames....but I don't think
I can have #IF checks in the *.ini file.....

oh well....if you can think of ANYTHING else that might help, let me know!
Thanks for you help!

Bill DeWitt wrote:

> #declare Yada = NUMBER;
> #include "The File That needs Yada.inc"
>
> Michael Soda <mso### [at] erolscom> wrote in message
> news:3765920A.B16A2958@erols.com...
> > Does anyone know how to pass values from one file into another?
> > Almost exactely like "clock" in an .ini file.  The value is
> > increased/changed
> > in  one file, and used in another?
> >
> > I'm trying to render different "legs" of an entire animation sequence,
> > and
> > for each count of clock from 0 to 1, I need to render different things,
> > and
> > I just want to set a variable in Clock ("leg" or something) that would
> > be
> > passed into the main POV file, and based on this "leg" value, render
> > different legs of the overall animation.
> >
> > either it's not possible, or if it is, I'm a dunce, and can't find info
> > on it
> > in the documentation.
> >


Post a reply to this message

From: Bob
Subject: Re: Passing variables between files??
Date: 18 Jun 1999 22:27:46
Message: <376AFFEA.33DDE07@aol.com>
Only thing I could suggest is to look over clockmod.inc by Chris C., available at 
http://www.geocities.com/SiliconValley/Lakes/1434/
or another of such files (spray.inc does also) which have a clock_start and clock_stop
type of parameter in them and maybe rig a similar thing for your animation.
If the INI and POV and/or INC files could communicate better it would be a superb
improvement, a common feature request.


Michael Soda wrote:
> 
> let me give more detail as to what I'm trying to do
> 
> I want to simulate moving water, so I want my *.inc file, which
> contains an object full of water to translate the water based on
> the clock value.  BUT, I only want to do this if I'm animating.
> So...I was going to set a variable in my main *.pov file called
> "animation" to true, when animating...and I want the *.inc file
> to translate the water, based on this variable. If it's true...than
> translate it by the clock...if not, translate it ZERO.
> 
> So...I have this
> 
> *.ini  -->  *.pov  <-- *.inc
> 
> I have the variable in the *.pov file, but the *.inc file can't see it....
> and the *.inc file is used for other things, so I don't want to set the
> animation variable in there.
> 
> You see what I'm saying?  I kinda wanted to declare a GLOBAL
> type variable that can be used by ALL files being used at that time...
> 
> I guess the include is only way to do this.
> 
> Also, I wanted to set a variable in the *.pov file that specifies what "leg"
> of the animation I was on, and based on this variable, my *ini file would
> have different starting frames, and stopping frames....but I don't think
> I can have #IF checks in the *.ini file.....
> 
> oh well....if you can think of ANYTHING else that might help, let me know!
> Thanks for you help!
> 

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Cliff Bowman
Subject: Re: Passing variables between files??
Date: 19 Jun 1999 00:34:50
Message: <376b1da3.13033823@news.povray.org>
On Fri, 18 Jun 1999 17:51:49 -0400, Michael Soda <mso### [at] erolscom>
wrote:

>let me give more detail as to what I'm trying to do
>
>I want to simulate moving water, so I want my *.inc file, which
>contains an object full of water to translate the water based on
>the clock value.  BUT, I only want to do this if I'm animating.
>So...I was going to set a variable in my main *.pov file called
>"animation" to true, when animating...and I want the *.inc file
>to translate the water, based on this variable. If it's true...than
>translate it by the clock...if not, translate it ZERO.
>
>So...I have this
>
>*.ini  -->  *.pov  <-- *.inc
>
>I have the variable in the *.pov file, but the *.inc file can't see it....
>and the *.inc file is used for other things, so I don't want to set the
>animation variable in there.
>
>You see what I'm saying?  I kinda wanted to declare a GLOBAL
>type variable that can be used by ALL files being used at that time...
>
>I guess the include is only way to do this.
>
>Also, I wanted to set a variable in the *.pov file that specifies what "leg"
>of the animation I was on, and based on this variable, my *ini file would
>have different starting frames, and stopping frames....but I don't think
>I can have #IF checks in the *.ini file.....
>
>oh well....if you can think of ANYTHING else that might help, let me know!
>Thanks for you help!
>
Odd - I regularly do this without any difficulty.

Most (all?) of Chris Colefax's include files require the declaration
of one or more "global variables" before actually #include-ing the
file. Those include files can see the variables just fine (they rely
on that ability)

I've also got a .ini file which specifies which segment of an
animation to render based on clock values (although due to poor math I
cheated and changed clock to run from 0 to 900 instead of 0 to 1 -
makes working out the clock values for subset renders easier for me).

Maybe you could try posting your files for people to see if they can
spot the problem?

I'm not great at POV, but if you want to e-mail me, watch the annoying
spamblock address!


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at
http://www.geocities.com/Area51/Dimension/7855/
PS change ".duffnet" to ".net" if replying via e-mail


Post a reply to this message

From: Cliff Bowman
Subject: Re: Passing variables between files??
Date: 19 Jun 1999 01:00:52
Message: <376b224e.14229210@news.povray.org>
Thnking about it, the old technique for passing an unknown number of
arguments is to use a string - the macro accepts and then parses a
string like "1,3" or "5,1,2,3,4,5" into variable 1 or variables 1 to
5.

It'd not necessarily be fast - but it'd work I suspect. There are
string functions like left$() and mid$() aren't there?

Hmm... I can find "substr" which seems to be the equivalent of mid$
(and could be used in place of left$) and you can use "strlen" as the
equivalent of len() (to find the number of characters in the string
which needs parsing).

Since I can't see anything in the POV docs which suggest arrays are
not permissable as parameters, that might be the easiest option
though.


Cheers,

Cliff Bowman
Why not pay my 3D Dr Who site a visit at
http://www.geocities.com/Area51/Dimension/7855/
PS change ".duffnet" to ".net" if replying via e-mail


Post a reply to this message

From: Ken
Subject: Re: Passing variables between files??
Date: 19 Jun 1999 01:10:30
Message: <376B235C.855FB527@pacbell.net>
Cliff Bowman wrote:
> 
> Thnking about it, the old technique for passing an unknown number of
> arguments is to use a string - the macro accepts and then parses a
> string like "1,3" or "5,1,2,3,4,5" into variable 1 or variables 1 to
> 5.
> 
> It'd not necessarily be fast - but it'd work I suspect. There are
> string functions like left$() and mid$() aren't there?
> 
> Hmm... I can find "substr" which seems to be the equivalent of mid$
> (and could be used in place of left$) and you can use "strlen" as the
> equivalent of len() (to find the number of characters in the string
> which needs parsing).
> 
> Since I can't see anything in the POV docs which suggest arrays are
> not permissable as parameters, that might be the easiest option
> though.
> 
> Cheers,
> 
> Cliff Bowman
> Why not pay my 3D Dr Who site a visit at
http://www.geocities.com/Area51/Dimension/7855/
> PS change ".duffnet" to ".net" if replying via e-mail

Yes it permissable to pass an array to a macro.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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