Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2012-11-04 16:33:58 +0400
committerTon Roosendaal <ton@blender.org>2012-11-04 16:33:58 +0400
commit5b33146875c7be625a400737eab040e00c3aad71 (patch)
treecf951f2fb83bc60ecd34fe4efa7bd21e3eed60ac /source/blender/editors/object
parent2a8ce1f12162593ad9c1db3422d35530c5d05dc2 (diff)
Bugfix #32987
"Set origin to cursor" tool failed for parented/rotated objects. Matrix mashup. Thanks to Ben Batt for the fix!
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_transform.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 4476296866e..900bf57b509 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -903,11 +903,16 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* offset other selected objects */
if (do_inverse_offset && (centermode != GEOMETRY_TO_ORIGIN)) {
CollectionPointerLink *ctx_link_other;
+ float obmat[4][4];
/* was the object data modified
* note: the functions above must set 'cent' */
+
+ /* convert the offset to parent space */
+ BKE_object_to_mat4(ob, obmat);
copy_v3_v3(centn, cent);
- mul_mat3_m4_v3(ob->obmat, centn); /* ommit translation part */
+ mul_mat3_m4_v3(obmat, centn); /* omit translation part */
+
add_v3_v3(ob->loc, centn);
BKE_object_where_is_calc(scene, ob);