Fix T77206: G + MMB Doesn't work in Graph Editor if the transform orientation is set to 'Local'
Scene orientation is used only for 3DView.
This commit is contained in:
parent
347c191292
commit
ba711824b3
Notes:
blender-bot
2023-02-14 05:44:22 +01:00
Referenced by issue #77206, G + MMB Doesn't work in Graph Editor if the transform orientation is set to 'Local'
|
@ -1649,13 +1649,17 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
|
|||
}
|
||||
|
||||
{
|
||||
TransformOrientationSlot *orient_slot = &t->scene->orientation_slots[SCE_ORIENT_DEFAULT];
|
||||
short orient_type_set = -1;
|
||||
short orient_type_matrix_set = -1;
|
||||
short orient_type_scene = orient_slot->type;
|
||||
if (orient_type_scene == V3D_ORIENT_CUSTOM) {
|
||||
const int index_custom = orient_slot->index_custom;
|
||||
orient_type_scene += index_custom;
|
||||
short orient_type_scene = V3D_ORIENT_GLOBAL;
|
||||
|
||||
if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) {
|
||||
TransformOrientationSlot *orient_slot = &t->scene->orientation_slots[SCE_ORIENT_DEFAULT];
|
||||
orient_type_scene = orient_slot->type;
|
||||
if (orient_type_scene == V3D_ORIENT_CUSTOM) {
|
||||
const int index_custom = orient_slot->index_custom;
|
||||
orient_type_scene += index_custom;
|
||||
}
|
||||
}
|
||||
|
||||
short orient_types[3];
|
||||
|
|
|
@ -552,28 +552,30 @@ short transform_orientation_matrix_get(bContext *C,
|
|||
return V3D_ORIENT_CUSTOM_MATRIX;
|
||||
}
|
||||
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *obedit = CTX_data_active_object(C);
|
||||
RegionView3D *rv3d = NULL;
|
||||
int orientation_index_custom = 0;
|
||||
|
||||
if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) {
|
||||
rv3d = t->region->regiondata;
|
||||
}
|
||||
if (orientation >= V3D_ORIENT_CUSTOM) {
|
||||
orientation_index_custom = orientation - V3D_ORIENT_CUSTOM;
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *obedit = CTX_data_active_object(C);
|
||||
RegionView3D *rv3d = t->region->regiondata;
|
||||
int orientation_index_custom = 0;
|
||||
|
||||
if (orientation >= V3D_ORIENT_CUSTOM) {
|
||||
orientation_index_custom = orientation - V3D_ORIENT_CUSTOM;
|
||||
}
|
||||
|
||||
return ED_transform_calc_orientation_from_type_ex(C,
|
||||
r_spacemtx,
|
||||
/* extra args (can be accessed from context) */
|
||||
t->scene,
|
||||
rv3d,
|
||||
ob,
|
||||
obedit,
|
||||
orientation,
|
||||
orientation_index_custom,
|
||||
t->around);
|
||||
}
|
||||
|
||||
return ED_transform_calc_orientation_from_type_ex(C,
|
||||
r_spacemtx,
|
||||
/* extra args (can be accessed from context) */
|
||||
t->scene,
|
||||
rv3d,
|
||||
ob,
|
||||
obedit,
|
||||
orientation,
|
||||
orientation_index_custom,
|
||||
t->around);
|
||||
unit_m3(r_spacemtx);
|
||||
return V3D_ORIENT_GLOBAL;
|
||||
}
|
||||
|
||||
const char *transform_orientations_spacename_get(TransInfo *t, const short orient_type)
|
||||
|
|
Loading…
Reference in New Issue