ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/bsdfview.pl
(Generate patch)

Comparing ray/src/util/bsdfview.pl (file contents):
Revision 2.5 by greg, Wed Sep 6 23:57:56 2017 UTC vs.
Revision 2.8 by greg, Wed Jan 26 18:01:41 2022 UTC

# Line 15 | Line 15 | my $raddev = "x11";    # default output device. Overwrite
15   my $qual = "Med";
16   my $usetrad = 0;
17  
18 < my $opts = "";  # Options common to rad
18 > my @range;              # BSDF min and max range
19 > my $opts = "";          # Options common to rad
20   my $rendopts = "-w-";   # For render= line in rif file
21  
22   while (@ARGV) {
# Line 40 | Line 41 | while (@ARGV) {
41                  $opts .= " $_";
42          } elsif (m/^-t\b/) {    # start trad instead of rad
43                  $usetrad = 1;
44 +        } elsif (m/^-r/) {      # specified range for BSDF
45 +                @range = ("-r", $ARGV[1], $ARGV[2]);
46 +                shift @ARGV; shift @ARGV;
47          } elsif (m/^-\w/) {
48                  die("bsdfview: Bad option: $_\n");
49          } else {
# Line 87 | Line 91 | if (-e $rif) {                 # RIF already exists?
91          exit;
92   }
93  
94 + if ($objects[0] =~ /\.xml$/i) {
95 +        system "checkBSDF $objects[0]";
96 +        die "Bad XML input\n" if ( $? );
97 + }
98 +
99   print "bsdfview: creating rad input file '$rif'\n";
100  
101 < my $scene = qq("!bsdf2rad @objects");           # let bsdf2rad do complaining
101 > my $scene = qq("!bsdf2rad @range @objects");    # let bsdf2rad do complaining
102  
103   my $objects = join(' ', @objects);
104   open(FH, ">$rif") or
# Line 118 | Line 127 | EndOfRif
127   close(FH);
128  
129   if ($usetrad) {
130 <        system "trad $rif";
130 >        system "rad -v 0 $rif ; trad $rif";
131   } else {
132          system "rad -o $raddev $opts $rif";
133   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines