Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_gizmo_3d.c
| Show First 20 Lines • Show All 2,193 Lines • ▼ Show 20 Lines | if ((ED_transform_calc_gizmo_stats(C, | ||||
| .orientation_type = orient_slot->type + 1, | .orientation_type = orient_slot->type + 1, | ||||
| .orientation_index_custom = orient_slot->index_custom, | .orientation_index_custom = orient_slot->index_custom, | ||||
| }, | }, | ||||
| &tbounds) == 0) || | &tbounds) == 0) || | ||||
| equals_v3v3(rv3d->tw_axis_min, rv3d->tw_axis_max)) { | equals_v3v3(rv3d->tw_axis_min, rv3d->tw_axis_max)) { | ||||
| WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, true); | WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, true); | ||||
| } | } | ||||
| else { | else { | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | |||||
| Object *ob = OBACT(view_layer); | |||||
| if (ob && ob->mode & OB_MODE_EDIT) { | |||||
| copy_m4_m4(gz->matrix_space, ob->obmat); | |||||
| } | |||||
| else { | |||||
| unit_m4(gz->matrix_space); | |||||
| } | |||||
| gizmo_prepare_mat(C, rv3d, &tbounds); | gizmo_prepare_mat(C, rv3d, &tbounds); | ||||
| WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); | WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); | ||||
| WM_gizmo_set_flag(gz, WM_GIZMO_MOVE_CURSOR, true); | WM_gizmo_set_flag(gz, WM_GIZMO_MOVE_CURSOR, true); | ||||
| float dims[3]; | float dims[3]; | ||||
| sub_v3_v3v3(dims, rv3d->tw_axis_max, rv3d->tw_axis_min); | sub_v3_v3v3(dims, rv3d->tw_axis_max, rv3d->tw_axis_min); | ||||
| RNA_float_set_array(gz->ptr, "dimensions", dims); | RNA_float_set_array(gz->ptr, "dimensions", dims); | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | static void WIDGETGROUP_xform_cage_message_subscribe(const bContext *C, | ||||
| ScrArea *area = CTX_wm_area(C); | ScrArea *area = CTX_wm_area(C); | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| gizmo_xform_message_subscribe(gzgroup, mbus, scene, screen, area, region, VIEW3D_GGT_xform_cage); | gizmo_xform_message_subscribe(gzgroup, mbus, scene, screen, area, region, VIEW3D_GGT_xform_cage); | ||||
| } | } | ||||
| static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup) | static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup) | ||||
| { | { | ||||
| struct XFormCageWidgetGroup *xgzgroup = gzgroup->customdata; | struct XFormCageWidgetGroup *xgzgroup = gzgroup->customdata; | ||||
| wmGizmo *gz = xgzgroup->gizmo; | |||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | |||||
| Object *ob = OBACT(view_layer); | |||||
| if (ob && ob->mode & OB_MODE_EDIT) { | |||||
| copy_m4_m4(gz->matrix_space, ob->obmat); | |||||
| } | |||||
| else { | |||||
| unit_m4(gz->matrix_space); | |||||
| } | |||||
| RegionView3D *rv3d = CTX_wm_region_view3d(C); | RegionView3D *rv3d = CTX_wm_region_view3d(C); | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| const TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get(scene, | const TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get(scene, | ||||
| SCE_ORIENT_SCALE); | SCE_ORIENT_SCALE); | ||||
| switch (orient_slot->type) { | switch (orient_slot->type) { | ||||
| case V3D_ORIENT_VIEW: { | case V3D_ORIENT_VIEW: { | ||||
| ▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines | |||||