[Radiance-dev] fix for objline to handle directories

Axel Jacobs jacobs.axel at gmail.com
Sun Nov 30 06:33:08 PST 2008


Dear Greg,

here is a fix which makes objline handle objects in subdirectories. It
used to only work in this form:
$ objline object1.rad
with the fix, it now also works like so:
$ objline objects/object1.rad

I had to use a few commands (dirname, basename, find) which weren't
utilised before, but hope that
a) they are available on other systems, too (Mac, Win). I've no way to
test this;
b) I didn't mess anything else up. It still works with input from STDIN.

Regards

Axel


12a13,17
> 		set dir=`dirname $f`
> 		set base=`basename $f`
> 		if ($dir != '.') then
> 			mkdir -p $d/$dir
> 		endif
16c21,23
< 		echo i $f:r.orig.mgf $oblqxf > $d/$f:r.oblq.mgf
---
> 		if ($dir != '.') then
> 			echo i $base:r.orig.mgf $oblqxf > $d/$f:r.oblq.mgf
> 		endif
30,31c37,38
< set origdim=`getbbox -h *.orig | rcalc -e $rce:q`
< set oblqdim=`xform $oblqxf *.orig | getbbox -h | rcalc -e $rce:q`
---
> set origdim=`find . -name '*.orig' -exec cat {} \; | getbbox -h - | rcalc -e $rce:q`
> set oblqdim=`find . -name '*.orig' -exec cat {} \; | xform $oblqxf | getbbox -h | rcalc -e $rce:q`



More information about the Radiance-dev mailing list