POV-Ray : Newsgroups : povray.general : Include path Server Time
15 Jul 2026 12:11:20 EDT (-0400)
  Include path (Message 1 to 10 of 10)  
From: Maetes
Subject: Include path
Date: 14 Jul 2026 07:40:00
Message: <web.6a561ebf7c9b290f84cf3cd730225ff5@news.povray.org>
Is there a way to find out in an included script where it is relative to the
executed script?

Problem: I include a script that needs to include more scripts, textures in
separate files, or images. Unfortunately, it is the case that the path of the
executed script applies in the included script.

#include "textures.inc"

therefore does not lead to success there.

At the moment I do this by setting a path before the first include.

#declare Coupe_Path = ".. /base/cars/coupe/";

I then use this path with Concat, and thus include further scripts and images.

Is there a better method?

I think there is the possibility to give general include_path, but I don't want
to use it. That would be too many and the folder structure changes often.

Ma


Post a reply to this message

From: ingo
Subject: Re: Include path
Date: 14 Jul 2026 08:10:00
Message: <web.6a5626fd1f2a678017bac71e8ffb8ce3@news.povray.org>
"Maetes" <nomail@nomail> wrote:
>
> Is there a better method?
>
> I think there is the possibility to give general include_path, but I don't want
> to use it. That would be too many and the folder structure changes often.
>


For working with the files, a single directory that holds them all and a
directory structure with soft/sim links from where you edit the files.

When including in POV-Ray you point to the single dir that holds them all. And
answering your other question, include one top_level file that includes the
rest. That then works as there is only one directory with the actual files.

Would that work for you?

ingo


Post a reply to this message

From: Maetes
Subject: Re: Include path
Date: 14 Jul 2026 08:20:00
Message: <web.6a5628bb1f2a678034a9c98430225ff5@news.povray.org>
"ingo" <nomail@nomail> wrote:

> For working with the files, a single directory that holds them all and a
> directory structure with soft/sim links from where you edit the files.
>
> When including in POV-Ray you point to the single dir that holds them all. And
> answering your other question, include one top_level file that includes the
> rest. That then works as there is only one directory with the actual files.
>
> Would that work for you?


I don't think so.

I tinker with small worlds with countless objects. All of which are under
construction, so most of them are housed in their own folders.

If I put them all together in one folder, it becomes a huge chaos.

Unless I didn't understand your explanation correctly, my English is not the
best (I use translation tool)

m


Post a reply to this message

From: ingo
Subject: Re: Include path
Date: 14 Jul 2026 09:27:41
Message: <6a56394d$1@news.povray.org>
On 2026-07-14 14:16, Maetes wrote:

Lets try and visualize:

dir/myIncludeChaos
   object1.pov
   object2.pov
   object3.pov
   include1.inc
   include2.inc


dir/myWorkingStructure
   subdir/car
     link to object1.pov
     link to include2.ini

   subdir/house
     link to include1.ini

     subsubdir/furniture
       link to object2.pov
       link to object2.pov
       link to include2.ini

dir/myIncludeChaos holds the actual files. dir/myWorkingStructure is 
what you see. In your editor you go to /house and open the link 
include1.ini. Your editor actually opens the include1.pov from the chaos 
directory.


https://www.howtogeek.com/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/


ingo

> Unless I didn't understand your explanation correctly, my English is not the
> best (I use translation tool)
> 
> m
> 
>


Post a reply to this message

From: Maetes
Subject: Re: Include path
Date: 14 Jul 2026 09:50:00
Message: <web.6a563dbc1f2a67807ec3250330225ff5@news.povray.org>
ingo <ing### [at] nomailcom> wrote:
> dir/myIncludeChaos holds the actual files. dir/myWorkingStructure is
> what you see. In your editor you go to /house and open the link
> include1.ini. Your editor actually opens the include1.pov from the chaos
> directory.
>

That's too complicated for me.

I also want to publish the scripts. Then everyone who wants to use them would
have to deal with sym-links.

Your solution may be elegant, but I don't like it.
It would be easier to set a path, I think.

m


Post a reply to this message

