Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2011-02-01 18:02:25 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-02-01 18:02:25 +0300
commit4037eda069dab7a37ada9c77f5aa8fc1d7ca0726 (patch)
tree99c35dcd4286625b802d22b3061ad6923ff8e804
parent67b1cdd953909a3b25ddba7e15122008e3d7e348 (diff)
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.
-rw-r--r--source/blender/render/intern/source/convertblender.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index f7fecca6a60..b5c53e8cb39 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -4765,6 +4765,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
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 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
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 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
}
}
}
+
+ 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;