[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52545] trunk/blender/source/blender/ editors/space_view3d/view3d_draw.c: Fix #33291: when using boundbox drawtype for a large number of duplicated objects,

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Nov 25 17:12:08 CET 2012


Revision: 52545
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52545
Author:   blendix
Date:     2012-11-25 16:12:07 +0000 (Sun, 25 Nov 2012)
Log Message:
-----------
Fix #33291: when using boundbox drawtype for a large number of duplicated objects,
enabling Wire draw on the parent would draw full resolution wires for all the
instances which can be very slow. So for boundbox those draw extras options are not
inherited now.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2012-11-25 15:05:17 UTC (rev 52544)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2012-11-25 16:12:07 UTC (rev 52545)
@@ -1931,11 +1931,18 @@
 	for (; dob; dob_prev = dob, dob = dob_next, dob_next = dob_next ? dupli_step(dob_next->next) : NULL) {
 		tbase.object = dob->ob;
 
-		/* extra service: draw the duplicator in drawtype of parent */
-		/* MIN2 for the drawtype to allow bounding box objects in groups for lods */
-		dt = tbase.object->dt;   tbase.object->dt = MIN2(tbase.object->dt, base->object->dt);
-		dtx = tbase.object->dtx; tbase.object->dtx = base->object->dtx;
+		/* extra service: draw the duplicator in drawtype of parent, minimum taken
+		 * to allow e.g. boundbox box objects in groups for LOD */
+		dt = tbase.object->dt;
+		tbase.object->dt = MIN2(tbase.object->dt, base->object->dt);
 
+		/* inherit draw extra, but not if a boundbox under the assumption that this
+		 * is intended to speed up drawing, and drawing extra (especially wire) can
+		 * slow it down too much */
+		dtx = tbase.object->dtx;
+		if(tbase.object->dt != OB_BOUNDBOX)
+			tbase.object->dtx = base->object->dtx;
+
 		/* negative scale flag has to propagate */
 		transflag = tbase.object->transflag;
 		if (base->object->transflag & OB_NEG_SCALE)




More information about the Bf-blender-cvs mailing list