[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34606] trunk/blender/source/blender/ render/intern/source/convertblender.c: Fix for [#25879] Particle Duplication issue with Linked in Objects from Groups.

Janne Karhu jhkarh at gmail.com
Tue Feb 1 16:02:25 CET 2011


Revision: 34606
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34606
Author:   jhk
Date:     2011-02-01 15:02:25 +0000 (Tue, 01 Feb 2011)
Log Message:
-----------
Fix for [#25879] Particle Duplication issue with Linked in Objects from Groups.
* Only the first object (in scene object order) that instanced a dupligroup was rendered properly, because particle instances were checked for only after creating the render object (and even this check was done wrong).
* Now the actual render object is created only after both object and particle instances have been checked.

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

Modified: trunk/blender/source/blender/render/intern/source/convertblender.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/convertblender.c	2011-02-01 13:35:21 UTC (rev 34605)
+++ trunk/blender/source/blender/render/intern/source/convertblender.c	2011-02-01 15:02:25 UTC (rev 34606)
@@ -4765,6 +4765,8 @@
 						int psysindex;
 						float mat[4][4];
 
+						obi=NULL;
+
 						/* instances instead of the actual object are added in two cases, either
 						 * this is a duplivert/face/particle, or it is a non-animated object in
 						 * a dupligroup that has already been created before */
@@ -4789,15 +4791,14 @@
 									find_dupli_instances(re, obr);
 							}
 						}
-						else
-							/* can't instance, just create the object */
-							init_render_object(re, obd, ob, dob, timeoffset, vectorlay);
 
 						/* same logic for particles, each particle system has it's own object, so
 						 * need to go over them separately */
 						psysindex= 1;
 						for(psys=obd->particlesystem.first; psys; psys=psys->next) {
-							if(dob->type != OB_DUPLIGROUP || (obr=find_dupligroup_dupli(re, ob, psysindex))) {
+							if(dob->type != OB_DUPLIGROUP || (obr=find_dupligroup_dupli(re, obd, psysindex))) {
+								if(obi == NULL)
+									mul_m4_m4m4(mat, dob->mat, re->viewmat);
 								obi= RE_addRenderInstance(re, NULL, obd, ob, dob->index, psysindex++, mat, obd->lay);
 
 								set_dupli_tex_mat(re, obi, dob);
@@ -4813,6 +4814,10 @@
 								}
 							}
 						}
+
+						if(obi==NULL)
+							/* can't instance, just create the object */
+							init_render_object(re, obd, ob, dob, timeoffset, vectorlay);
 						
 						if(dob->type != OB_DUPLIGROUP) {
 							obd->flag |= OB_DONE;




More information about the Bf-blender-cvs mailing list