Fix workbench render crash in background mode

This commit is contained in:
2019-07-02 16:07:58 +02:00
parent 87c39f1123
commit 2062d649bf

View File

@@ -45,19 +45,16 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
wpd->preferences = &U;
View3D *v3d = draw_ctx->v3d;
if (!v3d) {
wpd->shading = scene->display.shading;
wpd->use_color_render_settings = true;
}
else if (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene)) {
if (!v3d || (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene))) {
wpd->shading = scene->display.shading;
wpd->shading.xray_alpha = XRAY_ALPHA((&scene->display));
wpd->use_color_render_settings = true;
}
else {
wpd->shading = v3d->shading;
wpd->shading.xray_alpha = XRAY_ALPHA(v3d);
wpd->use_color_render_settings = false;
}
wpd->shading.xray_alpha = XRAY_ALPHA(v3d);
wpd->use_color_management = BKE_scene_check_color_management_enabled(scene);