fix [#26727] Make Proxy ignores group offset
authorCampbell Barton <ideasman42@gmail.com>
Sat, 2 Apr 2011 01:36:40 +0000 (01:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 2 Apr 2011 01:36:40 +0000 (01:36 +0000)
source/blender/blenkernel/intern/object.c

index ca31cd1..56a209e 100644 (file)
@@ -1563,6 +1563,9 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
        if(gob) {
                ob->rotmode= target->rotmode;
                mul_m4_m4m4(ob->obmat, target->obmat, gob->obmat);
+               if(gob->dup_group) { /* should always be true */
+                       sub_v3_v3(ob->obmat[3], gob->dup_group->dupli_ofs);
+               }
                object_apply_mat4(ob, ob->obmat, FALSE, TRUE);
        }
        else {
@@ -2556,6 +2559,9 @@ void object_handle_update(Scene *scene, Object *ob)
                                        Object *obg= ob->proxy_from->proxy_group;
                                        invert_m4_m4(obg->imat, obg->obmat);
                                        mul_m4_m4m4(ob->obmat, ob->proxy_from->obmat, obg->imat);
+                                       if(obg->dup_group) { /* should always be true */
+                                               add_v3_v3(ob->obmat[3], obg->dup_group->dupli_ofs);
+                                       }
                                }
                                else
                                        copy_m4_m4(ob->obmat, ob->proxy_from->obmat);