"Set origin to cursor" tool failed for parented/rotated objects.
Matrix mashup.

Thanks to Ben Batt for the fix!
This commit is contained in:
Ton Roosendaal 2012-11-04 12:33:58 +00:00
parent 2a8ce1f121
commit 5b33146875

@ -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);