[brlcad-commits] SF.net SVN: brlcad:[48195] brlcad/trunk/src/tclscripts/mged/anim.tcl
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2012-01-05 02:21:19
|
Revision: 48195 http://brlcad.svn.sourceforge.net/brlcad/?rev=48195&view=rev Author: brlcad Date: 2012-01-05 02:21:11 +0000 (Thu, 05 Jan 2012) Log Message: ----------- quote the animation commands being piped via open(n) since filepaths with spaces look like the command name. this is in response to sf bug 3466818 from nephesh (hwangbo) (how to solve the edit animation curve) where a common install of BRL-CAD into the usual Program Files directory was problematic. Modified Paths: -------------- brlcad/trunk/src/tclscripts/mged/anim.tcl Modified: brlcad/trunk/src/tclscripts/mged/anim.tcl =================================================================== --- brlcad/trunk/src/tclscripts/mged/anim.tcl 2012-01-04 15:28:04 UTC (rev 48194) +++ brlcad/trunk/src/tclscripts/mged/anim.tcl 2012-01-05 02:21:11 UTC (rev 48195) @@ -622,7 +622,7 @@ set end [lindex $tlist [expr $length - 1]] set tabinterp [file join ${mged_sketch_tab_path} tabinterp] - set fo [open "| $tabinterp -q > $mged_sketch_temp1" w] + set fo [open "| \"$tabinterp\" -q > \"$mged_sketch_temp1\"" w] puts $fo "file $mged_sketch_temp2 0 1 2;" puts $fo [concat times $start $end $mged_sketch_fps {;}] puts $fo "interp $cmdstr 0 1 2;" @@ -1092,7 +1092,7 @@ set chan_permute [file join ${mged_sketch_anim_path} chan_permute] switch $oldlist { {size eye quat} { - set fd [open "| $anim_orient qv y > $mged_sketch_temp1 " w] + set fd [open "| \"$anim_orient\" qv y > \"$mged_sketch_temp1\"" w] sketch_text_to_fd $text $fd "5,6,7,8" catch {close $fd} set fd [open $mged_sketch_temp1 r] @@ -1102,7 +1102,7 @@ file delete $mged_sketch_temp1 } {eye center} { - set fd [open "| $anim_lookat -y -v > $mged_sketch_temp1" w] + set fd [open "| \"$anim_lookat\" -y -v > \"$mged_sketch_temp1\"" w] sketch_text_to_fd $text $fd all close $fd set fd [open $mged_sketch_temp1 r] @@ -1111,7 +1111,7 @@ file delete $mged_sketch_temp1 } {size center ypr} { - set fd [open "| $anim_cascade -ry 0 0 0 > $mged_sketch_temp1" w] + set fd [open "| \"$anim_cascade\" -ry 0 0 0 > \"$mged_sketch_temp1\"" w] sketch_text_do_script $buffer $text all {@0 @2 @3 @4 @5 @6 @7 {-@1/2.0} 0.0 0.0} sketch_text_to_fd $buffer $fd all close $fd @@ -1123,11 +1123,11 @@ file delete $mged_sketch_temp1 } {size center quat} { - set fd [open "| $anim_orient qv y > $mged_sketch_temp1" w] + set fd [open "| \"$anim_orient\" qv y > \"$mged_sketch_temp1\"" w] sketch_text_to_fd $text $fd "5,6,7,8" catch {close $fd} sketch_text_do_script $buffer $text all {@0 @2 @3 @4 {-@1/2.0} 0.0 0.0} - set fd [open "| $chan_permute -i stdin 0 1 2 3 4 5 6 -i $mged_sketch_temp1 8 9 10 -o stdout 0 1 2 3 8 9 10 4 5 6 | $anim_cascade -ry 0 0 0 > $mged_sketch_temp2" w] + set fd [open "| \"$chan_permute\" -i stdin 0 1 2 3 4 5 6 -i $mged_sketch_temp1 8 9 10 -o stdout 0 1 2 3 8 9 10 4 5 6 | \"$anim_cascade\" -ry 0 0 0 > \"$mged_sketch_temp2\"" w] sketch_text_to_fd $buffer $fd all close $fd set fd [open $mged_sketch_temp2 r] @@ -1146,7 +1146,7 @@ #convert from {size eye ypr} switch $newlist { {size eye quat} { - set fd [open "| $anim_orient y qv > $mged_sketch_temp1 " w] + set fd [open "| \"$anim_orient\" y qv > \"$mged_sketch_temp1\"" w] sketch_text_to_fd $text $fd "5,6,7" catch {close $fd} set fd [open $mged_sketch_temp1 r] @@ -1158,7 +1158,7 @@ {eye center} { sketch_text_do_script $buffer $text all \ {@0 @2 @3 @4 @5 @6 @7 {@1*0.5} 0.0 0.0 0.0 0.0 0.0} - set fd [open "| $anim_cascade > $mged_sketch_temp2" w] + set fd [open "| \"$anim_cascade\" > \"$mged_sketch_temp2\"" w] sketch_text_to_fd $buffer $fd all close $fd sketch_text_col_arith $text all {@0 @2 @3 @4} @@ -1168,7 +1168,7 @@ file delete $mged_sketch_temp2 } {size center ypr} { - set fd [open "| $anim_cascade -ry 0 0 0 > $mged_sketch_temp1" w] + set fd [open "| \"$anim_cascade\" -ry 0 0 0 > \"$mged_sketch_temp1\"" w] sketch_text_do_script $buffer $text all {@0 @2 @3 @4 @5 @6 @7 {@1/2.0} 0.0 0.0} sketch_text_to_fd $buffer $fd all close $fd @@ -1180,11 +1180,11 @@ file delete $mged_sketch_temp1 } {size center quat} { - set fd [open "| $anim_cascade -ry 0 0 0 > $mged_sketch_temp1" w] + set fd [open "| \"$anim_cascade\" -ry 0 0 0 > \"$mged_sketch_temp1\"" w] sketch_text_do_script $buffer $text all {@0 @2 @3 @4 @5 @6 @7 {@1/2.0} 0.0 0.0} sketch_text_to_fd $buffer $fd all close $fd - set fd [open "| $chan_permute -i $mged_sketch_temp1 0 1 2 3 4 5 6 -o stdout 4 5 6 | $anim_orient y qv | $chan_permute -i stdin 7 8 9 10 -i $mged_sketch_temp1 0 1 2 3 4 5 6 -o stdout 1 2 3 7 8 9 10" r] + set fd [open "| \"$chan_permute\" -i $mged_sketch_temp1 0 1 2 3 4 5 6 -o stdout 4 5 6 | \"$anim_orient\" y qv | \"$chan_permute\" -i stdin 7 8 9 10 -i $mged_sketch_temp1 0 1 2 3 4 5 6 -o stdout 1 2 3 7 8 9 10" r] $text delete 1.0 end sketch_text_do_script $text $buffer all {@0 {2.0*@7}} sketch_text_from_fd $text $fd all right @@ -1846,7 +1846,7 @@ scan [$w index end] %d maxlen set arg2 "-m $maxlen" set anim_time [file join ${mged_sketch_anim_path} anim_time] - set cmd "| $anim_time $arg0 $arg1 $arg2 > $mged_sketch_temp1" + set cmd "| \"$anim_time\" $arg0 $arg1 $arg2 > \"$mged_sketch_temp1\"" #puts $cmd set f1 [open $cmd w] set mycols "0,$cols" @@ -2252,7 +2252,7 @@ close $fd set tabinterp [file join ${mged_sketch_tab_path} tabinterp] - set fd [open "| $tabinterp -q < $mged_sketch_temp2 " r] + set fd [open "| \"$tabinterp\" -q < \"$mged_sketch_temp2\"" r] sketch_text_from_fd $w $fd all replace #catch can be removed when -q option added to tabinterp catch {close $fd} @@ -2830,7 +2830,7 @@ append outcol " $i" } } - set filecmd "$chan_permute -i $src $incol -o stdout $outcol" + set filecmd "\"$chan_permute\" -i $src $incol -o stdout $outcol" } elseif { $nsrc < $ncols } { tk_dialog ._sketch_msg {Insufficient columns} \ "The animation you requested requires $ncols \ @@ -2867,7 +2867,7 @@ if {$wcen == ""} { set wcen "0 0 0"; incr i } if {$wypr == ""} { set wypr "0 0 0"; incr i } if { $i < 4 } { - set fd [open "| $anim_cascade -or -fc $wcen -fy $wypr -ac $rcen -ay $rypr" r] + set fd [open "| \"$anim_cascade\" -or -fc $wcen -fy $wypr -ac $rcen -ay $rypr" r] gets $fd line close $fd set veye [lrange $line 1 3] @@ -2901,9 +2901,9 @@ from curve." return } elseif { $type == "text" } { - set fd [open "| $anim_lookat -y $lookat_v | \ - $anim_script $opts $ovname > \ - $mged_sketch_objscript" w] + set fd [open "| \"$anim_lookat\" -y $lookat_v | \ + \"$anim_script\" $opts $ovname > \ + \"$mged_sketch_objscript\"" w] sketch_text_to_fd $w $fd $colsp catch {close $fd} return @@ -2932,12 +2932,12 @@ } if { $type == "curve" } { set sfile $mged_sketch_temp1 - set fd [open $sfile w] + set fd [open "$sfile" w] sketch_write_to_fd $fd [vdraw read l] close $fd } elseif { $type == "text" } { set sfile $mged_sketch_temp1 - set fd [open $sfile w] + set fd [open "$sfile" w] sketch_text_to_fd $w $fd "0,1,2,3" close $fd } elseif { $type == "file"} { @@ -2945,7 +2945,7 @@ set sfile $src } else { set sfile $mged_sketch_temp1 - exec $filecmd > $sfile + exec $filecmd > "$sfile" } } @@ -3192,7 +3192,7 @@ close $fd set anim_track [file join ${mged_sketch_anim_path} anim_track] - set fd [open "| $anim_track -c $mged_sketch_temp1" r] + set fd [open "| \"$anim_track\" -c $mged_sketch_temp1" r] catch {flush $fd} gets $fd length catch {close $fd} @@ -3331,7 +3331,7 @@ -d $center $fcmd $wcmd $pcmd" #puts $myargs - set fd [ open "| $anim_track $myargs $mged_sketch_temp1 > $outfile" w] + set fd [ open "| \"$anim_track\" $myargs $mged_sketch_temp1 > \"$outfile\"" w] sketch_text_to_fd $vtext $fd all close $fd file delete $mged_sketch_temp1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |