bugfix [#22407] Object level proxies ignore transform of original

This commit is contained in:
2010-10-12 21:47:13 +00:00
parent 4754d6a27d
commit b64098a85a

View File

@@ -1264,6 +1264,17 @@ static void copy_object_pose(Object *obn, Object *ob)
}
}
static void copy_object_transform(Object *ob_tar, Object *ob_src)
{
copy_v3_v3(ob_tar->loc, ob_src->loc);
copy_v3_v3(ob_tar->rot, ob_src->rot);
copy_v3_v3(ob_tar->quat, ob_src->quat);
copy_v3_v3(ob_tar->rotAxis, ob_src->rotAxis);
ob_tar->rotAngle= ob_src->rotAngle;
ob_tar->rotmode= ob_src->rotmode;
copy_v3_v3(ob_tar->size, ob_src->size);
}
Object *copy_object(Object *ob)
{
Object *obn;
@@ -1530,23 +1541,23 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
ob->recalc= target->recalc= OB_RECALC_ALL;
/* copy transform */
/* copy transform
* - gob means this proxy comes from a group, just apply the matrix
* so the object wont move from its dupli-transform.
*
* - no gob means this is being made from a linked object,
* this is closer to making a copy of the object - in-place. */
if(gob) {
VECCOPY(ob->loc, gob->loc);
VECCOPY(ob->rot, gob->rot);
VECCOPY(ob->size, gob->size);
group_tag_recalc(gob->dup_group);
ob->rotmode= target->rotmode;
mul_m4_m4m4(ob->obmat, target->obmat, gob->obmat);
object_apply_mat4(ob, ob->obmat);
}
else {
VECCOPY(ob->loc, target->loc);
VECCOPY(ob->rot, target->rot);
VECCOPY(ob->size, target->size);
copy_object_transform(ob, target);
ob->parent= target->parent; /* libdata */
copy_m4_m4(ob->parentinv, target->parentinv);
}
ob->parent= target->parent; /* libdata */
copy_m4_m4(ob->parentinv, target->parentinv);
/* copy animdata stuff - drivers only for now... */
object_copy_proxy_drivers(ob, target);