Fix object "Set Origin" operating on linked library data
Regression in d25747ee75
This commit is contained in:
parent
1a1510a3a0
commit
b2f2daf21f
Notes:
blender-bot
2023-02-13 22:19:22 +01:00
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -1198,32 +1198,33 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
|
|||
else if (ID_IS_LINKED(ob->data)) {
|
||||
tot_lib_error++;
|
||||
}
|
||||
else if (ob->type == OB_MESH) {
|
||||
if (obedit == NULL) {
|
||||
Mesh *me = ob->data;
|
||||
|
||||
if (obedit == NULL && ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
if (centermode == ORIGIN_TO_CURSOR) {
|
||||
/* done */
|
||||
}
|
||||
else if (centermode == ORIGIN_TO_CENTER_OF_MASS_SURFACE) {
|
||||
BKE_mesh_center_of_surface(me, cent);
|
||||
}
|
||||
else if (centermode == ORIGIN_TO_CENTER_OF_MASS_VOLUME) {
|
||||
BKE_mesh_center_of_volume(me, cent);
|
||||
}
|
||||
else if (around == V3D_AROUND_CENTER_BOUNDS) {
|
||||
BKE_mesh_center_bounds(me, cent);
|
||||
}
|
||||
else { /* #V3D_AROUND_CENTER_MEDIAN. */
|
||||
BKE_mesh_center_median(me, cent);
|
||||
}
|
||||
|
||||
if (centermode == ORIGIN_TO_CURSOR) {
|
||||
/* done */
|
||||
}
|
||||
else if (centermode == ORIGIN_TO_CENTER_OF_MASS_SURFACE) {
|
||||
BKE_mesh_center_of_surface(me, cent);
|
||||
}
|
||||
else if (centermode == ORIGIN_TO_CENTER_OF_MASS_VOLUME) {
|
||||
BKE_mesh_center_of_volume(me, cent);
|
||||
}
|
||||
else if (around == V3D_AROUND_CENTER_MEDIAN) {
|
||||
BKE_mesh_center_median(me, cent);
|
||||
}
|
||||
else {
|
||||
BKE_mesh_center_bounds(me, cent);
|
||||
}
|
||||
negate_v3_v3(cent_neg, cent);
|
||||
BKE_mesh_translate(me, cent_neg, 1);
|
||||
|
||||
negate_v3_v3(cent_neg, cent);
|
||||
BKE_mesh_translate(me, cent_neg, 1);
|
||||
|
||||
tot_change++;
|
||||
me->id.tag |= LIB_TAG_DOIT;
|
||||
do_inverse_offset = true;
|
||||
tot_change++;
|
||||
me->id.tag |= LIB_TAG_DOIT;
|
||||
do_inverse_offset = true;
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
|
|
Loading…
Reference in New Issue