diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-11-03 19:51:25 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-11-03 19:51:25 +0300 |
commit | ee4b32c41a4a20cd82d10af7fefd9b20e29a77f3 (patch) | |
tree | 48f3e3f533d1407714e1091ea7654a5a82641d41 /source/blender/blenkernel | |
parent | 57fd35ae262e2a901a40e576816fb4567fc98f87 (diff) |
Fix for [#21958] Dupli group doesn't show up if linked on a layer that is different from the group layer
* Object layer flag was set too soon for group duplication.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 500161fee2e..547d3f7a738 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -796,6 +796,7 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n DupliObject *dob; vertexDupliData *vdd= userData; float vec[3], q2[4], mat[3][3], tmat[4][4], obmat[4][4]; + int origlay; mul_v3_m4v3(vec, vdd->pmat, co); sub_v3_v3(vec, vdd->pmat[3]); @@ -818,7 +819,14 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n copy_m4_m4(tmat, obmat); mul_m4_m4m3(obmat, tmat, mat); } + + origlay = vdd->ob->lay; + dob= new_dupli_object(vdd->lb, vdd->ob, obmat, vdd->par->lay, index, OB_DUPLIVERTS, vdd->animated); + + /* restore the original layer so that each dupli will have proper dob->origlay */ + vdd->ob->lay = origlay; + if(vdd->orco) VECCOPY(dob->orco, vdd->orco[index]); @@ -928,6 +936,14 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl vertex_dupli__mapFunc(&vdd, a, vec, no, NULL); } } + if(sce) { + /* Set proper layer in case of scene looping, + * in case of groups the object layer will be + * changed when it's duplicated due to the + * group duplication. + */ + ob->lay = vdd.par->lay; + } break; } |