 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
ingo <ing### [at] nomail com> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
hi,
"Maetes" <nomail@nomail> wrote:
> ingo <ing### [at] nomail com> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"jr" <cre### [at] gmail com> 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] videotron ca> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |