fix [#26727] Make Proxy ignores group offset
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Apr 2011 17:19:32 +0000 (17:19 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Apr 2011 17:19:32 +0000 (17:19 +0000)
source/blender/blenkernel/intern/object.c

index 29fa731594d08dab4dd4782d2885cf96aab6b942..7e85fa5bf38fd7db3958d48984362b3bb7c5fe88 100644 (file)
@@ -1550,7 +1550,10 @@ void object_make_proxy(Object *ob, Object *target, Object *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);
+                       float tvec[3];
+                       copy_v3_v3(tvec, gob->dup_group->dupli_ofs);
+                       mul_mat3_m4_v3(ob->obmat, tvec);
+                       sub_v3_v3(ob->obmat[3], tvec);
                }
                object_apply_mat4(ob, ob->obmat, FALSE, TRUE);
        }
@@ -2546,7 +2549,10 @@ void object_handle_update(Scene *scene, Object *ob)
                                        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);
+                                               float tvec[3];
+                                               copy_v3_v3(tvec, obg->dup_group->dupli_ofs);
+                                               mul_mat3_m4_v3(ob->obmat, tvec);
+                                               sub_v3_v3(ob->obmat[3], tvec);
                                        }
                                }
                                else