[Bf-blender-cvs] [20261a7581d] blender2.8: Fix T58913 Won't focus on Grease Pencil

Antonioya noreply at git.blender.org
Fri Dec 7 10:42:32 CET 2018


Commit: 20261a7581df8b2f06f48366e37e4b94ba9b3719
Author: Antonioya
Date:   Fri Dec 7 10:42:14 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB20261a7581df8b2f06f48366e37e4b94ba9b3719

Fix T58913 Won't focus on Grease Pencil

When the datablock was empty, the center was not calculated. Now it uses the object location.

===================================================================

M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list