bugfix [#20989] DupliVert of DupliGroup crash

This commit is contained in:
Campbell Barton
2010-02-06 14:32:50 +00:00
parent 274e4bd9e0
commit eafdf42c24

View File

@@ -1503,7 +1503,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
ListBase *lb;
DupliObject *dob;
Base tbase;
BoundBox bb; /* use a copy because draw_object, calls clear_mesh_caches */
BoundBox bb, *bb_tmp; /* use a copy because draw_object, calls clear_mesh_caches */
GLuint displist=0;
short transflag, use_displist= -1; /* -1 is initialize */
char dt, dtx;
@@ -1539,14 +1539,14 @@ 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)
if(dob->ob->type==OB_LAMP || dob->type==OB_DUPLIGROUP || !(bb_tmp= object_get_boundbox(dob->ob)))
use_displist= 0;
else {
bb= *bb_tmp; /* must make a copy */
/* disable boundbox check for list creation */
object_boundbox_flag(dob->ob, OB_BB_DISABLED, 1);
/* need this for next part of code */
bb= *object_get_boundbox(dob->ob);
unit_m4(dob->ob->obmat); /* obmat gets restored */
displist= glGenLists(1);