diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-03-01 20:53:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-03-01 20:53:33 +0300 |
commit | a3300bcac8f9658f1cac099d5d1520de6f2abc29 (patch) | |
tree | 5c9f24e30bc15805cb3f63ad041d4fe8f3fa4bb8 /source/blender/editors | |
parent | 29fc56b5bb0762baf8cc2639cf977f6a835f9633 (diff) |
allow display lists for dupli objects within a dupli list, significant speedup for duplifaces within dupligroups in one of the durian scenes.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 8d2cd6a9903..bbd22ea2f2e 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1478,6 +1478,19 @@ static void view3d_draw_transp(Scene *scene, ARegion *ar, View3D *v3d) 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 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas 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 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas 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 */ |