diff options
author | Antonioya <blendergit@gmail.com> | 2018-12-07 12:42:14 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-12-07 12:42:14 +0300 |
commit | 20261a7581df8b2f06f48366e37e4b94ba9b3719 (patch) | |
tree | 76f4f7a6072f84abf64aab11ad3d1601551a9e34 /source/blender/editors | |
parent | 32aefb6fbaa6478fec603e818adf0afb7646273c (diff) |
Fix T58913 Won't focus on Grease Pencil
When the datablock was empty, the center was not calculated. Now it uses the object location.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 6df4b3f82b9..11927d6d530 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2848,6 +2848,12 @@ static int viewselected_exec(bContext *C, wmOperator *op) } else if (ob_eval && (ob_eval->type == OB_GPENCIL)) { ok |= BKE_gpencil_data_minmax(ob_eval, gpd, min, max); + /* if no strokes, use object location */ + if ((ob_eval) && (!ok)) { + copy_v3_v3(min, ob_eval->obmat[3]); + copy_v3_v3(max, ob_eval->obmat[3]); + ok = true; + } } else if (is_face_map) { ok = WM_gizmomap_minmax(ar->gizmo_map, true, true, min, max); |