POV-Ray : Newsgroups : povray.newusers : passing values : Re: passing values Server Time
20 Apr 2024 07:52:23 EDT (-0400)
  Re: passing values  
From: clipka
Date: 7 Nov 2018 20:05:39
Message: <5be38be3@news.povray.org>
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.


Post a reply to this message

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