3 |
|
# Choose the Rad Input File to work on. |
4 |
|
# |
5 |
|
|
6 |
– |
set rif_glob *.rif |
7 |
– |
|
6 |
|
proc preen {} { # clean up radvar |
7 |
|
global radvar rifname |
8 |
|
foreach n {objects scene materials illum mkillum render oconv pfilt |
9 |
< |
AMBFILE OPTFILE EXPOSURE ZONE REPORT} { |
9 |
> |
RAWFILE ZFILE AMBFILE OPTFILE EXPOSURE ZONE REPORT} { |
10 |
|
if {! [info exists radvar($n)]} { |
11 |
|
set radvar($n) {} |
12 |
|
} |
64 |
|
} else { |
65 |
|
set radvar(PENUMBRAS) False |
66 |
|
} |
69 |
– |
if [info exists radvar(RAWSAVE)] { |
70 |
– |
cardval radvar(RAWSAVE) {True False} |
71 |
– |
} else { |
72 |
– |
set radvar(RAWSAVE) False |
73 |
– |
} |
67 |
|
if [info exists radvar(VARIABILITY)] { |
68 |
|
cardval radvar(VARIABILITY) {High Medium Low} |
69 |
|
} else { |
96 |
|
IND* { set radvar(INDIRECT) $vval } |
97 |
|
DET* { set radvar(DETAIL) $vval } |
98 |
|
PEN* { set radvar(PENUMBRAS) $vval } |
106 |
– |
RAW* { set radvar(RAWSAVE) $vval } |
99 |
|
VAR* { set radvar(VARIABILITY) $vval } |
100 |
|
REP* { set radvar(REPORT) $vval } |
101 |
+ |
RAW* { set radvar(RAWFILE) $vval } |
102 |
+ |
ZF* {set radvar(ZFILE) $vval } |
103 |
|
} |
104 |
|
|
105 |
|
} |
119 |
|
} |
120 |
|
if {[lsearch -exact {ZONE QUALITY OCTREE PICTURE AMBFILE OPTFILE |
121 |
|
EXPOSURE RESOLUTION UP INDIRECT DETAIL PENUMBRAS |
122 |
< |
RAWSAVE VARIABILITY REPORT} $vn] >= 0} { |
122 |
> |
RAWFILE ZFILE VARIABILITY REPORT} $vn] >= 0} { |
123 |
|
puts $fi "$vn= $radvar($vn)" |
124 |
|
return |
125 |
|
} |
141 |
|
proc load_vars {f {vl all}} { # load RIF variables |
142 |
|
global curmess radvar alldone |
143 |
|
if {"$f" == ""} {return 0} |
144 |
< |
if {! [file exists $f]} { |
144 |
> |
if {! [file isfile $f]} { |
145 |
|
beep |
146 |
|
set curmess "$f: no such file." |
147 |
|
return 0 |
236 |
|
return 0 |
237 |
|
} |
238 |
|
} elseif {[file exists $f]} { |
239 |
+ |
set ftyp [file type $f] |
240 |
+ |
if { $ftyp != "file" } { |
241 |
+ |
beep |
242 |
+ |
set curmess "Selected file $f is a $ftyp." |
243 |
+ |
return 0 |
244 |
+ |
} |
245 |
|
if [tk_dialog .dlg {Verification} \ |
246 |
|
"Overwrite existing file $f?" \ |
247 |
|
questhead 1 {Go Ahead} {Cancel}] { |
248 |
|
return 0 |
249 |
|
} |
250 |
|
} |
251 |
< |
if {[file exists $f] && ! [file writable $f] && |
251 |
> |
if {[file isfile $f] && ! [file writable $f] && |
252 |
|
[catch {exec chmod u+w $f} curmess]} { |
253 |
|
beep |
254 |
|
return 0 |
265 |
|
proc newnew f { # create a new RIF |
266 |
|
global rifname readonly curmess radvar |
267 |
|
if [file exists $f] { |
268 |
+ |
set ftyp [file type $f] |
269 |
+ |
if { $ftyp != "file" } { |
270 |
+ |
beep |
271 |
+ |
set curmess "Selected file $f is a $ftyp." |
272 |
+ |
return 0 |
273 |
+ |
} |
274 |
|
if [tk_dialog .dlg {Verification} \ |
275 |
|
"File $f exists -- disregard it?" \ |
276 |
|
questhead 1 {Yes} {Cancel}] { |
288 |
|
} |
289 |
|
|
290 |
|
proc do_file w { |
291 |
< |
global rifname readonly rif_glob curfile curpat |
291 |
> |
global rifname readonly myglob curfile curpat |
292 |
|
if {"$w" == "done"} { |
293 |
|
cd [file dirname $rifname] |
294 |
< |
set rif_glob $curpat |
294 |
> |
set myglob(rif) $curpat |
295 |
|
return |
296 |
|
} |
297 |
|
frame $w |
312 |
|
helplink $w.left.new trad file new |
313 |
|
helplink $w.left.ro trad file readonly |
314 |
|
getfile -view view_txt -perm \ |
315 |
< |
-win $w.right -glob [file dirname $rifname]/$rif_glob |
315 |
> |
-win $w.right -glob [file dirname $rifname]/$myglob(rif) |
316 |
|
set curfile [file tail $rifname] |
317 |
|
} |