ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapsrc.c
(Generate patch)

Comparing ray/src/rt/pmapsrc.c (file contents):
Revision 2.8 by greg, Tue Sep 1 16:27:53 2015 UTC vs.
Revision 2.11 by rschregle, Tue Oct 27 19:06:54 2015 UTC

# Line 525 | Line 525 | void getPhotonPorts ()
525   /* Find geometry declared as photon ports */
526   {
527     OBJECT i;
528 <   OBJREC* obj;
528 >   OBJREC *obj, *mat;
529    
530     /* Check for missing port modifiers */
531     if (!ambset [0])
532 <      error(USER, "no photon ports found");
532 >      error(USER, "no photon ports");
533    
534     for (i = 0; i < nobjects; i++) {
535        obj = objptr(i);
536 +      mat = findmaterial(obj);
537        
538 <      if (inset(ambset, obj -> omod)) {
538 >      /* Check if object is a surface and NOT a light source (duh) and
539 >       * resolve its material via any aliases, then check for inclusion in
540 >       * port modifier list */
541 >      if (issurface(obj -> otype) && !islight(mat -> otype) &&
542 >          inset(ambset, objndx(mat))) {
543           /* Add photon port */
544           photonPorts = (SRCREC*)realloc(photonPorts,
545                                          (numPhotonPorts + 1) *
# Line 552 | Line 557 | void getPhotonPorts ()
557           numPhotonPorts++;
558        }
559     }
560 +  
561 +   if (!numPhotonPorts)
562 +      error(USER, "no valid photon ports found");
563   }
564  
565  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines