Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_gizmo_3d.c
| Show First 20 Lines • Show All 1,094 Lines • ▼ Show 20 Lines | static void gizmo_prepare_mat(const bContext *C, | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| switch (scene->toolsettings->transform_pivot_point) { | switch (scene->toolsettings->transform_pivot_point) { | ||||
| case V3D_AROUND_CENTER_BOUNDS: | case V3D_AROUND_CENTER_BOUNDS: | ||||
| case V3D_AROUND_ACTIVE: { | case V3D_AROUND_ACTIVE: { | ||||
| mid_v3_v3v3(rv3d->twmat[3], tbounds->min, tbounds->max); | mid_v3_v3v3(rv3d->twmat[3], tbounds->min, tbounds->max); | ||||
| if (scene->toolsettings->transform_pivot_point == V3D_AROUND_ACTIVE) { | if (scene->toolsettings->transform_pivot_point == V3D_AROUND_ACTIVE) { | ||||
| BKE_view_layer_synced_ensure(scene, view_layer); | |||||
| Object *ob = BKE_view_layer_active_object_get(view_layer); | |||||
| if (ob != NULL) { | |||||
| /* Grease Pencil uses object origin. */ | |||||
| bGPdata *gpd = CTX_data_gpencil_data(C); | bGPdata *gpd = CTX_data_gpencil_data(C); | ||||
| if (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE)) { | if (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE)) { | ||||
| /* pass */ | ED_object_calc_active_center(ob, false, rv3d->twmat[3]); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_view_layer_synced_ensure(scene, view_layer); | |||||
| Object *ob = BKE_view_layer_active_object_get(view_layer); | |||||
| if (ob != NULL) { | |||||
| if ((ob->mode & OB_MODE_ALL_SCULPT) && ob->sculpt) { | if ((ob->mode & OB_MODE_ALL_SCULPT) && ob->sculpt) { | ||||
| SculptSession *ss = ob->sculpt; | SculptSession *ss = ob->sculpt; | ||||
| copy_v3_v3(rv3d->twmat[3], ss->pivot_pos); | copy_v3_v3(rv3d->twmat[3], ss->pivot_pos); | ||||
| } | } | ||||
| else { | else { | ||||
| ED_object_calc_active_center(ob, false, rv3d->twmat[3]); | ED_object_calc_active_center(ob, false, rv3d->twmat[3]); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,442 Lines • Show Last 20 Lines | |||||