Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_wireframe.c
| Show All 14 Lines | |||||
| * | * | ||||
| * Copyright 2019, Blender Foundation. | * Copyright 2019, Blender Foundation. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup draw_engine | * \ingroup draw_engine | ||||
| */ | */ | ||||
| #include "DNA_curve_types.h" | |||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_view3d_types.h" | #include "DNA_view3d_types.h" | ||||
| #include "DNA_volume_types.h" | #include "DNA_volume_types.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_displist.h" | #include "BKE_displist.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| ▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, | ||||
| if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) { | if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) { | ||||
| OVERLAY_ExtraCallBuffers *cb = OVERLAY_extra_call_buffer_get(vedata, ob); | OVERLAY_ExtraCallBuffers *cb = OVERLAY_extra_call_buffer_get(vedata, ob); | ||||
| float *color; | float *color; | ||||
| DRW_object_wire_theme_get(ob, draw_ctx->view_layer, &color); | DRW_object_wire_theme_get(ob, draw_ctx->view_layer, &color); | ||||
| struct GPUBatch *geom = NULL; | struct GPUBatch *geom = NULL; | ||||
| switch (ob->type) { | switch (ob->type) { | ||||
| case OB_CURVE: | case OB_CURVE: { | ||||
| if (ob->runtime.curve_cache && BKE_displist_has_faces(&ob->runtime.curve_cache->disp)) { | Curve *cu = ob->data; | ||||
| const bool is_filled = (cu->flag & (CU_FRONT | CU_BACK)) != 0; | |||||
| const bool is_2d = (cu->flag & CU_3D) == 0; | |||||
| if ((ob->runtime.curve_cache && BKE_displist_has_faces(&ob->runtime.curve_cache->disp)) && | |||||
| !(is_2d && is_filled)) { | |||||
| break; | break; | ||||
| } | } | ||||
| geom = DRW_cache_curve_edge_wire_get(ob); | geom = DRW_cache_curve_edge_wire_get(ob); | ||||
| break; | break; | ||||
| } | |||||
| case OB_FONT: | case OB_FONT: | ||||
| if (ob->runtime.curve_cache && BKE_displist_has_faces(&ob->runtime.curve_cache->disp)) { | if (ob->runtime.curve_cache && BKE_displist_has_faces(&ob->runtime.curve_cache->disp)) { | ||||
| break; | break; | ||||
| } | } | ||||
| geom = DRW_cache_text_loose_edges_get(ob); | geom = DRW_cache_text_loose_edges_get(ob); | ||||
| break; | break; | ||||
| case OB_SURF: | case OB_SURF: | ||||
| geom = DRW_cache_surf_edge_wire_get(ob); | geom = DRW_cache_surf_edge_wire_get(ob); | ||||
| ▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines | |||||