[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35475] trunk/blender/source/blender/ render/intern/source/strand.c: Fix #25654: strand render with instanced objects was not working right,

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Mar 11 22:37:18 CET 2011


Revision: 35475
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35475
Author:   blendix
Date:     2011-03-11 21:37:17 +0000 (Fri, 11 Mar 2011)
Log Message:
-----------
Fix #25654: strand render with instanced objects was not working right,
some coordinates didn't have the instance matrix applied, while others had
it applied twice.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/strand.c

Modified: trunk/blender/source/blender/render/intern/source/strand.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/strand.c	2011-03-11 17:59:40 UTC (rev 35474)
+++ trunk/blender/source/blender/render/intern/source/strand.c	2011-03-11 21:37:17 UTC (rev 35475)
@@ -666,8 +666,9 @@
 		obi= sseg->obi - re->objectinstance;
 		index= sseg->strand->index;
 
-		  projectvert(p1->co, winmat, hoco1);
-		  projectvert(p2->co, winmat, hoco2);
+		projectvert(p1->co, winmat, hoco1);
+		projectvert(p2->co, winmat, hoco2);
+
   
 		for(a=0; a<totzspan; a++) {
 #if 0
@@ -855,7 +856,7 @@
 		else if(!shadow && (ma->mode & MA_ONLYCAST))
 			continue;
 
-		if(clip_render_object(obi->obr->boundbox, bounds, winmat))
+		if(clip_render_object(obi->obr->boundbox, bounds, obwinmat))
 			continue;
 		
 		widthx= obr->strandbuf->maxwidth*obwinmat[0][0];
@@ -864,7 +865,7 @@
 		/* for each bounding box containing a number of strands */
 		sbound= obr->strandbuf->bound;
 		for(c=0; c<obr->strandbuf->totbound; c++, sbound++) {
-			if(clip_render_object(sbound->boundbox, bounds, winmat))
+			if(clip_render_object(sbound->boundbox, bounds, obwinmat))
 				continue;
 
 			/* for each strand in this bounding box */
@@ -931,11 +932,6 @@
 			obi= &re->objectinstance[sortseg->obi];
 			obr= obi->obr;
 
-			if(obi->flag & R_TRANSFORMED)
-				mul_m4_m4m4(obwinmat, obi->mat, winmat);
-			else
-				copy_m4_m4(obwinmat, winmat);
-
 			sseg.obi= obi;
 			sseg.strand= RE_findOrAddStrand(obr, sortseg->strand);
 			sseg.buffer= sseg.strand->buffer;
@@ -951,7 +947,7 @@
 
 			spart.segment= &sseg;
 
-			render_strand_segment(re, obwinmat, &spart, &zspan, 1, &sseg);
+			render_strand_segment(re, winmat, &spart, &zspan, 1, &sseg);
 		}
 	}
 




More information about the Bf-blender-cvs mailing list