From: jr
Subject: Re: Include path
Date: 14 Jul 2026 13:50:00
Message: <web.6a5676031f2a67806da32f146cde94f1@news.povray.org>
hi,

"Maetes" <nomail@nomail> wrote:
> ingo <ing### [at] nomailcom> wrote:
> > dir/myIncludeChaos holds the actual files. dir/myWorkingStructure is
> > what you see. In your editor you go to /house and open the link
> > include1.ini. Your editor actually opens the include1.pov from the chaos
> > directory.
> That's too complicated for me.
>
> I also want to publish the scripts. Then everyone who wants to use them would
> have to deal with sym-links.

how about, for every scene file, you add a corresponding .ini file ?  there, not
only can you provide explicit paths (via 'library_path'), but also "fix" other
stuff you'd usually provide on the command-line, like antialias etc.  "added
bonus" is being able to simply write:
  $ povray myscene.ini
and done ;-).


regards, jr.


Post a reply to this message

From: Alain Martel
Subject: Re: Include path
Date: 14 Jul 2026 16:56:07
Message: <6a56a267$1@news.povray.org>
Le 2026-07-14 à 07:37, Maetes a écrit :
> Is there a way to find out in an included script where it is relative to the
> executed script?
> 
> Problem: I include a script that needs to include more scripts, textures in
> separate files, or images. Unfortunately, it is the case that the path of the
> executed script applies in the included script.
> 
> #include "textures.inc"
> 
> therefore does not lead to success there.
> 
> At the moment I do this by setting a path before the first include.
> 
> #declare Coupe_Path = ".. /base/cars/coupe/";
> 
> I then use this path with Concat, and thus include further scripts and images.
> 
> Is there a better method?
> 
> I think there is the possibility to give general include_path, but I don't want
> to use it. That would be too many and the folder structure changes often.
> 
> Ma
> 
> 
> 

When POV-Ray looks for include files, it start in the same folder as the 
current scene file, then, it search in the include folder.
When searching for an include from inside another include file, it 
search in the folder where the first include is located.

So, create a folder for your scene.
Place any custom include in that same folder.
Avoid placing your custom includes in the includes folder.
Benefits : Your project is easier to manage. If you want to publish your 
scene, you can simply zip the whole folder and get all of the required 
files.


Post a reply to this message

From: Maetes
Subject: Re: Include path
Date: 15 Jul 2026 06:20:00
Message: <web.6a575e781f2a67807ec3250330225ff5@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> how about, for every scene file, you add a corresponding .ini file ?  there, not
> only can you provide explicit paths (via 'library_path'), but also "fix" other
> stuff you'd usually provide on the command-line, like antialias etc.  "added
> bonus" is being able to simply write:
>   $ povray myscene.ini
> and done ;-).


Is that easier than defining a path?
I don't think so.
It would just shift the problem to an (additional) ini file.


Alain Martel <kua### [at] videotronca> wrote:
> When POV-Ray looks for include files, it start in the same folder as the
> current scene file, then, it search in the include folder.
> When searching for an include from inside another include file, it
> search in the folder where the first include is located.

The last sentence is my problem. What I would need would be something like a
Povray variable that says where the currently included script is. Then I could
use it to load more scripts of this "sub-include".


But maybe I'm not describing my problem well enough.
I'll do it with manual path information first, maybe then I'll get a hint on how
to do it more elegantly.

Thank you for the tips.

ma


Post a reply to this message

From: Bald Eagle
Subject: Re: Include path
Date: 15 Jul 2026 06:35:00
Message: <web.6a57623b1f2a6780d1d09a9825979125@news.povray.org>
You can get the file name of the current scene file, but I don't think the whole
path.


Post a reply to this message

From: ingo
Subject: Re: Include path
Date: 15 Jul 2026 06:56:11
Message: <6a57674b$1@news.povray.org>
On 2026-07-14 13:37, Maetes wrote:
> Is there a way 
povosc needs waveheader
test is a subdir of current dir

#include "povosc.inc"
#include "test/waveheader.inc"

this works

#include "povosc.inc"
#include "./test/waveheader.inc"

this also

POV-Ray 3.8 on Win11

ingo


Post a reply to this message

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