Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_userdef.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show All 23 Lines | |||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_sound.h" | #include "BKE_sound.h" | ||||
| #include "BKE_studiolight.h" | #include "BKE_studiolight.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "GPU_platform.h" | |||||
| #include "UI_interface_icons.h" | #include "UI_interface_icons.h" | ||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "BLT_lang.h" | #include "BLT_lang.h" | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | static const EnumPropertyItem rna_enum_userdef_viewport_aa_items[] = { | ||||
| {SCE_DISPLAY_AA_SAMPLES_32, | {SCE_DISPLAY_AA_SAMPLES_32, | ||||
| "32", | "32", | ||||
| 0, | 0, | ||||
| "32 Samples", | "32 Samples", | ||||
| "Scene will be rendered using 32 anti-aliasing samples"}, | "Scene will be rendered using 32 anti-aliasing samples"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_preference_gpu_backend_items[] = { | |||||
| {GPU_BACKEND_OPENGL, "OPENGL", 0, "OpenGL", "Use OpenGL backend"}, | |||||
| {GPU_BACKEND_METAL, "METAL", 0, "Metal", "Use Metal backend"}, | |||||
| {GPU_BACKEND_VULKAN, "VULKAN", 0, "Vulkan", "Use Vulkan backend"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| # include "BLI_math_vector.h" | # include "BLI_math_vector.h" | ||||
| # include "DNA_object_types.h" | # include "DNA_object_types.h" | ||||
| # include "DNA_screen_types.h" | # include "DNA_screen_types.h" | ||||
| # include "BKE_blender.h" | # include "BKE_blender.h" | ||||
| ▲ Show 20 Lines • Show All 877 Lines • ▼ Show 20 Lines | static void rna_UserDef_studiolight_light_ambient_get(PointerRNA *ptr, float *values) | ||||
| copy_v3_v3(values, sl->light_ambient); | copy_v3_v3(values, sl->light_ambient); | ||||
| } | } | ||||
| int rna_show_statusbar_vram_editable(struct PointerRNA *UNUSED(ptr), const char **UNUSED(r_info)) | int rna_show_statusbar_vram_editable(struct PointerRNA *UNUSED(ptr), const char **UNUSED(r_info)) | ||||
| { | { | ||||
| return GPU_mem_stats_supported() ? PROP_EDITABLE : 0; | return GPU_mem_stats_supported() ? PROP_EDITABLE : 0; | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_preference_gpu_backend_itemf(struct bContext *UNUSED(C), | |||||
| PointerRNA *UNUSED(ptr), | |||||
| PropertyRNA *UNUSED(prop), | |||||
| bool *r_free) | |||||
| { | |||||
| int totitem = 0; | |||||
| EnumPropertyItem *result = NULL; | |||||
| for (int i = 0; rna_enum_preference_gpu_backend_items[i].identifier != NULL; i++) { | |||||
| const EnumPropertyItem *item = &rna_enum_preference_gpu_backend_items[i]; | |||||
| # ifndef WITH_METAL_BACKEND | |||||
| if (item->value == GPU_BACKEND_METAL) { | |||||
| continue; | |||||
| } | |||||
| # endif | |||||
| # ifndef WITH_VULKAN_BACKEND | |||||
| if (item->value == GPU_BACKEND_VULKAN) { | |||||
| continue; | |||||
| } | |||||
| # endif | |||||
| RNA_enum_item_add(&result, &totitem, item); | |||||
| } | |||||
| RNA_enum_item_end(&result, &totitem); | |||||
| *r_free = true; | |||||
| return result; | |||||
| } | |||||
| #else | #else | ||||
| # define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \ | # define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \ | ||||
| RNA_define_fallback_property_update(0, "rna_userdef_is_dirty_update") | RNA_define_fallback_property_update(0, "rna_userdef_is_dirty_update") | ||||
| # define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE RNA_define_fallback_property_update(0, NULL) | # define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE RNA_define_fallback_property_update(0, NULL) | ||||
| /* TODO(sergey): This technically belongs to blenlib, but we don't link | /* TODO(sergey): This technically belongs to blenlib, but we don't link | ||||
| ▲ Show 20 Lines • Show All 4,557 Lines • ▼ Show 20 Lines | # endif | ||||
| prop = RNA_def_property(srna, "use_gpu_subdivision", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpu_subdivision", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpu_flag", USER_GPU_FLAG_SUBDIVISION_EVALUATION); | RNA_def_property_boolean_sdna(prop, NULL, "gpu_flag", USER_GPU_FLAG_SUBDIVISION_EVALUATION); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text(prop, | ||||
| "GPU Subdivision", | "GPU Subdivision", | ||||
| "Enable GPU acceleration for evaluating the last subdivision surface " | "Enable GPU acceleration for evaluating the last subdivision surface " | ||||
| "modifiers in the stack"); | "modifiers in the stack"); | ||||
| RNA_def_property_update(prop, 0, "rna_UserDef_subdivision_update"); | RNA_def_property_update(prop, 0, "rna_UserDef_subdivision_update"); | ||||
| /* GPU backend selection */ | |||||
| prop = RNA_def_property(srna, "gpu_backend", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "gpu_backend"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_preference_gpu_backend_items); | |||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_preference_gpu_backend_itemf"); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "GPU Backend", | |||||
| "GPU backend to use. (Requires restarting Blender for changes to take effect)"); | |||||
| /* Audio */ | /* Audio */ | ||||
| prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "mixbufsize"); | RNA_def_property_enum_sdna(prop, NULL, "mixbufsize"); | ||||
| RNA_def_property_enum_items(prop, audio_mixing_samples_items); | RNA_def_property_enum_items(prop, audio_mixing_samples_items); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer"); | prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer"); | ||||
| RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); | RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); | ||||
| ▲ Show 20 Lines • Show All 1,003 Lines • Show Last 20 Lines | |||||