POV-Ray : Newsgroups : povray.newusers : passing values : Re: passing values Server Time
26 Apr 2024 18:57:14 EDT (-0400)
  Re: passing values  
From: Thomas de Groot
Date: 8 Nov 2018 02:27:38
Message: <5be3e56a$1@news.povray.org>
On 8-11-2018 2:05, clipka wrote:
> Am 08.11.2018 um 01:41 schrieb David Kraics:
>> I am working on a scene involving the inside of a cabin. Each room is 
>> in a
>> separate INC file. I use IF statements to make certain walls invisible 
>> so the
>> inside of the room can be seen. Normally I do this by adjusting a 
>> #declared
>> value in the individual INC file. Is there a way to pass a value from 
>> the main
>> POV file to the INC file so I can do it in one location?
> 
> Any variable you declare in the main file is available in any file it 
> subsequently includes.
> 
> E.g.:
> 
>      // main file
>      #declare Foo = 42;
>      #include "whatever.inc"
> 
>      // whatever.inc
>      #debug concat("Foo is ", str(Foo,0,0), "\n")
> 
> This even works with files declared using `#local` in the main file.


Maybe it could also be achieved if each room were embedded in a separate 
macro?

-- 
Thomas


Post a reply to this message

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