[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27207] trunk/blender/source/blender/ editors/space_view3d/view3d_draw.c: allow display lists for dupli objects within a dupli list, significant speedup for duplifaces within dupligroups in one of the durian scenes .
Campbell Barton
ideasman42 at gmail.com
Mon Mar 1 18:53:33 CET 2010
Revision: 27207
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27207
Author: campbellbarton
Date: 2010-03-01 18:53:33 +0100 (Mon, 01 Mar 2010)
Log Message:
-----------
allow display lists for dupli objects within a dupli list, significant speedup for duplifaces within dupligroups in one of the durian scenes.
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 2010-03-01 12:44:28 UTC (rev 27206)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 2010-03-01 17:53:33 UTC (rev 27207)
@@ -1478,6 +1478,19 @@
draw_dupli_objects_color was added because when drawing set dupli's
we need to force the color
*/
+
+#if 0
+int dupli_ob_sort(void *arg1, void *arg2)
+{
+ void *p1= ((DupliObject *)arg1)->ob;
+ void *p2= ((DupliObject *)arg2)->ob;
+ int val = 0;
+ if (p1 < p2) val = -1;
+ else if (p1 > p2) val = 1;
+ return val;
+}
+#endif
+
static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color)
{
RegionView3D *rv3d= ar->regiondata;
@@ -1493,6 +1506,7 @@
tbase.flag= OB_FROMDUPLI|base->flag;
lb= object_duplilist(scene, base->object);
+ // BLI_sortlist(lb, dupli_ob_sort); // might be nice to have if we have a dupli list with mixed objects.
for(dob= lb->first; dob; dob= dob->next) {
if(dob->no_draw);
@@ -1520,7 +1534,12 @@
if(use_displist == -1) {
/* lamp drawing messes with matrices, could be handled smarter... but this works */
- if(dob->ob->type==OB_LAMP || dob->type==OB_DUPLIGROUP || !(bb_tmp= object_get_boundbox(dob->ob)))
+
+ /* note, since this was added, its checked dob->type==OB_DUPLIGROUP
+ * however this is very slow, it was probably needed for the NLA
+ * offset feature (used in group-duplicate.blend but no longer works in 2.5)
+ * so for now it should be ok to - campbell */
+ if(dob->ob->type==OB_LAMP || (dob->type==OB_DUPLIGROUP && dob->animated) || !(bb_tmp= object_get_boundbox(dob->ob)))
use_displist= 0;
else {
bb= *bb_tmp; /* must make a copy */
More information about the Bf-blender-cvs
mailing list