Fix T93011: Individual origins being used when pivot point is override

There should be a special `t->around` for this case, but for now let's
just avoid having the individual origins overlap.
This commit is contained in:
Germano Cavalcante 2021-11-16 13:50:05 -03:00
parent bd37553850
commit 1572c4d3d3
Notes: blender-bot 2023-02-14 07:31:34 +01:00
Referenced by issue #93011, Scale Cage Tool doesn't work when using individual origin pivot point
1 changed files with 14 additions and 9 deletions

View File

@ -152,6 +152,11 @@ static void *t_view_get(TransInfo *t)
static int t_around_get(TransInfo *t)
{
if (t->flag & T_OVERRIDE_CENTER) {
/* Avoid initialization of individual origins (#V3D_AROUND_LOCAL_ORIGINS). */
return V3D_AROUND_CENTER_BOUNDS;
}
ScrArea *area = t->area;
if (t->spacetype == SPACE_VIEW3D) {
/* Bend always uses the cursor. */
@ -364,6 +369,15 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->options |= CTX_SEQUENCER_IMAGE;
}
setTransformViewAspect(t, t->aspect);
if (op && (prop = RNA_struct_find_property(op->ptr, "center_override")) &&
RNA_property_is_set(op->ptr, prop)) {
RNA_property_float_get_array(op->ptr, prop, t->center_global);
mul_v3_v3(t->center_global, t->aspect);
t->flag |= T_OVERRIDE_CENTER;
}
t->view = t_view_get(t);
t->around = t_around_get(t);
@ -664,15 +678,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->flag |= T_NO_CURSOR_WRAP;
}
setTransformViewAspect(t, t->aspect);
if (op && (prop = RNA_struct_find_property(op->ptr, "center_override")) &&
RNA_property_is_set(op->ptr, prop)) {
RNA_property_float_get_array(op->ptr, prop, t->center_global);
mul_v3_v3(t->center_global, t->aspect);
t->flag |= T_OVERRIDE_CENTER;
}
setTransformViewMatrices(t);
initNumInput(&t->num);
}