Commit: 7e834457c5d0c88cde470fca36cc7c90139cad01 Author: Miguel Pozo Date: Mon Jan 23 17:21:20 2023 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rB7e834457c5d0c88cde470fca36cc7c90139cad01
Add Workbench Next check to hard-coded Workbench checks =================================================================== M source/blender/blenkernel/intern/scene.cc M source/blender/editors/space_view3d/view3d_utils.c M source/blender/makesdna/DNA_scene_types.h M source/blender/makesrna/intern/rna_space.c =================================================================== diff --git a/source/blender/blenkernel/intern/scene.cc b/source/blender/blenkernel/intern/scene.cc index 124de007ade..7461e6c07f2 100644 --- a/source/blender/blenkernel/intern/scene.cc +++ b/source/blender/blenkernel/intern/scene.cc @@ -1748,6 +1748,7 @@ IDTypeInfo IDType_ID_SCE = get_type_info(); const char *RE_engine_id_BLENDER_EEVEE = "BLENDER_EEVEE"; const char *RE_engine_id_BLENDER_WORKBENCH = "BLENDER_WORKBENCH"; +const char *RE_engine_id_BLENDER_WORKBENCH_NEXT = "BLENDER_WORKBENCH_NEXT"; const char *RE_engine_id_CYCLES = "CYCLES"; void free_avicodecdata(AviCodecData *acd) @@ -2939,7 +2940,8 @@ bool BKE_scene_uses_blender_eevee(const Scene *scene) bool BKE_scene_uses_blender_workbench(const Scene *scene) { - return STREQ(scene->r.engine, RE_engine_id_BLENDER_WORKBENCH); + return STREQ(scene->r.engine, RE_engine_id_BLENDER_WORKBENCH) || + STREQ(scene->r.engine, RE_engine_id_BLENDER_WORKBENCH_NEXT); } bool BKE_scene_uses_cycles(const Scene *scene) diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index fc26e6b4a06..d87a2730c7b 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -84,7 +84,7 @@ bool ED_view3d_has_workbench_in_texture_color(const Scene *scene, } } else if (v3d->shading.type == OB_RENDER) { - if (STREQ(scene->r.engine, RE_engine_id_BLENDER_WORKBENCH)) { + if (BKE_scene_uses_blender_workbench(scene)) { return scene->display.shading.color_type == V3D_SHADING_TEXTURE_COLOR; } } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index a4076a4c4e6..c85b40a9342 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -2148,6 +2148,7 @@ enum { /** #RenderData.engine (scene.cc) */ extern const char *RE_engine_id_BLENDER_EEVEE; extern const char *RE_engine_id_BLENDER_WORKBENCH; +extern const char *RE_engine_id_BLENDER_WORKBENCH_NEXT; extern const char *RE_engine_id_CYCLES; /** \} */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 15ed20ce354..dcf50bb5893 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1165,7 +1165,7 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA View3DShading *shading = ptr->data; if (shading->type == OB_MATERIAL || - (shading->type == OB_RENDER && !STREQ(scene->r.engine, RE_engine_id_BLENDER_WORKBENCH))) { + (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene))) { /* When switching from workbench to render or material mode the geometry of any * active sculpt session needs to be recalculated. */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs