[Bf-blender-cvs] [8d76a2f] gooseberry: Use dupli cache in bounding box calculations involving duplis.

Lukas Tönne noreply at git.blender.org
Mon Mar 23 13:04:48 CET 2015


Commit: 8d76a2f418b370ce1f625f6b72570f3b64a6d444
Author: Lukas Tönne
Date:   Mon Mar 23 08:51:08 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB8d76a2f418b370ce1f625f6b72570f3b64a6d444

Use dupli cache in bounding box calculations involving duplis.

This feature is mostly useful for the "view selected" operator. It is
also used in the "set origin to geometry" operator, but since the
cache overrides the object geometry anyway the effect may not be what
users expect (which is acceptable).

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

M	source/blender/blenkernel/intern/object.c

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

diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index b869406..8eaac7c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2877,7 +2877,15 @@ bool BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_m
 				/* pass */
 			}
 			else {
-				BoundBox *bb = BKE_object_boundbox_get(dob->ob);
+				BoundBox *bb = NULL;
+				if (ob->dup_cache) {
+					DupliObjectData *dob_data = BKE_dupli_cache_find_data(ob->dup_cache, dob->ob);
+					if (dob_data->cache_dm) {
+						bb = &dob_data->bb;
+					}
+				}
+				if (!bb)
+					bb = BKE_object_boundbox_get(dob->ob);
 
 				if (bb) {
 					int i;




More information about the Bf-blender-cvs mailing list