diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-04 11:08:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-04 11:08:09 +0300 |
commit | 670b2944f4bdbb8efec9ac7d18e58c0b36aa1f44 (patch) | |
tree | 77aee9fd6d37cbce0fdedde4edc99fd187cdcb3d /source/blender | |
parent | 2bee48301342570e24c9c58f3d9732d8c2090e6f (diff) |
Cleanup: indentation (right shift)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/basic/basic_engine.c | 7 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.c | 54 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_render.c | 77 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 88 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 38 | ||||
-rw-r--r-- | source/blender/draw/modes/overlay_mode.c | 7 |
6 files changed, 149 insertions, 122 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index cf0605c7eda..885c449c4e3 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -146,9 +146,10 @@ static void basic_cache_populate(void *vedata, Object *ob) (ob->dt == OB_WIRE)) { int flat_axis = 0; - bool is_flat_object_viewed_from_side = (draw_ctx->rv3d->persp == RV3D_ORTHO) && - DRW_object_is_flat(ob, &flat_axis) && - DRW_object_axis_orthogonal_to_view(ob, flat_axis); + bool is_flat_object_viewed_from_side = ( + (draw_ctx->rv3d->persp == RV3D_ORTHO) && + DRW_object_is_flat(ob, &flat_axis) && + DRW_object_axis_orthogonal_to_view(ob, flat_axis)); if (is_flat_object_viewed_from_side) { /* Avoid losing flat objects when in ortho views (see T56549) */ diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 440ee8c8264..38983afa5f3 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -281,32 +281,34 @@ LightCache *EEVEE_lightcache_create( void EEVEE_lightcache_load(LightCache *lcache) { if (lcache->grid_tx.tex == NULL && lcache->grid_tx.data) { - lcache->grid_tx.tex = GPU_texture_create_nD(lcache->grid_tx.tex_size[0], - lcache->grid_tx.tex_size[1], - lcache->grid_tx.tex_size[2], - 2, - lcache->grid_tx.data, - IRRADIANCE_FORMAT, - GPU_DATA_UNSIGNED_BYTE, - 0, - false, - NULL); + lcache->grid_tx.tex = GPU_texture_create_nD( + lcache->grid_tx.tex_size[0], + lcache->grid_tx.tex_size[1], + lcache->grid_tx.tex_size[2], + 2, + lcache->grid_tx.data, + IRRADIANCE_FORMAT, + GPU_DATA_UNSIGNED_BYTE, + 0, + false, + NULL); GPU_texture_bind(lcache->grid_tx.tex, 0); GPU_texture_filter_mode(lcache->grid_tx.tex, true); GPU_texture_unbind(lcache->grid_tx.tex); } if (lcache->cube_tx.tex == NULL && lcache->cube_tx.data) { - lcache->cube_tx.tex = GPU_texture_create_nD(lcache->cube_tx.tex_size[0], - lcache->cube_tx.tex_size[1], - lcache->cube_tx.tex_size[2], - 2, - lcache->cube_tx.data, - GPU_R11F_G11F_B10F, - GPU_DATA_10_11_11_REV, - 0, - false, - NULL); + lcache->cube_tx.tex = GPU_texture_create_nD( + lcache->cube_tx.tex_size[0], + lcache->cube_tx.tex_size[1], + lcache->cube_tx.tex_size[2], + 2, + lcache->cube_tx.data, + GPU_R11F_G11F_B10F, + GPU_DATA_10_11_11_REV, + 0, + false, + NULL); GPU_texture_bind(lcache->cube_tx.tex, 0); GPU_texture_mipmap_mode(lcache->cube_tx.tex, true, true); for (int mip = 0; mip < lcache->mips_len; ++mip) { @@ -465,8 +467,9 @@ static void eevee_lightbake_create_resources(EEVEE_LightBake *lbake) lbake->cube_prb = MEM_callocN(sizeof(LightProbe *) * lbake->cube_len, "EEVEE Cube visgroup ptr"); lbake->grid_prb = MEM_callocN(sizeof(LightProbe *) * lbake->grid_len, "EEVEE Grid visgroup ptr"); - lbake->grid_prev = DRW_texture_create_2D_array(lbake->irr_size[0], lbake->irr_size[1], lbake->irr_size[2], - IRRADIANCE_FORMAT, DRW_TEX_FILTER, NULL); + lbake->grid_prev = DRW_texture_create_2D_array( + lbake->irr_size[0], lbake->irr_size[1], lbake->irr_size[2], + IRRADIANCE_FORMAT, DRW_TEX_FILTER, NULL); /* Ensure Light Cache is ready to accept new data. If not recreate one. * WARNING: All the following must be threadsafe. It's currently protected @@ -889,9 +892,10 @@ static void eevee_lightbake_render_grid_sample(void *ved, void *user_data) if (lbake->bounce_curr == 0) { /* We only need to filter the visibility for the first bounce. */ - EEVEE_lightbake_filter_visibility(sldata, vedata, lbake->rt_depth, lbake->store_fb, sample_offset, - prb->clipsta, prb->clipend, egrid->visibility_range, - prb->vis_blur, lbake->vis_res); + EEVEE_lightbake_filter_visibility( + sldata, vedata, lbake->rt_depth, lbake->store_fb, sample_offset, + prb->clipsta, prb->clipend, egrid->visibility_range, + prb->vis_blur, lbake->vis_res); } /* Update level for progressive update. */ diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 45bfba09890..eddebdbec4c 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -209,11 +209,12 @@ static void eevee_render_result_combined( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_COMBINED, viewname); GPU_framebuffer_bind(vedata->stl->effects->final_fb); - GPU_framebuffer_read_color(vedata->stl->effects->final_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 4, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->stl->effects->final_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 4, 0, rp->rect); /* Premult alpha */ int pixels_len = BLI_rcti_size_x(rect) * BLI_rcti_size_y(rect); @@ -238,11 +239,12 @@ static void eevee_render_result_subsurface( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_SUBSURFACE_COLOR, viewname); GPU_framebuffer_bind(vedata->fbl->sss_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->sss_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 1, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->sss_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 1, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i++) { @@ -254,11 +256,12 @@ static void eevee_render_result_subsurface( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_SUBSURFACE_DIRECT, viewname); GPU_framebuffer_bind(vedata->fbl->sss_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->sss_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->sss_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 0, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i++) { @@ -289,11 +292,12 @@ static void eevee_render_result_normal( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_NORMAL, viewname); GPU_framebuffer_bind(vedata->fbl->main_fb); - GPU_framebuffer_read_color(vedata->fbl->main_fb, - g_data->overscan_pixels + rect->xmin, - g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 1, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->main_fb, + g_data->overscan_pixels + rect->xmin, + g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 1, rp->rect); /* Convert Eevee encoded normals to Blender normals. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i += 3) { @@ -336,11 +340,12 @@ static void eevee_render_result_z( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_Z, viewname); GPU_framebuffer_bind(vedata->fbl->main_fb); - GPU_framebuffer_read_depth(vedata->fbl->main_fb, - g_data->overscan_pixels + rect->xmin, - g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - rp->rect); + GPU_framebuffer_read_depth( + vedata->fbl->main_fb, + g_data->overscan_pixels + rect->xmin, + g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + rp->rect); bool is_persp = DRW_viewport_is_persp_get(); @@ -373,11 +378,12 @@ static void eevee_render_result_mist( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_MIST, viewname); GPU_framebuffer_bind(vedata->fbl->mist_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->mist_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 1, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->mist_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 1, 0, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty; i++) { @@ -402,11 +408,12 @@ static void eevee_render_result_occlusion( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_AO, viewname); GPU_framebuffer_bind(vedata->fbl->ao_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->ao_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->ao_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 0, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i += 3) { diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index f0a147f17b1..96e263cdc30 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -505,10 +505,11 @@ GPUBatch *DRW_cache_circle_get(void) GPUBatch *DRW_cache_square_get(void) { if (!SHC.drw_square) { - float p[4][3] = {{ 1.0f, 0.0f, 1.0f}, - { 1.0f, 0.0f, -1.0f}, - {-1.0f, 0.0f, -1.0f}, - {-1.0f, 0.0f, 1.0f}}; + float p[4][3] = { + { 1.0f, 0.0f, 1.0f}, + { 1.0f, 0.0f, -1.0f}, + {-1.0f, 0.0f, -1.0f}, + {-1.0f, 0.0f, 1.0f}}; /* Position Only 3D format */ static GPUVertFormat format = { 0 }; @@ -760,8 +761,9 @@ GPUBatch **DRW_cache_object_surface_material_get( switch (ob->type) { case OB_MESH: - return DRW_cache_mesh_surface_shaded_get(ob, gpumat_array, gpumat_array_len, - auto_layer_names, auto_layer_is_srgb, auto_layer_count); + return DRW_cache_mesh_surface_shaded_get( + ob, gpumat_array, gpumat_array_len, + auto_layer_names, auto_layer_is_srgb, auto_layer_count); case OB_CURVE: return DRW_cache_curve_surface_shaded_get(ob, gpumat_array, gpumat_array_len); case OB_SURF: @@ -1652,11 +1654,12 @@ GPUBatch *DRW_cache_lamp_spot_volume_get(void) GPUBatch *DRW_cache_lamp_spot_square_get(void) { if (!SHC.drw_lamp_spot_square) { - float p[5][3] = {{ 0.0f, 0.0f, 0.0f}, - { 1.0f, 1.0f, -1.0f}, - { 1.0f, -1.0f, -1.0f}, - {-1.0f, -1.0f, -1.0f}, - {-1.0f, 1.0f, -1.0f}}; + float p[5][3] = { + { 0.0f, 0.0f, 0.0f}, + { 1.0f, 1.0f, -1.0f}, + { 1.0f, -1.0f, -1.0f}, + {-1.0f, -1.0f, -1.0f}, + {-1.0f, 1.0f, -1.0f}}; uint v_idx = 0; @@ -1687,11 +1690,12 @@ GPUBatch *DRW_cache_lamp_spot_square_get(void) GPUBatch *DRW_cache_lamp_spot_square_volume_get(void) { if (!SHC.drw_lamp_spot_square_volume) { - float p[5][3] = {{ 0.0f, 0.0f, 0.0f}, - { 1.0f, 1.0f, -1.0f}, - { 1.0f, -1.0f, -1.0f}, - {-1.0f, -1.0f, -1.0f}, - {-1.0f, 1.0f, -1.0f}}; + float p[5][3] = { + { 0.0f, 0.0f, 0.0f}, + { 1.0f, 1.0f, -1.0f}, + { 1.0f, -1.0f, -1.0f}, + {-1.0f, -1.0f, -1.0f}, + {-1.0f, 1.0f, -1.0f}}; uint v_idx = 0; @@ -2051,8 +2055,9 @@ GPUBatch *DRW_cache_bone_octahedral_get(void) } } - SHC.drw_bone_octahedral = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, - GPU_BATCH_OWNS_VBO); + SHC.drw_bone_octahedral = GPU_batch_create_ex( + GPU_PRIM_TRIS, vbo, NULL, + GPU_BATCH_OWNS_VBO); } return SHC.drw_bone_octahedral; } @@ -2064,18 +2069,20 @@ GPUBatch *DRW_cache_bone_octahedral_wire_get(void) GPU_indexbuf_init(&elb, GPU_PRIM_LINES_ADJ, 12, 24); for (int i = 0; i < 12; i++) { - GPU_indexbuf_add_line_adj_verts(&elb, - bone_octahedral_wire_lines_adjacency[i][0], - bone_octahedral_wire_lines_adjacency[i][1], - bone_octahedral_wire_lines_adjacency[i][2], - bone_octahedral_wire_lines_adjacency[i][3]); + GPU_indexbuf_add_line_adj_verts( + &elb, + bone_octahedral_wire_lines_adjacency[i][0], + bone_octahedral_wire_lines_adjacency[i][1], + bone_octahedral_wire_lines_adjacency[i][2], + bone_octahedral_wire_lines_adjacency[i][3]); } /* HACK Reuse vertex buffer. */ GPUBatch *pos_nor_batch = DRW_cache_bone_octahedral_get(); - SHC.drw_bone_octahedral_wire = GPU_batch_create_ex(GPU_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GPU_indexbuf_build(&elb), - GPU_BATCH_OWNS_INDEX); + SHC.drw_bone_octahedral_wire = GPU_batch_create_ex( + GPU_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GPU_indexbuf_build(&elb), + GPU_BATCH_OWNS_INDEX); } return SHC.drw_bone_octahedral_wire; } @@ -2217,8 +2224,9 @@ GPUBatch *DRW_cache_bone_box_get(void) } } - SHC.drw_bone_box = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, - GPU_BATCH_OWNS_VBO); + SHC.drw_bone_box = GPU_batch_create_ex( + GPU_PRIM_TRIS, vbo, NULL, + GPU_BATCH_OWNS_VBO); } return SHC.drw_bone_box; } @@ -2230,18 +2238,20 @@ GPUBatch *DRW_cache_bone_box_wire_get(void) GPU_indexbuf_init(&elb, GPU_PRIM_LINES_ADJ, 12, 36); for (int i = 0; i < 12; i++) { - GPU_indexbuf_add_line_adj_verts(&elb, - bone_box_wire_lines_adjacency[i][0], - bone_box_wire_lines_adjacency[i][1], - bone_box_wire_lines_adjacency[i][2], - bone_box_wire_lines_adjacency[i][3]); + GPU_indexbuf_add_line_adj_verts( + &elb, + bone_box_wire_lines_adjacency[i][0], + bone_box_wire_lines_adjacency[i][1], + bone_box_wire_lines_adjacency[i][2], + bone_box_wire_lines_adjacency[i][3]); } /* HACK Reuse vertex buffer. */ GPUBatch *pos_nor_batch = DRW_cache_bone_box_get(); - SHC.drw_bone_box_wire = GPU_batch_create_ex(GPU_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GPU_indexbuf_build(&elb), - GPU_BATCH_OWNS_INDEX); + SHC.drw_bone_box_wire = GPU_batch_create_ex( + GPU_PRIM_LINES_ADJ, pos_nor_batch->verts[0], GPU_indexbuf_build(&elb), + GPU_BATCH_OWNS_INDEX); } return SHC.drw_bone_box_wire; } @@ -2544,8 +2554,9 @@ GPUBatch *DRW_cache_bone_stick_get(void) GPU_indexbuf_add_generic_vert(&elb, v++); } - SHC.drw_bone_stick = GPU_batch_create_ex(GPU_PRIM_TRI_FAN, vbo, GPU_indexbuf_build(&elb), - GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX); + SHC.drw_bone_stick = GPU_batch_create_ex( + GPU_PRIM_TRI_FAN, vbo, GPU_indexbuf_build(&elb), + GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX); #undef CIRCLE_RESOL } return SHC.drw_bone_stick; @@ -3033,8 +3044,9 @@ GPUBatch **DRW_cache_mesh_surface_shaded_get( char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count) { BLI_assert(ob->type == OB_MESH); - return DRW_mesh_batch_cache_get_surface_shaded(ob->data, gpumat_array, gpumat_array_len, - auto_layer_names, auto_layer_is_srgb, auto_layer_count); + return DRW_mesh_batch_cache_get_surface_shaded( + ob->data, gpumat_array, gpumat_array_len, + auto_layer_names, auto_layer_is_srgb, auto_layer_count); } /* Return list of batches with length equal to max(1, totcol). */ diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 4fe103ceb1f..7453f3f1b0e 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -428,15 +428,15 @@ static void OBJECT_engine_init(void *vedata) "#define DEPTH_BACK " STRINGIFY(OB_EMPTY_IMAGE_DEPTH_BACK) "\n" e_data.object_empty_image_sh = DRW_shader_create( - datatoc_object_empty_image_vert_glsl, NULL, - datatoc_object_empty_image_frag_glsl, - EMPTY_IMAGE_SHADER_DEFINES); + datatoc_object_empty_image_vert_glsl, NULL, + datatoc_object_empty_image_frag_glsl, + EMPTY_IMAGE_SHADER_DEFINES); e_data.object_empty_image_wire_sh = DRW_shader_create( - datatoc_object_empty_image_vert_glsl, NULL, - datatoc_object_empty_image_frag_glsl, - EMPTY_IMAGE_SHADER_DEFINES - "#define USE_WIRE\n"); + datatoc_object_empty_image_vert_glsl, NULL, + datatoc_object_empty_image_frag_glsl, + EMPTY_IMAGE_SHADER_DEFINES + "#define USE_WIRE\n"); # undef EMPTY_IMAGE_SHADER_DEFINES @@ -2041,13 +2041,12 @@ static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl OBJECT_ShadingGroupList *sgl = (ob->dtx & OB_DRAWXRAY) ? &stl->g_data->sgl_ghost : &stl->g_data->sgl; - OBJECT_LightProbeEngineData *prb_data = - (OBJECT_LightProbeEngineData *)DRW_drawdata_ensure( - &ob->id, - &draw_engine_object_type, - sizeof(OBJECT_LightProbeEngineData), - NULL, - NULL); + OBJECT_LightProbeEngineData *prb_data = (OBJECT_LightProbeEngineData *)DRW_drawdata_ensure( + &ob->id, + &draw_engine_object_type, + sizeof(OBJECT_LightProbeEngineData), + NULL, + NULL); if ((DRW_state_is_select() || do_outlines) && ((prb->flag & LIGHTPROBE_FLAG_SHOW_DATA) != 0)) { int *call_id = shgroup_theme_id_to_probe_outline_counter(stl, theme_id); @@ -2595,14 +2594,17 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) const bool hide_object_extra = (v3d->overlay.flag & V3D_OVERLAY_HIDE_OBJECT_XTRAS) != 0; if (do_outlines) { - if (!BKE_object_is_in_editmode(ob) && !((ob == draw_ctx->obact) && (draw_ctx->object_mode & OB_MODE_ALL_PAINT))) { + if (!BKE_object_is_in_editmode(ob) && + !((ob == draw_ctx->obact) && (draw_ctx->object_mode & OB_MODE_ALL_PAINT))) + { struct GPUBatch *geom; /* This fixes only the biggest case which is a plane in ortho view. */ int flat_axis = 0; - bool is_flat_object_viewed_from_side = (rv3d->persp == RV3D_ORTHO) && - DRW_object_is_flat(ob, &flat_axis) && - DRW_object_axis_orthogonal_to_view(ob, flat_axis); + bool is_flat_object_viewed_from_side = ( + (rv3d->persp == RV3D_ORTHO) && + DRW_object_is_flat(ob, &flat_axis) && + DRW_object_axis_orthogonal_to_view(ob, flat_axis)); if (stl->g_data->xray_enabled || is_flat_object_viewed_from_side) { geom = DRW_cache_object_edge_detection_get(ob, NULL); diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index e5b7959f38e..ef1ef7936ef 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -256,9 +256,10 @@ static void overlay_cache_populate(void *vedata, Object *ob) /* This fixes only the biggest case which is a plane in ortho view. */ int flat_axis = 0; - bool is_flat_object_viewed_from_side = (rv3d->persp == RV3D_ORTHO) && - DRW_object_is_flat(ob, &flat_axis) && - DRW_object_axis_orthogonal_to_view(ob, flat_axis); + bool is_flat_object_viewed_from_side = ( + (rv3d->persp == RV3D_ORTHO) && + DRW_object_is_flat(ob, &flat_axis) && + DRW_object_axis_orthogonal_to_view(ob, flat_axis)); if (is_flat_object_viewed_from_side && !is_sculpt_mode) { /* Avoid losing flat objects when in ortho views (see T56549) */ |