diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-16 12:42:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-16 12:42:50 +0400 |
commit | 9bcf305431cebaafb775a5ec61dd70df9008adeb (patch) | |
tree | b7ddfa83b41faa02bb6e0b719aa78e8af2ac2ed1 /source/blender/editors/space_view3d/drawobject.c | |
parent | d64fd168c96a1a5bee3aa5ffb847d7612059c993 (diff) |
fix [#31474] Crash when object has parent and dupli_type == 'FRAMES' and show_x_ray, show_transparent are set to True
dupli objects should never be added to after-draw, added an assert to ensure this (and make fixing such bugs easier).
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 5413aa88ab6..95797fd9afc 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3603,19 +3603,21 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } } - /* GPU_begin_object_materials checked if this is needed */ - if (do_alpha_after) { - if (ob->dtx & OB_DRAWXRAY) { - add_view3d_after(&v3d->afterdraw_xraytransp, base, flag); - } - else { - add_view3d_after(&v3d->afterdraw_transp, base, flag); + if ((flag & DRAW_PICKING) == 0 && (base->flag & OB_FROMDUPLI) == 0) { + /* GPU_begin_object_materials checked if this is needed */ + if (do_alpha_after) { + if (ob->dtx & OB_DRAWXRAY) { + add_view3d_after(&v3d->afterdraw_xraytransp, base, flag); + } + else { + add_view3d_after(&v3d->afterdraw_transp, base, flag); + } } - } - else if (ob->dtx & OB_DRAWXRAY && ob->dtx & OB_DRAWTRANSP) { - /* special case xray+transp when alpha is 1.0, without this the object vanishes */ - if (v3d->xray == 0 && v3d->transp == 0) { - add_view3d_after(&v3d->afterdraw_xray, base, flag); + else if (ob->dtx & OB_DRAWXRAY && ob->dtx & OB_DRAWTRANSP) { + /* special case xray+transp when alpha is 1.0, without this the object vanishes */ + if (v3d->xray == 0 && v3d->transp == 0) { + add_view3d_after(&v3d->afterdraw_xray, base, flag); + } } } |