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:24:43 EST (-0500)
  Re: Some more image to POV stuff in exchange for a good name  
From: Ilya Razmanov
Date: 3 Jan 2025 10:38:25
Message: <67780471$1@news.povray.org>
On 24.12.2024 18:03, Bald Eagle wrote:

> 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.

Well, don't quite like this solution since it's not immune to simple 
file rename. But I started to think (yes, following comrade major 
scheme) and eventually and inevitably came to conclusion that

#declare extension = substr(input_file_name, strlen(input_file_name) - 3, 4)

#debug extension

shows me

.pov

and even subsequent

#if (extension = ".pov")
   #debug "Match!\n"
#end

says "Match!"

Combining it with your suggestion, I guess I can produce files that work 
as a whole scene when they are .pov, and as include after renaming to .inc

But this is not confirmed experimentally yet ;-)

-- 
Ilyich the Toad
https://dnyarri.github.io/


Post a reply to this message

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