[Bf-blender-cvs] [f34a2af4b37] blender2.8: Fix scale cage tool never using object boundbox

Campbell Barton noreply at git.blender.org
Tue Sep 11 08:12:35 CEST 2018


Commit: f34a2af4b37cc9f90ab5739f97796d3e6a273def
Author: Campbell Barton
Date:   Tue Sep 11 16:19:07 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBf34a2af4b37cc9f90ab5739f97796d3e6a273def

Fix scale cage tool never using object boundbox

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

M	source/blender/editors/transform/transform_gizmo_3d.c

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

diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 049fd143a26..55093a1c163 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -57,6 +57,7 @@
 #include "BKE_gpencil.h"
 #include "BKE_scene.h"
 #include "BKE_workspace.h"
+#include "BKE_object.h"
 
 #include "BIF_gl.h"
 
@@ -1067,13 +1068,19 @@ int ED_transform_calc_gizmo_stats(
 			if (ob == NULL) {
 				ob = base->object;
 			}
-			if (params->use_only_center || base->object->bb == NULL) {
+
+			/* Get the boundbox out of the evaluated object. */
+			if (params->use_only_center == false) {
+				bb = BKE_object_boundbox_get(base->object);
+			}
+
+			if (params->use_only_center || (bb == NULL)) {
 				calc_tw_center(tbounds, base->object->obmat[3]);
 			}
 			else {
 				for (uint j = 0; j < 8; j++) {
 					float co[3];
-					mul_v3_m4v3(co, base->object->obmat, base->object->bb->vec[j]);
+					mul_v3_m4v3(co, base->object->obmat, bb->vec[j]);
 					calc_tw_center(tbounds, co);
 				}
 			}



More information about the Bf-blender-cvs mailing list