[Bf-blender-cvs] [0919a3d] alembic_pointcache: Use dupli cache in bounding box calculations involving duplis.

Lukas Tönne noreply at git.blender.org
Mon Mar 23 09:08:55 CET 2015


Commit: 0919a3d56d6e57e89fc10cc58b3f0837bc711764
Author: Lukas Tönne
Date:   Mon Mar 23 08:51:08 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB0919a3d56d6e57e89fc10cc58b3f0837bc711764

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 9ce6c93..a119898 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2869,7 +2869,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