Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-12-07 12:42:14 +0300
committerAntonioya <blendergit@gmail.com>2018-12-07 12:42:14 +0300
commit20261a7581df8b2f06f48366e37e4b94ba9b3719 (patch)
tree76f4f7a6072f84abf64aab11ad3d1601551a9e34 /source
parent32aefb6fbaa6478fec603e818adf0afb7646273c (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')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c6
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);