|
|
|
|
|
|
| |
| |
|
|
From: stbenge
Subject: Detecting .inc file inclusion from another file
Date: 19 Jun 2010 16:37:33
Message: <4c1d2a8d@news.povray.org>
|
|
|
| |
| |
|
|
Hi,
Is there a method for finding out if an .inc file was included from
another file, within the included file itself? For instance, if I wanted
to make an include file which doubles as both an include *and* a scene
file, I would not want the camera, lights, etc. to be included along
with it.
Sam
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 19.06.2010 22:37, schrieb stbenge:
> Is there a method for finding out if an .inc file was included from
> another file, within the included file itself?
None that I know of - unless you know which file(s) it might be included
by, and setting a certain variable there before including. E.g.:
//---------------------------
// my_scene.pov
//---------------------------
#declare MY_INCLUDE_FLAG = 1;
#incude "my_include_file.inc"
...
//---------------------------
// my_include_file.inc
//---------------------------
#ifndef (MY_INCLUDE_FLAG)
// set camera etc.
#end
...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 6/19/2010 4:37 PM, stbenge wrote:
> Hi,
>
> Is there a method for finding out if an .inc file was included from
> another file, within the included file itself? For instance, if I wanted
> to make an include file which doubles as both an include *and* a scene
> file, I would not want the camera, lights, etc. to be included along
> with it.
>
> Sam
Yeah, I requested this feature not too long ago. Would be nice.
--
http://isometricland.com
Post a reply to this message
|
|
| |
| |
|
|
From: stbenge
Subject: Re: Detecting .inc file inclusion from another file
Date: 19 Jun 2010 18:18:12
Message: <4c1d4224@news.povray.org>
|
|
|
| |
| |
|
|
clipka wrote:
> Am 19.06.2010 22:37, schrieb stbenge:
>
>> Is there a method for finding out if an .inc file was included from
>> another file, within the included file itself?
>
> None that I know of - unless you know which file(s) it might be included
> by, and setting a certain variable there before including. E.g.:
>
> //---------------------------
> // my_scene.pov
> //---------------------------
> #declare MY_INCLUDE_FLAG = 1;
> #incude "my_include_file.inc"
> ...
>
> //---------------------------
> // my_include_file.inc
> //---------------------------
> #ifndef (MY_INCLUDE_FLAG)
> // set camera etc.
> #end
> ...
That's a good idea, thanks!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |