| 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 |
|
} |
| 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 |
|
} |