From 20261a7581df8b2f06f48366e37e4b94ba9b3719 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Fri, 7 Dec 2018 10:42:14 +0100 Subject: Fix T58913 Won't focus on Grease Pencil When the datablock was empty, the center was not calculated. Now it uses the object location. --- source/blender/editors/space_view3d/view3d_edit.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') 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); -- cgit v1.2.3