--- ray/src/util/do_file.tcl 1994/12/06 15:54:45 2.3 +++ ray/src/util/do_file.tcl 1995/07/06 12:15:54 2.9 @@ -19,7 +19,7 @@ proc preen {} { # clean up radvar set n 1 foreach v $oldval { if {"[string index $v 0]" == "-"} { - lappend radvar(view) "$n $v" + lappend radvar(view) "u$n $v" } elseif {[lsearch -glob $radvar(view) \ "[lindex $v 0] *"] >= 0} { continue @@ -66,6 +66,11 @@ proc preen {} { # clean up radvar } else { set radvar(PENUMBRAS) False } + if [info exists radvar(RAWSAVE)] { + cardval radvar(RAWSAVE) {True False} + } else { + set radvar(RAWSAVE) False + } if [info exists radvar(VARIABILITY)] { cardval radvar(VARIABILITY) {High Medium Low} } else { @@ -98,6 +103,7 @@ proc setradvar stmt { # assign a rad variable IND* { set radvar(INDIRECT) $vval } DET* { set radvar(DETAIL) $vval } PEN* { set radvar(PENUMBRAS) $vval } + RAW* { set radvar(RAWSAVE) $vval } VAR* { set radvar(VARIABILITY) $vval } REP* { set radvar(REPORT) $vval } } @@ -119,7 +125,7 @@ proc putradvar {fi vn} { # print out a rad variable } if {[lsearch -exact {ZONE QUALITY OCTREE PICTURE AMBFILE OPTFILE EXPOSURE RESOLUTION UP INDIRECT DETAIL PENUMBRAS - VARIABILITY REPORT} $vn] >= 0} { + RAWSAVE VARIABILITY REPORT} $vn] >= 0} { puts $fi "$vn= $radvar($vn)" return } @@ -167,7 +173,7 @@ proc load_vars {f {vl all}} { # load RIF variables set curmess {Project loaded.} } else { foreach n $vl { - set radvar($n) {} + catch {unset radvar($n)} } while {[gets $fi curli] != -1} { if [regexp {^[a-zA-Z][a-zA-Z0-9]* *=} $curli] { @@ -242,6 +248,11 @@ proc newsave f { # save a RIF return 0 } } + if {[file exists $f] && ! [file writable $f] && + [catch {exec chmod u+w $f} curmess]} { + beep + return 0 + } if [save_vars $f] { set rifname [pwd]/$f set readonly 0 @@ -282,8 +293,8 @@ proc do_file w { pack $w.left -side left button $w.left.load -text LOAD -width 5 \ -relief raised -command {newload $curfile} - button $w.left.save -text SAVE -width 5 \ - -relief raised -command {newsave $curfile} + button $w.left.save -text SAVE -width 5 -relief raised \ + -command "newsave \$curfile; update_dir $w.right" button $w.left.new -text NEW -width 5 \ -relief raised -command {newnew $curfile} pack $w.left.load $w.left.save $w.left.new -side top -pady 15 -padx 20