POV-Ray : Newsgroups : povray.general : change root dir of include? Server Time
2 Aug 2024 06:14:40 EDT (-0400)
  change root dir of include? (Message 1 to 2 of 2)  
From: Rafal 'Raf256' Maj
Subject: change root dir of include?
Date: 8 Jan 2005 12:19:59
Message: <Xns95D8BA9A97605raf256com@203.29.75.35>
Hi,
I have scene in example 
  scene.pov
in some directory like dir/.  Scene includes some local files, so 
include "data.inc" inside dir/scene.pov refers to dir/data.inc

If I open scene.pov and render it - it works.

If I create a file render.pov and from it include dir/scene.pov - it doesnt 
work, since #include in dir/scene.pov refers to data.inc not dir/data.inc

I can fix it by adding  #declare root="dir/" inside render.pov, and then 
change all #includes in files in dir/* to

#include concat( root , "something" );

But if there are several files inside dir/ and there have several includes, 
in example - files exported using Polyray, it become annoying.

Is there some future to include file where file-name is relative to current 
file, not to main .pov file?  Or - how about adding some SetRoot() option, 
it would be used like:

#declare oldRoot = getfileroot();
setfileroot("car10")
#include "main.pov" // includes car10/main.pov and other includes there are 
  // relative  to car10/ so they work o.k.
setfileroot(oldRoot); // restore root


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Bob Hughes
Subject: Re: change root dir of include?
Date: 8 Jan 2005 14:19:21
Message: <41e03239@news.povray.org>
I'm guessing you are not overlooking the obvious solution, Library_Path, as 
used in the povray.ini file and instead want a way to do this from within a 
scene file.

Only thing besides, I can think of, might be a Pre_Scene_Command to change 
the working directory (of Windows). Unfortunately, while trying a test of 
this before replying to you I couldn't use that idea, POV-Ray crashes. There 
had been problems with that feature during beta testing which I thought had 
been corrected but using it like in the documentation I'm not able to use 
it. Tried with/without quotes.

Bob H.


Post a reply to this message

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