diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-09-29 14:38:12 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-09-29 14:38:31 +0300 |
commit | f6c2f1c65e146bf20b9182f275b67c747d9e2990 (patch) | |
tree | 46d396b31c634bb9b3de7527c4addf5fc958ae7f /source/blender/editors/transform | |
parent | b70b02ee429d323a83c2e90e189a753bcabe0bf5 (diff) |
Fix T101455: GPencil Gizmo in wrong location when using Active Element
The gizmo was not set when this option was selected.
By design, in grease pencil the active element option uses
the object origin as pivot point.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_3d.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 8e6a6c2c411..32e9421f50d 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -1101,8 +1101,13 @@ static void gizmo_prepare_mat(const bContext *C, if (scene->toolsettings->transform_pivot_point == V3D_AROUND_ACTIVE) { bGPdata *gpd = CTX_data_gpencil_data(C); + /* Grease Pencil uses object origin. */ if (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE)) { - /* pass */ + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); + if (ob != NULL) { + ED_object_calc_active_center(ob, false, rv3d->twmat[3]); + } } else { BKE_view_layer_synced_ensure(scene, view_layer); |