|
|
Tom Melly 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).
I don't see any way without modifying the scene file, but the modification is
quite simple:
#declare No_Sample = true;
#include "incfile.pov"
And the incfile.pov with
#if (No_Sample)
[sample code]
#end
> 2. Would I post such a macro to scene-files or utilities?
scene-files IMO, because utilities is for seperate programs (no pov-code)
Christoph
--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
|
|
|
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
|
|