Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_draw.c
| Show First 20 Lines • Show All 2,262 Lines • ▼ Show 20 Lines | // persp(PERSP_STORE); /* store correct view for persp(PERSP_VIEW) calls */ | ||||
| glEnable(GL_DEPTH_TEST); | glEnable(GL_DEPTH_TEST); | ||||
| /* draw set first */ | /* draw set first */ | ||||
| if (scene->set) { | if (scene->set) { | ||||
| Scene *sce_iter; | Scene *sce_iter; | ||||
| for (SETLOOPER(scene->set, sce_iter, base)) { | for (SETLOOPER(scene->set, sce_iter, base)) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| if (func == NULL || func(base)) { | if (func == NULL || func(base)) { | ||||
| if ((base->object->transflag & OB_DUPLI) == 0 || | |||||
| (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) | |||||
| { | |||||
| draw_object(scene, ar, v3d, base, 0); | draw_object(scene, ar, v3d, base, 0); | ||||
| } | |||||
| if (base->object->transflag & OB_DUPLI) { | if (base->object->transflag & OB_DUPLI) { | ||||
| draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); | draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| if (func == NULL || func(base)) { | if (func == NULL || func(base)) { | ||||
| /* dupli drawing */ | /* dupli drawing */ | ||||
| if (base->object->transflag & OB_DUPLI) { | if (base->object->transflag & OB_DUPLI) { | ||||
| draw_dupli_objects(scene, ar, v3d, base); | draw_dupli_objects(scene, ar, v3d, base); | ||||
| } | } | ||||
| if ((base->object->transflag & OB_DUPLI) == 0 || | |||||
| (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) | |||||
| { | |||||
| draw_object(scene, ar, v3d, base, 0); | draw_object(scene, ar, v3d, base, 0); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| /* this isn't that nice, draw xray objects as if they are normal */ | /* this isn't that nice, draw xray objects as if they are normal */ | ||||
| if (v3d->afterdraw_transp.first || | if (v3d->afterdraw_transp.first || | ||||
| v3d->afterdraw_xray.first || | v3d->afterdraw_xray.first || | ||||
| v3d->afterdraw_xraytransp.first) | v3d->afterdraw_xraytransp.first) | ||||
| { | { | ||||
| View3DAfter *v3da, *next; | View3DAfter *v3da, *next; | ||||
| int mask_orig; | int mask_orig; | ||||
| ▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | if (rv3d->rflag & RV3D_CLIPPING) | ||||
| ED_view3d_clipping_set(rv3d); | ED_view3d_clipping_set(rv3d); | ||||
| /* draw set first */ | /* draw set first */ | ||||
| if (scene->set) { | if (scene->set) { | ||||
| Scene *sce_iter; | Scene *sce_iter; | ||||
| for (SETLOOPER(scene->set, sce_iter, base)) { | for (SETLOOPER(scene->set, sce_iter, base)) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); | UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); | ||||
| if ((base->object->transflag & OB_DUPLI) == 0 || | |||||
| (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) | |||||
| { | |||||
| draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET); | draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET); | ||||
| } | |||||
| if (base->object->transflag & OB_DUPLI) | if (base->object->transflag & OB_DUPLI) | ||||
| draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); | draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* then draw not selected and the duplis, but skip editmode object */ | /* then draw not selected and the duplis, but skip editmode object */ | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| /* dupli drawing */ | /* dupli drawing */ | ||||
| if (base->object->transflag & OB_DUPLI) | if (base->object->transflag & OB_DUPLI) | ||||
| draw_dupli_objects(scene, ar, v3d, base); | draw_dupli_objects(scene, ar, v3d, base); | ||||
| if ((base->object->transflag & OB_DUPLI) == 0 || | |||||
| (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) | |||||
| { | |||||
| draw_object(scene, ar, v3d, base, 0); | draw_object(scene, ar, v3d, base, 0); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| /* must be before xray draw which clears the depth buffer */ | /* must be before xray draw which clears the depth buffer */ | ||||
| if (v3d->flag2 & V3D_SHOW_GPENCIL) { | if (v3d->flag2 & V3D_SHOW_GPENCIL) { | ||||
| if (v3d->zbuf) glDisable(GL_DEPTH_TEST); | if (v3d->zbuf) glDisable(GL_DEPTH_TEST); | ||||
| draw_gpencil_view3d(scene, v3d, ar, true); | draw_gpencil_view3d(scene, v3d, ar, true); | ||||
| if (v3d->zbuf) glEnable(GL_DEPTH_TEST); | if (v3d->zbuf) glEnable(GL_DEPTH_TEST); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 617 Lines • ▼ Show 20 Lines | static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const char **grid_unit) | ||||
| /* draw set first */ | /* draw set first */ | ||||
| if (scene->set) { | if (scene->set) { | ||||
| Scene *sce_iter; | Scene *sce_iter; | ||||
| for (SETLOOPER(scene->set, sce_iter, base)) { | for (SETLOOPER(scene->set, sce_iter, base)) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); | UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); | ||||
| if ((base->object->transflag & OB_DUPLI) == 0 || | |||||
| (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) | |||||
| { | |||||
| draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET); | draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET); | ||||
| } | |||||
| if (base->object->transflag & OB_DUPLI) { | if (base->object->transflag & OB_DUPLI) { | ||||
| draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); | draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Transp and X-ray afterdraw stuff for sets is done later */ | /* Transp and X-ray afterdraw stuff for sets is done later */ | ||||
| } | } | ||||
| lay_used = 0; | lay_used = 0; | ||||
| /* then draw not selected and the duplis, but skip editmode object */ | /* then draw not selected and the duplis, but skip editmode object */ | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| lay_used |= base->lay & ((1 << 20) - 1); | lay_used |= base->lay & ((1 << 20) - 1); | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| /* dupli drawing */ | /* dupli drawing */ | ||||
| if (base->object->transflag & OB_DUPLI) { | if (base->object->transflag & OB_DUPLI) { | ||||
| draw_dupli_objects(scene, ar, v3d, base); | draw_dupli_objects(scene, ar, v3d, base); | ||||
| } | } | ||||
| if ((base->object->transflag & OB_DUPLI) == 0 || | |||||
| (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) | |||||
| { | |||||
| if ((base->flag & SELECT) == 0) { | if ((base->flag & SELECT) == 0) { | ||||
| if (base->object != scene->obedit) | if (base->object != scene->obedit) | ||||
| draw_object(scene, ar, v3d, base, 0); | draw_object(scene, ar, v3d, base, 0); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| if (v3d->lay_used != lay_used) { /* happens when loading old files or loading with UI load */ | if (v3d->lay_used != lay_used) { /* happens when loading old files or loading with UI load */ | ||||
| /* find header and force tag redraw */ | /* find header and force tag redraw */ | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| ARegion *ar_header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); | ARegion *ar_header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); | ||||
| ED_region_tag_redraw(ar_header); /* can be NULL */ | ED_region_tag_redraw(ar_header); /* can be NULL */ | ||||
| v3d->lay_used = lay_used; | v3d->lay_used = lay_used; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines | |||||