Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_data.c
| Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | void workbench_private_data_init(WORKBENCH_PrivateData *wpd) | ||||
| wpd->volumes_do = false; | wpd->volumes_do = false; | ||||
| BLI_listbase_clear(&wpd->smoke_domains); | BLI_listbase_clear(&wpd->smoke_domains); | ||||
| if (!v3d || (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene))) { | if (!v3d || (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene))) { | ||||
| /* FIXME: This reproduce old behavior when workbench was separated in 2 engines. | /* FIXME: This reproduce old behavior when workbench was separated in 2 engines. | ||||
| * But this is a workaround for a missing update tagging from operators. */ | * But this is a workaround for a missing update tagging from operators. */ | ||||
| if (scene->display.shading.type != wpd->shading.type || | if (scene->display.shading.type != wpd->shading.type || | ||||
| (v3d && (XRAY_ENABLED(v3d) != XRAY_ENABLED(&scene->display)))) { | (v3d && (XRAY_ENABLED(v3d) != XRAY_ENABLED(&scene->display))) || | ||||
| (scene->display.shading.flag != wpd->shading.flag)) { | |||||
| wpd->view_updated = true; | wpd->view_updated = true; | ||||
| } | } | ||||
| wpd->shading = scene->display.shading; | wpd->shading = scene->display.shading; | ||||
| if (XRAY_FLAG_ENABLED((&scene->display))) { | if (XRAY_FLAG_ENABLED((&scene->display))) { | ||||
| wpd->shading.xray_alpha = XRAY_ALPHA((&scene->display)); | wpd->shading.xray_alpha = XRAY_ALPHA((&scene->display)); | ||||
| } | } | ||||
| else { | else { | ||||
| Show All 9 Lines | if (!v3d || (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene))) { | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v4_fl4(wpd->background_color, 0.0f, 0.0f, 0.0f, 1.0f); | copy_v4_fl4(wpd->background_color, 0.0f, 0.0f, 0.0f, 1.0f); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* FIXME: This reproduce old behavior when workbench was separated in 2 engines. | /* FIXME: This reproduce old behavior when workbench was separated in 2 engines. | ||||
| * But this is a workaround for a missing update tagging from operators. */ | * But this is a workaround for a missing update tagging from operators. */ | ||||
| if (v3d->shading.type != wpd->shading.type || XRAY_ENABLED(v3d) != XRAY_ENABLED(wpd)) { | if (v3d->shading.type != wpd->shading.type || XRAY_ENABLED(v3d) != XRAY_ENABLED(wpd) || | ||||
| v3d->shading.flag != wpd->shading.flag) { | |||||
| wpd->view_updated = true; | wpd->view_updated = true; | ||||
| } | } | ||||
| wpd->shading = v3d->shading; | wpd->shading = v3d->shading; | ||||
| if (wpd->shading.type < OB_SOLID) { | if (wpd->shading.type < OB_SOLID) { | ||||
| wpd->shading.xray_alpha = 0.0f; | wpd->shading.xray_alpha = 0.0f; | ||||
| } | } | ||||
| else if (XRAY_ENABLED(v3d)) { | else if (XRAY_ENABLED(v3d)) { | ||||
| ▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines | |||||