POV-Ray : Newsgroups : povray.general : Some more image to POV stuff in exchange for a good name : Re: Some more image to POV stuff in exchange for a good name Server Time
7 Jan 2025 22:18:58 EST (-0500)
  Re: Some more image to POV stuff in exchange for a good name  
From: Leroy
Date: 3 Jan 2025 14:45:00
Message: <web.67783d99b095aa5536bcdbf3f712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Ilya Razmanov <ily### [at] gmailcom> wrote:
>
> Found it.
>
https://news.povray.org/povray.general/message/%3CXnsAC0E5196CA622seed7%40news.povray.org%3E/#%3CXnsAC0E5196CA622seed
7%
> 40news.povray.org%3E
>
> So what you do is this:
>
> #if (input_file_name = "MySceneFile.inc")
>
>    Camera
>    Lights
>    whatever else
>
> #end
>
> Then rest of your scene is _just_ the include file.
>
> That way, if you're including your file in another file, it doesn't run the
> extra scene setup code.
> But if you're running it as a standalone file, you obviously need the scene
> setup stuff to render anything - and so it's all right there.
>
> - BW

That works alright. But, I've use this for a long time

#ifndef(Get)
 do what ever
#end

Then define 'Get' in the calling file. This works even if you change the name of
 the inc file. Which I do often when I'm testing ideas.
I really should use the 'input_file_name' test more.
Have fun!


Post a reply to this message

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