POV-Ray : Newsgroups : povray.general : change root dir of include? : change root dir of include? Server Time
2 Aug 2024 04:21:57 EDT (-0400)
  change root dir of include?  
From: Rafal 'Raf256' Maj
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

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