POV-Ray : Newsgroups : povray.general : INC questions : Re: INC questions Server Time
9 Aug 2024 03:25:12 EDT (-0400)
  Re: INC questions  
From: Chris Huff
Date: 23 Aug 2000 11:21:25
Message: <chrishuff-3FDE64.10224923082000@news.povray.org>
In article <39a3b247$1@news.povray.org>, "Tom Melly" 
<tom### [at] tomandlucouk> wrote:

> Two questions regarding .inc files:
> 
> 1. Is there any way to make an include file automatically detect 
> whether it was called or not? In my case I have an include file/macro 
> that will generate a bolt of lightning. I would like the file to 
> generate an sample scene if run directly, but not when called 
> (without the user having to set/change a variable).

Well...maybe only produce the scene file if none of the variables are 
set. This won't work for macros, though.
Maybe call an Init() macro after including the file to set up variables 
and turn the example scene off.
Or maybe have a variable telling the include which sample to use...if 
not declared, no sample would be used.
Anyway, in my opinion, it is a much better idea to have separate 
examples. It won't be any harder to do, and it will be easier on the 
user and anyone trying to understand either the examples or the utility. 
And it allows multiple samples.


> 2. Would I post such a macro to scene-files or utilities?

Scene-files. The povray.binaries.utilities group is for stuff not 
written in POV-Script, and the povray.*.scene-files groups are really 
for any POV-Script files or code snippets.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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