Fix for particle dupli group relative offsets. The relative transforms of objects in the instanced group were not scaled according to the particle size, which would be expected when rendering as 'Whole Group'. Requested by Francesco Siddi (fsiddi) over IRC.
This commit is contained in:
@@ -1407,17 +1407,16 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
|
||||
if (part->ren_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
|
||||
for (go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
|
||||
|
||||
/* group dupli offset, should apply after everything else */
|
||||
if (!is_zero_v3(part->dup_group->dupli_ofs)) {
|
||||
copy_m4_m4(tmat, oblist[b]->obmat);
|
||||
sub_v3_v3v3(tmat[3], tmat[3], part->dup_group->dupli_ofs);
|
||||
mult_m4_m4m4(tmat, pamat, tmat);
|
||||
}
|
||||
else {
|
||||
mult_m4_m4m4(tmat, pamat, oblist[b]->obmat);
|
||||
}
|
||||
|
||||
/* apply particle scale */
|
||||
mul_mat3_m4_fl(tmat, size*scale);
|
||||
mul_v3_fl(tmat[3], size*scale);
|
||||
/* group dupli offset, should apply after everything else */
|
||||
if (!is_zero_v3(part->dup_group->dupli_ofs))
|
||||
sub_v3_v3v3(tmat[3], tmat[3], part->dup_group->dupli_ofs);
|
||||
/* individual particle transform */
|
||||
mult_m4_m4m4(tmat, pamat, tmat);
|
||||
|
||||
if (par_space_mat)
|
||||
mult_m4_m4m4(mat, par_space_mat, tmat);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user