Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,291 Lines • ▼ Show 20 Lines | |||||
| static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, | static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, | ||||
| PointerRNA *UNUSED(ptr), | PointerRNA *UNUSED(ptr), | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| bool *r_free) | bool *r_free) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| const bool ao_enabled = scene->eevee.flag & SCE_EEVEE_GTAO_ENABLED; | |||||
| const bool bloom_enabled = scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED; | const bool bloom_enabled = scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED; | ||||
| int totitem = 0; | int totitem = 0; | ||||
| EnumPropertyItem *result = NULL; | EnumPropertyItem *result = NULL; | ||||
| for (int i = 0; rna_enum_view3dshading_render_pass_type_items[i].identifier != NULL; i++) { | for (int i = 0; rna_enum_view3dshading_render_pass_type_items[i].identifier != NULL; i++) { | ||||
| const EnumPropertyItem *item = &rna_enum_view3dshading_render_pass_type_items[i]; | const EnumPropertyItem *item = &rna_enum_view3dshading_render_pass_type_items[i]; | ||||
| if (!((!ao_enabled && item->value == EEVEE_RENDER_PASS_AO) || | if (!((!bloom_enabled && | ||||
| (!bloom_enabled && | |||||
| (item->value == EEVEE_RENDER_PASS_BLOOM || STREQ(item->name, "Effects"))))) { | (item->value == EEVEE_RENDER_PASS_BLOOM || STREQ(item->name, "Effects"))))) { | ||||
| RNA_enum_item_add(&result, &totitem, item); | RNA_enum_item_add(&result, &totitem, item); | ||||
| } | } | ||||
| } | } | ||||
| RNA_enum_item_end(&result, &totitem); | RNA_enum_item_end(&result, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| return result; | return result; | ||||
| } | } | ||||
| static int rna_3DViewShading_render_pass_get(PointerRNA *ptr) | static int rna_3DViewShading_render_pass_get(PointerRNA *ptr) | ||||
| { | { | ||||
| View3DShading *shading = (View3DShading *)ptr->data; | View3DShading *shading = (View3DShading *)ptr->data; | ||||
| eViewLayerEEVEEPassType result = shading->render_pass; | eViewLayerEEVEEPassType result = shading->render_pass; | ||||
| Scene *scene = rna_3DViewShading_scene(ptr); | Scene *scene = rna_3DViewShading_scene(ptr); | ||||
| if (result == EEVEE_RENDER_PASS_AO && ((scene->eevee.flag & SCE_EEVEE_GTAO_ENABLED) == 0)) { | |||||
| result = EEVEE_RENDER_PASS_COMBINED; | |||||
| } | |||||
| if (result == EEVEE_RENDER_PASS_BLOOM && ((scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED) == 0)) { | if (result == EEVEE_RENDER_PASS_BLOOM && ((scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED) == 0)) { | ||||
| result = EEVEE_RENDER_PASS_COMBINED; | result = EEVEE_RENDER_PASS_COMBINED; | ||||
| } | } | ||||
| return result; | return result; | ||||
| } | } | ||||
| static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr) | static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr) | ||||
| ▲ Show 20 Lines • Show All 5,302 Lines • Show Last 20 Lines | |||||