Blender V5.3
rna_userdef.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <climits>
10#include <cstdlib>
11
12#include "DNA_scene_types.h"
13#include "DNA_sequence_types.h"
14#include "DNA_userdef_types.h"
15
16#include "BLI_math_base_c.hh"
19#ifdef WIN32
20# include "BLI_winstuff.hh"
21#endif
22
23#include "BLT_date_string.hh"
24#include "BLT_lang.hh"
25#include "BLT_translation.hh"
26
27#include "BKE_studiolight.h"
28
29#include "RNA_define.hh"
30#include "RNA_enum_types.hh"
31
32#include "GPU_platform.hh"
33
34#include "rna_internal.hh"
35
36#include "UI_interface_c.hh"
37
38#include "WM_api.hh"
39#include "WM_keymap.hh"
40#include "WM_types.hh"
41
42namespace blender {
43
45 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
46 {USER_SECTION_VIEWPORT, "VIEWPORT", 0, "Viewport", ""},
47 {USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""},
48 {USER_SECTION_EDITING, "EDITING", 0, "Editing", ""},
49 {USER_SECTION_ANIMATION, "ANIMATION", 0, "Animation", ""},
52 "EXTENSIONS",
53 0,
54 "Get Extensions",
55 "Browse, install and manage extensions from remote and local repositories"},
57 {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", "Manage add-ons installed via Extensions"},
59 "ASSETS",
60 0,
61 "Asset Libraries",
62 "Manage remote, local, and extension asset libraries"},
63 {USER_SECTION_THEME, "THEMES", 0, "Themes", "Edit and save themes installed via Extensions"},
64#if 0 /* def WITH_USERDEF_WORKSPACES */
66 {USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""},
67 {USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""},
68 {USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""},
69#endif
71 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
72 {USER_SECTION_NAVIGATION, "NAVIGATION", 0, "Navigation", ""},
73 {USER_SECTION_KEYMAP, "KEYMAP", 0, "Keymap", ""},
75 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
76 {USER_SECTION_SAVE_LOAD, "SAVE_LOAD", 0, "Save & Load", ""},
77 {USER_SECTION_FILE_PATHS, "FILE_PATHS", 0, "File Paths", ""},
79 {USER_SECTION_DEVELOPER_TOOLS, "DEVELOPER_TOOLS", 0, "Developer Tools", ""},
80 {USER_SECTION_EXPERIMENTAL, "EXPERIMENTAL", 0, "Experimental", ""},
81 {0, nullptr, 0, nullptr, nullptr},
82};
83
86 "DEFAULT",
87 0,
88 "Default",
89 "Default date formatting based on output language"},
91 "LE_SLASH",
92 0,
93 "dd/mm/yyyy",
94 "Date format: dd/mm/yyyy, eg: 27/02/2019"},
96 "LE_DOT",
97 0,
98 "dd.mm.yyyy",
99 "Date format: dd.mm.yyyy, eg: 27.02.2019"},
101 "LE_DASH",
102 0,
103 "dd-mm-yyyy",
104 "Date format: dd-mm-yyyy, eg: 27-02-2019"},
106 "ME_SLASH",
107 0,
108 "mm/dd/yyyy",
109 "Date format: mm/dd/yyyy, eg: 02/27/2019"},
111 "BE_SLASH",
112 0,
113 "yyyy/mm/dd",
114 "Date format: yyyy/mm/dd, eg: 2019/02/27"},
116 "BE_DOT",
117 0,
118 "yyyy.mm.dd",
119 "Date format: yyyy.mm.dd, eg: 2019.02.27"},
121 "BE_DASH",
122 0,
123 "yyyy-mm-dd",
124 "Date format: yyyy-mm-dd, eg: 2019-02-27"},
125 {0, nullptr, 0, nullptr, nullptr},
126};
127
129 {0, "None", 0, "None", "No device - there will be no audio output"},
130 {0, nullptr, 0, nullptr, nullptr},
131};
132
135 "WALK",
136 0,
137 "Walk",
138 "Interactively walk or free navigate around the scene"},
139 {VIEW_NAVIGATION_FLY, "FLY", 0, "Fly", "Use fly dynamics to navigate the scene"},
140 {0, nullptr, 0, nullptr, nullptr},
141};
142
143#if defined(WITH_INTERNATIONAL) || !defined(RNA_RUNTIME)
145 {0,
146 "DEFAULT",
147 0,
148 "Automatic (Automatic)",
149 "Automatically choose the system-defined language if available, or fall-back to English "
150 "(US)"},
151 {0, nullptr, 0, nullptr, nullptr},
152};
153#endif
154
156 {STUDIOLIGHT_TYPE_STUDIO, "STUDIO", 0, "Studio", ""},
157 {STUDIOLIGHT_TYPE_WORLD, "WORLD", 0, "World", ""},
158 {STUDIOLIGHT_TYPE_MATCAP, "MATCAP", 0, "MatCap", ""},
159 {0, nullptr, 0, nullptr, nullptr},
160};
161
164 "OFF",
165 0,
166 "No Anti-Aliasing",
167 "Scene will be rendering without any anti-aliasing"},
169 "FXAA",
170 0,
171 "Single Pass Anti-Aliasing",
172 "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
174 "5",
175 0,
176 "5 Samples",
177 "Scene will be rendered using 5 anti-aliasing samples"},
179 "8",
180 0,
181 "8 Samples",
182 "Scene will be rendered using 8 anti-aliasing samples"},
184 "11",
185 0,
186 "11 Samples",
187 "Scene will be rendered using 11 anti-aliasing samples"},
189 "16",
190 0,
191 "16 Samples",
192 "Scene will be rendered using 16 anti-aliasing samples"},
194 "32",
195 0,
196 "32 Samples",
197 "Scene will be rendered using 32 anti-aliasing samples"},
198 {0, nullptr, 0, nullptr, nullptr},
199};
200
202 {USER_ANIM_KEY_CHANNEL_LOCATION, "LOCATION", 0, "Location", ""},
203 {USER_ANIM_KEY_CHANNEL_ROTATION, "ROTATION", 0, "Rotation", ""},
204 {USER_ANIM_KEY_CHANNEL_SCALE, "SCALE", 0, "Scale", ""},
205 {USER_ANIM_KEY_CHANNEL_ROTATION_MODE, "ROTATE_MODE", 0, "Rotation Mode", ""},
206 {USER_ANIM_KEY_CHANNEL_CUSTOM_PROPERTIES, "CUSTOM_PROPS", 0, "Custom Properties", ""},
207 {0, nullptr, 0, nullptr, nullptr},
208};
209
211 {GPU_BACKEND_OPENGL, "OPENGL", 0, "OpenGL", "Use OpenGL backend"},
212 {GPU_BACKEND_METAL, "METAL", 0, "Metal", "Use Metal backend"},
213 {GPU_BACKEND_VULKAN, "VULKAN", 0, "Vulkan", "Use Vulkan backend"},
214 {0, nullptr, 0, nullptr, nullptr},
215};
218 "AUTOMATIC",
219 0,
220 "Automatic",
221 "Use the first device that supports the video"},
222 {USER_VIDEO_DECODING_DEVICE_VIDEOTOOLBOX, "VIDEOTOOLBOX", 0, "VideoToolbox", ""},
223 {USER_VIDEO_DECODING_DEVICE_D3D11VA, "D3D11VA", 0, "Direct3D 11", ""},
224 {USER_VIDEO_DECODING_DEVICE_CUDA, "CUDA", 0, "CUDA", ""},
225 {USER_VIDEO_DECODING_DEVICE_VULKAN, "VULKAN", 0, "Vulkan", ""},
226 {0, nullptr, 0, nullptr, nullptr},
227};
229 {0, "AUTO", 0, "Auto", "Auto detect best GPU for running Blender"},
231 {0, nullptr, 0, nullptr, nullptr},
232};
233
236 "USER",
237 0,
238 "User",
239 "Repository managed by the user, stored in user directories"},
241 "SYSTEM",
242 0,
243 "System",
244 "Read-only repository provided by the system"},
245 {0, nullptr, 0, nullptr, nullptr},
246};
247
248} // namespace blender
249
250#ifdef RNA_RUNTIME
251
252# include "AS_remote_library.hh"
253
254# include "BLI_listbase.hh"
255# include "BLI_math_vector_c.hh"
256# include "BLI_memory_cache.hh"
257# include "BLI_rand_c.hh"
258# include "BLI_string.hh"
259# include "BLI_string_utf8.hh"
260# include "BLI_string_utils.hh"
261
262# include "DNA_object_types.h"
263# include "DNA_screen_types.h"
264
265# include "BKE_addon.h"
266# include "BKE_appdir.hh"
267# include "BKE_blender.hh"
268# include "BKE_blender_project.hh"
269# include "BKE_blender_version.h"
270# include "BKE_callbacks.hh"
271# include "BKE_global.hh"
272# include "BKE_idprop.hh"
273# include "BKE_image.hh"
274# include "BKE_image_gpu.hh"
275# include "BKE_main.hh"
276# include "BKE_mesh_runtime.hh"
277# include "BKE_object.hh"
278# include "BKE_object_types.hh"
279# include "BKE_paint.hh"
280# include "BKE_preferences.h"
281# include "BKE_scene.hh"
282# include "BKE_screen.hh"
283# include "BKE_sound.hh"
284
285# include "DEG_depsgraph.hh"
286
287# include "GPU_capabilities.hh"
288# include "GPU_select.hh"
289# include "GPU_texture.hh"
290
291# include "BLF_api.hh"
292
293# include "BLI_path_utils.hh"
294
295# include "MEM_CacheLimiterC-Api.h"
296# include "MEM_guardedalloc.h"
297
298# include "ED_asset_library.hh"
299# include "ED_asset_list.hh"
300# include "ED_screen.hh"
301# include "ED_userpref.hh"
302
303# include "UI_interface.hh"
304
305# include "AS_asset_library.hh"
306
307namespace blender {
308
309static void rna_userdef_version_get(PointerRNA *ptr, int *value)
310{
311 UserDef *userdef = static_cast<UserDef *>(ptr->data);
312 value[0] = userdef->versionfile / 100;
313 value[1] = userdef->versionfile % 100;
314 value[2] = userdef->subversionfile;
315}
316
318# define USERDEF_TAG_DIRTY rna_userdef_is_dirty_update_impl()
319
321{
322 /* We can't use 'ptr->data' because this update function
323 * is used for themes and other nested data. */
324 if (U.runtime.is_dirty == false) {
325 U.runtime.is_dirty = true;
327 }
328}
329
330void rna_userdef_is_dirty_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
331{
332 /* WARNING: never use 'ptr' unless its type is checked. */
334}
335
337static void rna_userdef_ui_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
338{
340}
341
342static void rna_userdef_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
343{
345 USERDEF_TAG_DIRTY;
346}
347
348static void rna_userdef_update_compact_tabs(Main *bmain, Scene *scene, PointerRNA *ptr)
349{
350 rna_userdef_update(bmain, scene, ptr);
351 auto *wm = bmain->wm.first();
352 if (!wm) {
353 return;
354 }
355 for (wmWindow &win : wm->windows) {
356 /* Notify regions so they can update its category tab width when showing only tabs. */
358 }
359}
360
361static void rna_userdef_theme_update(Main *bmain, Scene *scene, PointerRNA *ptr)
362{
363 /* Recreate gizmos when changing themes. */
365
366 rna_userdef_update(bmain, scene, ptr);
367}
368
369static void rna_userdef_theme_text_style_update(Main *bmain, Scene *scene, PointerRNA *ptr)
370{
371 const uiStyle *style = ui::style_get();
373
374 rna_userdef_update(bmain, scene, ptr);
375}
376
377static void rna_userdef_gizmo_update(Main *bmain, Scene *scene, PointerRNA *ptr)
378{
380
381 rna_userdef_update(bmain, scene, ptr);
382}
383
384static void rna_userdef_theme_update_icons(Main *bmain, Scene *scene, PointerRNA *ptr)
385{
386 rna_userdef_theme_update(bmain, scene, ptr);
387}
388
389/* also used by buffer swap switching */
390static void rna_userdef_gpu_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
391{
392 /* font's are stored at each DPI level, without this we can easy load 100's of fonts */
394
395 WM_main_add_notifier(NC_WINDOW, nullptr); /* full redraw */
396 WM_main_add_notifier(NC_SCREEN | NA_EDITED, nullptr); /* refresh region sizes */
397 USERDEF_TAG_DIRTY;
398}
399
400static void rna_userdef_gpu_and_text_update(Main *bmain, Scene *scene, PointerRNA *ptr)
401{
402 rna_userdef_gpu_update(bmain, scene, ptr);
404 USERDEF_TAG_DIRTY;
405}
406
407static void rna_userdef_screen_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
408{
410 WM_main_add_notifier(NC_SCREEN | NA_EDITED, nullptr); /* refresh region sizes */
411 USERDEF_TAG_DIRTY;
412}
413
414static void rna_userdef_screen_update_header_default(Main *bmain, Scene *scene, PointerRNA *ptr)
415{
416 if (U.uiflag & USER_HEADER_FROM_PREF) {
417 for (bScreen *screen = bmain->screens.first(); screen;
418 screen = static_cast<bScreen *>(screen->id.next))
419 {
421 }
422 rna_userdef_screen_update(bmain, scene, ptr);
423 }
424 USERDEF_TAG_DIRTY;
425}
426
427static void rna_userdef_font_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
428{
432}
433
434static void rna_userdef_language_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
435{
436 BLT_lang_set(nullptr);
437
439 /* If changing language without current userprefs, enable all usage options. */
441 }
442
445 USERDEF_TAG_DIRTY;
446}
447
448static void rna_userdef_translation_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
449{
452 USERDEF_TAG_DIRTY;
453}
454
455static void rna_userdef_asset_library_name_set(PointerRNA *ptr, const char *value)
456{
457 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
459}
460
461static StructRNA *rna_UserAssetLibrary_refine(PointerRNA *ptr)
462{
463 const bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
464 return (library->flag & ASSET_LIBRARY_PROJECT_DEFINED) ? RNA_ProjectAssetLibrary :
465 RNA_PreferencesAssetLibrary;
466}
467
468static void rna_userdef_asset_library_path_set(PointerRNA *ptr, const char *value)
469{
470 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
472}
473
474int rna_userdef_asset_library_path_editable(const PointerRNA *ptr, const char **r_info)
475{
477 if ((library->flag & ASSET_LIBRARY_USE_REMOTE_URL) != 0) {
478 *r_info = N_("The download cache directory of remote asset libraries cannot be changed");
479 return PropertyFlag(0);
480 }
481
482 return PROP_EDITABLE;
483}
484
485static void rna_userdef_asset_libraries_update(Main *bmain, Scene *scene, PointerRNA *ptr)
486{
487 if (RNA_struct_is_a(ptr->type, RNA_ProjectAssetLibrary)) {
489 bke::with_blender_project_write_lock([&] { project->is_dirty = true; });
491 return;
492 }
493 rna_userdef_update(bmain, scene, ptr);
494}
495
496static void rna_userdef_asset_libraries_refresh(bContext *C, PointerRNA *ptr)
497{
499
500 /* Trigger refresh for the Asset Browser. */
502
503 if (RNA_struct_is_a(ptr->type, RNA_ProjectAssetLibrary)) {
504 Main *bmain = CTX_data_main(C);
506 bke::with_blender_project_write_lock([&] { project->is_dirty = true; });
508 return;
509 }
510 rna_userdef_update(CTX_data_main(C), CTX_data_scene(C), ptr);
511}
512
513static void rna_userdef_asset_library_remote_url_set(PointerRNA *ptr, const char *value)
514{
517}
518
519static void rna_userdef_asset_library_remote_url_update(bContext *C, PointerRNA *ptr)
520{
523 /* Make sure all visible instances of this asset library will be refreshed. */
524 blender::ed::asset::list::clear(&library_ref, C);
526 rna_userdef_asset_libraries_refresh(C, ptr);
527}
528
529static void rna_userdef_asset_library_uuid_get(PointerRNA *ptr, char *value)
530{
531 const bUserAssetLibrary *library = (bUserAssetLibrary *)ptr->data;
532 if (!library->invalid_uuid) {
533 BLI_uuid_format(value, library->uuid);
534 }
535 else {
536 value[0] = '\0';
537 }
538}
539
540static int rna_userdef_asset_library_uuid_length(PointerRNA *ptr)
541{
542 const bUserAssetLibrary *library = (bUserAssetLibrary *)ptr->data;
543 /* UUID_STRING_SIZE - 1 as we exclude the null terminator. */
544 return (!library->invalid_uuid) ? UUID_STRING_SIZE - 1 : 0;
545}
546
547static void rna_userdef_asset_libraries_use_online_essentials_update(bContext *C, PointerRNA *ptr)
548{
550 ed::asset::list::clear(&essentials, C);
551 rna_userdef_update(CTX_data_main(C), CTX_data_scene(C), ptr);
552}
553
554static void rna_userdef_asset_library_auth_token_get(PointerRNA *ptr, char *value)
555{
556 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
557 if (library->auth_token) {
558 strcpy(value, library->auth_token);
559 }
560 else {
561 value[0] = '\0';
562 }
563}
564
565static int rna_userdef_asset_library_auth_token_length(PointerRNA *ptr)
566{
567 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
568 return (library->auth_token) ? strlen(library->auth_token) : 0;
569}
570
571static void rna_userdef_asset_library_auth_token_set(PointerRNA *ptr, const char *value)
572{
573 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
574
575 if (library->auth_token) {
576 /* Replace the existing token with random characters to avoid leaving it in memory. */
577 RNG *rng = BLI_rng_new_srandom(uint(intptr_t(library->auth_token)));
578 BLI_rng_get_char_n(rng, library->auth_token, strlen(library->auth_token));
579 BLI_rng_free(rng);
580 /* Now we can more comfortably delete the token. */
581 MEM_delete(library->auth_token);
582 library->auth_token = nullptr;
583 }
584
585 if (value[0]) {
587 }
588}
589
590static void rna_userdef_asset_library_use_auth_token_update(bContext * /*C*/, PointerRNA *ptr)
591{
592 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
593 const bool use_auth_token = (library->flag & ASSET_LIBRARY_USE_AUTH_TOKEN) != 0;
594
595 if (!use_auth_token && library->auth_token) {
596 /* Make sure the token is wiped if we are not using it. */
597 rna_userdef_asset_library_auth_token_set(ptr, "");
598 }
599}
600
606static void rna_userdef_extension_sync_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
607{
610 USERDEF_TAG_DIRTY;
611}
612
613static void rna_userdef_extension_repo_name_set(PointerRNA *ptr, const char *value)
614{
615 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
617}
618
619static void rna_userdef_extension_repo_module_set(PointerRNA *ptr, const char *value)
620{
621 Main *bmain = G.main;
622 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
626}
627
628static void rna_userdef_extension_repo_custom_directory_set(PointerRNA *ptr, const char *value)
629{
630 Main *bmain = G.main;
631 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
635}
636
637static void rna_userdef_extension_repo_directory_get(PointerRNA *ptr, char *value)
638{
639 const bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
641}
642
643static int rna_userdef_extension_repo_directory_length(PointerRNA *ptr)
644{
645 const bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
646 char dirpath[FILE_MAX];
647 return BKE_preferences_extension_repo_dirpath_get(repo, dirpath, sizeof(dirpath));
648}
649
650static void rna_userdef_extension_repo_access_token_get(PointerRNA *ptr, char *value)
651{
652 const bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
653 if (repo->access_token) {
654 strcpy(value, repo->access_token);
655 }
656 else {
657 value[0] = '\0';
658 }
659}
660
661static int rna_userdef_extension_repo_access_token_length(PointerRNA *ptr)
662{
663 const bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
664 return (repo->access_token) ? strlen(repo->access_token) : 0;
665}
666
667static void rna_userdef_extension_repo_access_token_set(PointerRNA *ptr, const char *value)
668{
669 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
670 if (repo->access_token) {
671 MEM_delete(repo->access_token);
672 }
673 repo->access_token = value[0] ? BLI_strdup(value) : nullptr;
674}
675
676static void rna_userdef_extension_repo_generic_flag_set_impl(PointerRNA *ptr,
677 const bool value,
678 const eUserExtensionRepo_Flag flag)
679{
680 Main *bmain = G.main;
681 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
683 SET_FLAG_FROM_TEST(repo->flag, value, flag);
685}
686
687static void rna_userdef_extension_repo_enabled_set(PointerRNA *ptr, bool value)
688{
689 rna_userdef_extension_repo_generic_flag_set_impl(ptr, !value, USER_EXTENSION_REPO_FLAG_DISABLED);
690}
691
692static void rna_userdef_extension_repo_use_custom_directory_set(PointerRNA *ptr, bool value)
693{
694 rna_userdef_extension_repo_generic_flag_set_impl(
696}
697
698static void rna_userdef_extension_repo_use_remote_url_set(PointerRNA *ptr, bool value)
699{
700 rna_userdef_extension_repo_generic_flag_set_impl(
702}
703
704static void rna_userdef_extension_repo_source_set(PointerRNA *ptr, int value)
705{
706 Main *bmain = G.main;
707 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
709 repo->source = eUserExtensionRepo_Source(value);
711}
712
713static void rna_userdef_script_autoexec_update(Main * /*bmain*/,
714 Scene * /*scene*/,
715 PointerRNA *ptr)
716{
717 UserDef *userdef = static_cast<UserDef *>(ptr->data);
718 /* The command line takes precedence over the preference. */
719 if (!G.autoexec_override.has_value()) {
720 if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) {
722 }
723 else {
725 }
726 }
727
728 USERDEF_TAG_DIRTY;
729}
730
731static void rna_userdef_use_online_access_set(PointerRNA *ptr, bool value)
732{
733 /* A `set` function is needed to clear the override flags. */
734 UserDef *userdef = static_cast<UserDef *>(ptr->data);
735
736 if ((G.f & G_FLAG_INTERNET_ALLOW) == 0) {
738 /* The `editable` check should account for this, assert since this is security related. */
740 return;
741 }
742 }
743
744 const eUserPref_Flag old_flag = userdef->flag;
745
746 if (value) {
747 userdef->flag |= USER_INTERNET_ALLOW;
749 }
750 else {
751 userdef->flag &= ~USER_INTERNET_ALLOW;
753 }
754
755 if (old_flag != userdef->flag) {
756 /* Also clear the "User pressed 'Continue Offline' once"-flag when toggling internet access.
757 * Otherwise users are forever stuck with the 'Continue Offline' choice. */
758 userdef->extension_flag &= ~USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED;
759 }
760
761 /* Once the user edits this option (even to set it to the value it was)
762 * it's no longer considered overridden. */
763 G.f &= ~G_FLAG_INTERNET_OVERRIDE_PREF_ANY;
764}
765
766static int rna_userdef_use_online_access_editable(const PointerRNA * /*ptr*/, const char **r_info)
767{
768 if ((G.f & G_FLAG_INTERNET_ALLOW) == 0) {
769 /* Return 0 when blender was invoked with `--offline-mode` "forced". */
771 *r_info = N_("Launched with \"--offline-mode\", cannot be changed");
772 return 0;
773 }
774 }
775 return PROP_EDITABLE;
776}
777
778static void rna_userdef_script_directory_name_set(PointerRNA *ptr, const char *value)
779{
780 bUserScriptDirectory *script_dir = static_cast<bUserScriptDirectory *>(ptr->data);
781 bool value_invalid = false;
782
783 if (!value[0]) {
784 value_invalid = true;
785 }
786 if (STREQ(value, "DEFAULT")) {
787 value_invalid = true;
788 }
789
790 if (value_invalid) {
791 value = DATA_("Untitled");
792 }
793
794 STRNCPY_UTF8(script_dir->name, value);
795 BLI_uniquename(&U.script_directories,
796 script_dir,
797 value,
798 '.',
800 sizeof(script_dir->name));
801}
802
803static bUserScriptDirectory *rna_userdef_script_directory_new()
804{
805 bUserScriptDirectory *script_dir = MEM_new<bUserScriptDirectory>(__func__);
806 BLI_addtail(&U.script_directories, script_dir);
807 USERDEF_TAG_DIRTY;
808 return script_dir;
809}
810
811static void rna_userdef_script_directory_remove(ReportList *reports, PointerRNA *ptr)
812{
813 bUserScriptDirectory *script_dir = static_cast<bUserScriptDirectory *>(ptr->data);
814 if (BLI_findindex(&U.script_directories, script_dir) == -1) {
815 BKE_report(reports, RPT_ERROR, "Script directory not found");
816 return;
817 }
818
819 BLI_freelinkN(&U.script_directories, script_dir);
820 ptr->invalidate();
821 USERDEF_TAG_DIRTY;
822}
823
824static bUserAssetLibrary *rna_userdef_asset_library_new(const bContext *C,
825 ReportList *reports,
826 const char *name,
827 const char *directory,
828 const char *remote_url,
829 const char *extension_id)
830{
831 const bool is_remote = remote_url && remote_url[0];
832 const bool is_extension = extension_id && extension_id[0];
833 if (is_extension && !is_remote) {
834 BKE_report(reports, RPT_ERROR, "Extension defined asset libraries require a remote URL");
835 return nullptr;
836 }
837 bUserAssetLibrary *new_library;
838 if (is_extension) {
839 /* NOTE: don't use #ED_userpref_asset_library_new which activates the library in the UI
840 * and requests a download, the extension system manages these libraries. */
842 &U, name ? name : "", remote_url, nullptr);
843 STRNCPY(new_library->extension_id, extension_id);
846 }
847 else {
848 new_library = ED_userpref_asset_library_new(
849 C,
850 name ? name : "",
851 is_remote ? remote_url : (directory ? directory : ""),
853 false,
854 {},
855 {});
856 }
857
858 USERDEF_TAG_DIRTY;
859 return new_library;
860}
861
862static PointerRNA rna_AssetLibraryCollection_active_get(PointerRNA *ptr)
863{
865 *ptr, RNA_UserAssetLibrary, ED_userpref_asset_library_active_get());
866}
867
868static void rna_AssetLibraryCollection_active_set(PointerRNA * /*ptr*/,
869 PointerRNA value,
870 ReportList * /*reports*/)
871{
872 if (const bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(value.data)) {
874 }
875}
876
877static bool rna_userdef_asset_library_is_available(bUserAssetLibrary *library)
878{
880}
881
882static void rna_userdef_asset_library_remove(bContext *C, ReportList *reports, PointerRNA *ptr)
883{
884 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
885
886 if (BLI_findindex(&U.asset_libraries, library) == -1) {
887 BKE_report(reports, RPT_ERROR, "Asset Library not found");
888 return;
889 }
890
892
893 ptr->invalidate();
894 USERDEF_TAG_DIRTY;
895}
896
897static bUserExtensionRepo *rna_userdef_extension_repo_new(const char *name,
898 const char *module,
899 const char *custom_directory,
900 const char *remote_url,
901 const int source)
902{
903 Main *bmain = G.main;
905
907 &U, name ? name : "", module ? module : "", custom_directory ? custom_directory : "");
908
909 if (remote_url) {
910 STRNCPY(repo->remote_url, remote_url);
911 }
912
913 if (repo->remote_url[0]) {
915 }
916 if (repo->custom_dirpath[0]) {
918 }
919
920 repo->source = eUserExtensionRepo_Source(source);
921
923 USERDEF_TAG_DIRTY;
924 return repo;
925}
926
927static void rna_userdef_extension_repo_remove(ReportList *reports, PointerRNA *ptr)
928{
929 Main *bmain = G.main;
931
932 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
933 if (BLI_findindex(&U.extension_repos, repo) == -1) {
934 BKE_report(reports, RPT_ERROR, "Extension repository not found");
935 return;
936 }
938 ptr->invalidate();
939
941 USERDEF_TAG_DIRTY;
942}
943
944static void rna_userdef_load_ui_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
945{
946 UserDef *userdef = static_cast<UserDef *>(ptr->data);
947 if (userdef->flag & USER_FILENOUI) {
948 G.fileflags |= G_FILE_NO_UI;
949 }
950 else {
951 G.fileflags &= ~G_FILE_NO_UI;
952 }
953
954 USERDEF_TAG_DIRTY;
955}
956
957static void rna_userdef_window_csd_params_update(Main *bmain, Scene *scene, PointerRNA *ptr)
958{
959# ifdef WITH_GHOST_CSD
961# endif
962 rna_userdef_update(bmain, scene, ptr);
963}
964
965static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
966{
968 rna_userdef_update(bmain, scene, ptr);
969}
970
971static void rna_userdef_undo_steps_set(PointerRNA *ptr, int value)
972{
973 UserDef *userdef = static_cast<UserDef *>(ptr->data);
974
975 /* Do not allow 1 undo steps, useless and breaks undo/redo process (see #42531). */
976 userdef->undosteps = (value == 1) ? 2 : value;
977}
978
979static int rna_userdef_autokeymode_get(PointerRNA *ptr)
980{
981 UserDef *userdef = static_cast<UserDef *>(ptr->data);
982 short retval = userdef->autokey_mode;
983
984 if (!(userdef->autokey_mode & AUTOKEY_ON)) {
985 retval |= AUTOKEY_ON;
986 }
987
988 return retval;
989}
990
991static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
992{
993 UserDef *userdef = static_cast<UserDef *>(ptr->data);
994
995 if (value == AUTOKEY_MODE_NORMAL) {
996 userdef->autokey_mode |= eAutokey_Mode(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
997 userdef->autokey_mode &= ~eAutokey_Mode(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
998 }
999 else if (value == AUTOKEY_MODE_EDITKEYS) {
1000 userdef->autokey_mode |= eAutokey_Mode(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
1001 userdef->autokey_mode &= ~eAutokey_Mode(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
1002 }
1003}
1004
1005static void rna_userdef_anim_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1006{
1009 USERDEF_TAG_DIRTY;
1010}
1011
1012static void rna_userdef_input_devices(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1013{
1015 USERDEF_TAG_DIRTY;
1016}
1017
1018# ifdef WITH_INPUT_NDOF
1019static void rna_userdef_ndof_deadzone_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1020{
1021 UserDef *userdef = static_cast<UserDef *>(ptr->data);
1022 WM_ndof_deadzone_set(userdef->ndof_deadzone);
1023 USERDEF_TAG_DIRTY;
1024}
1025# endif
1026
1027static void rna_userdef_keyconfig_reload_update(bContext *C,
1028 Main * /*bmain*/,
1029 Scene * /*scene*/,
1030 PointerRNA * /*ptr*/)
1031{
1033 USERDEF_TAG_DIRTY;
1034}
1035
1036static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
1037{
1038 UserDef *userdef = static_cast<UserDef *>(ptr->data);
1039 int required_size = userdef->v2d_min_gridsize;
1040
1041 /* Set the time-code style. */
1042 userdef->timecode_style = eTimecodeStyles(value);
1043
1044 /* Adjust the v2d grid-size if needed so that time-codes don't overlap
1045 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
1046 * things from getting too blown out. */
1047 switch (value) {
1050 /* 35 is great most of the time, but not that great for full-blown */
1051 required_size = 35;
1052 break;
1054 required_size = 50;
1055 break;
1057 /* the granddaddy! */
1058 required_size = 65;
1059 break;
1061 required_size = 45;
1062 break;
1063 }
1064
1065 if (U.v2d_min_gridsize < required_size) {
1066 U.v2d_min_gridsize = required_size;
1067 }
1068}
1069
1070static int rna_UserDef_mouse_emulate_3_button_modifier_get(PointerRNA *ptr)
1071{
1072# if !defined(WIN32)
1073 UserDef *userdef = static_cast<UserDef *>(ptr->data);
1074 return userdef->mouse_emulate_3_button_modifier;
1075# else
1076 UNUSED_VARS(ptr);
1077 return USER_EMU_MMB_MOD_ALT;
1078# endif
1079}
1080
1081static const EnumPropertyItem *rna_UseDef_active_section_itemf(bContext * /*C*/,
1082 PointerRNA *ptr,
1083 PropertyRNA * /*prop*/,
1084 bool *r_free)
1085{
1086 UserDef *userdef = static_cast<UserDef *>(ptr->data);
1087 return BKE_preferences_active_section_itemf(userdef, r_free);
1088}
1089
1090static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
1091{
1092 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesView, ptr->data);
1093}
1094
1095static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
1096{
1097 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesEdit, ptr->data);
1098}
1099
1100static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
1101{
1102 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesInput, ptr->data);
1103}
1104
1105static PointerRNA rna_UserDef_keymap_get(PointerRNA *ptr)
1106{
1107 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesKeymap, ptr->data);
1108}
1109
1110static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
1111{
1112 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesFilePaths, ptr->data);
1113}
1114
1115static PointerRNA rna_UserDef_asset_libraries_get(PointerRNA *ptr)
1116{
1117 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesAssetLibraries, ptr->data);
1118}
1119
1120static PointerRNA rna_UserDef_extensions_get(PointerRNA *ptr)
1121{
1122 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesExtensions, ptr->data);
1123}
1124
1125static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
1126{
1127 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesSystem, ptr->data);
1128}
1129
1130static PointerRNA rna_UserDef_apps_get(PointerRNA *ptr)
1131{
1132 return RNA_pointer_create_with_parent(*ptr, RNA_PreferencesApps, ptr->data);
1133}
1134
1135/* Reevaluate objects with a subsurf modifier as the last in their modifiers stacks. */
1136static void rna_UserDef_subdivision_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1137{
1138 Object *ob;
1139
1140 for (ob = bmain->objects.first(); ob; ob = static_cast<Object *>(ob->id.next)) {
1141 if (BKE_object_get_last_subsurf_modifier(ob) != nullptr) {
1143 }
1144 }
1145
1146 rna_userdef_update(bmain, scene, ptr);
1147}
1148
1149static void rna_UserDef_audio_update(bContext *C, PointerRNA * /*ptr*/)
1150{
1152 USERDEF_TAG_DIRTY;
1153}
1154
1155static void rna_Userdef_memcache_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1156{
1157 const int64_t new_limit = int64_t(U.memcachelimit) * 1024 * 1024;
1160 USERDEF_TAG_DIRTY;
1161}
1162
1163static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1164{
1165 Object *ob;
1166
1167 for (ob = bmain->objects.first(); ob; ob = static_cast<Object *>(ob->id.next)) {
1168 if (ob->mode & OB_MODE_WEIGHT_PAINT) {
1170 }
1171 }
1172
1173 rna_userdef_update(bmain, scene, ptr);
1174}
1175
1176static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1177{
1178 /* If all lights are off gpu_draw resets them all, see: #27627,
1179 * so disallow them all to be disabled. */
1180 if (U.light_param[0].flag == 0 && U.light_param[1].flag == 0 && U.light_param[2].flag == 0 &&
1181 U.light_param[3].flag == 0)
1182 {
1183 SolidLight *light = static_cast<SolidLight *>(ptr->data);
1184 light->flag |= 1;
1185 }
1186
1188 rna_userdef_update(bmain, scene, ptr);
1189}
1190
1191static bool rna_userdef_is_microsoft_store_install_get(PointerRNA * /*ptr*/)
1192{
1193# ifdef WIN32
1195# endif
1196 return false;
1197}
1198
1199static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1200{
1201 wmWindowManager *wm = bmain->wm.first();
1202
1203 if (wm) {
1205 }
1206 rna_userdef_update(bmain, scene, ptr);
1207}
1208
1209# define RNA_USERDEF_EXPERIMENTAL_BOOLEAN_GET(member) \
1210 static bool rna_userdef_experimental_##member##_get(PointerRNA *ptr) \
1211 { \
1212 UserDef *userdef = POINTER_OFFSET(ptr->data, -offsetof(UserDef, experimental)); \
1213 return USER_EXPERIMENTAL_TEST(userdef, member); \
1214 }
1215
1216static bAddon *rna_userdef_addon_new()
1217{
1218 ListBaseT<bAddon> *addons_list = &U.addons;
1219 bAddon *addon = BKE_addon_new();
1220 BLI_addtail(addons_list, addon);
1221 USERDEF_TAG_DIRTY;
1222 return addon;
1223}
1224
1225static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *addon_ptr)
1226{
1227 ListBaseT<bAddon> *addons_list = &U.addons;
1228 bAddon *addon = static_cast<bAddon *>(addon_ptr->data);
1229 if (BLI_findindex(addons_list, addon) == -1) {
1230 BKE_report(reports, RPT_ERROR, "Add-on is no longer valid");
1231 return;
1232 }
1233 BLI_remlink(addons_list, addon);
1234 BKE_addon_free(addon);
1235 addon_ptr->invalidate();
1236 USERDEF_TAG_DIRTY;
1237}
1238
1239static bPathCompare *rna_userdef_pathcompare_new()
1240{
1241 bPathCompare *path_cmp = MEM_new<bPathCompare>("bPathCompare");
1242 BLI_addtail(&U.autoexec_paths, path_cmp);
1243 USERDEF_TAG_DIRTY;
1244 return path_cmp;
1245}
1246
1247static void rna_userdef_pathcompare_remove(ReportList *reports, PointerRNA *path_cmp_ptr)
1248{
1249 bPathCompare *path_cmp = static_cast<bPathCompare *>(path_cmp_ptr->data);
1250 if (BLI_findindex(&U.autoexec_paths, path_cmp) == -1) {
1251 BKE_report(reports, RPT_ERROR, "Excluded path is no longer valid");
1252 return;
1253 }
1254
1255 BLI_freelinkN(&U.autoexec_paths, path_cmp);
1256 path_cmp_ptr->invalidate();
1257 USERDEF_TAG_DIRTY;
1258}
1259
1260static void rna_userdef_temp_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1261{
1262 BKE_tempdir_init(U.tempdir);
1263 USERDEF_TAG_DIRTY;
1264}
1265
1266static void rna_userdef_text_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1267{
1272 USERDEF_TAG_DIRTY;
1273}
1274
1275static PointerRNA rna_Theme_space_generic_get(PointerRNA *ptr)
1276{
1277 return RNA_pointer_create_with_parent(*ptr, RNA_ThemeSpaceGeneric, ptr->data);
1278}
1279
1280static PointerRNA rna_Theme_gradient_colors_get(PointerRNA *ptr)
1281{
1282 return RNA_pointer_create_with_parent(*ptr, RNA_ThemeGradientColors, ptr->data);
1283}
1284
1285static PointerRNA rna_Theme_space_gradient_get(PointerRNA *ptr)
1286{
1287 return RNA_pointer_create_with_parent(*ptr, RNA_ThemeSpaceGradient, ptr->data);
1288}
1289
1290static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext * /*C*/,
1291 PointerRNA * /*ptr*/,
1292 PropertyRNA * /*prop*/,
1293 bool *r_free)
1294{
1295 int index = 0;
1296 int totitem = 0;
1297 EnumPropertyItem *item = nullptr;
1298
1299 int i;
1300
1301 char **names = BKE_sound_get_device_names();
1302
1303 for (i = 0; names[i]; i++) {
1304 EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]};
1305 RNA_enum_item_add(&item, &totitem, &new_item);
1306 }
1307
1308# if !defined(NDEBUG) || !defined(WITH_AUDASPACE)
1309 if (i == 0) {
1310 EnumPropertyItem new_item = {i, "SOUND_NONE", 0, "No Sound", ""};
1311 RNA_enum_item_add(&item, &totitem, &new_item);
1312 }
1313# endif
1314
1315 /* may be unused */
1317
1318 RNA_enum_item_end(&item, &totitem);
1319 *r_free = true;
1320
1321 return item;
1322}
1323
1324# ifdef WITH_INTERNATIONAL
1325static const EnumPropertyItem *rna_lang_enum_properties_itemf(bContext * /*C*/,
1326 PointerRNA * /*ptr*/,
1327 PropertyRNA * /*prop*/,
1328 bool * /*r_free*/)
1329{
1331 if (items == nullptr) {
1333 }
1334 return items;
1335}
1336# else
1337static int rna_lang_enum_properties_get_no_international(PointerRNA * /*ptr*/)
1338{
1339 /* This simply prevents warnings when accessing language
1340 * (since the actual value wont be in the enum, unless already `DEFAULT`). */
1341 return 0;
1342}
1343# endif
1344
1345static void rna_Theme_name_set(PointerRNA *ptr, const char *value)
1346{
1347 bTheme *btheme = static_cast<bTheme *>(ptr->data);
1348 STRNCPY_UTF8(btheme->name, value);
1349 BLI_uniquename(&U.themes, btheme, "Theme", '.', offsetof(bTheme, name), sizeof(btheme->name));
1350}
1351
1352static void rna_Addon_module_set(PointerRNA *ptr, const char *value)
1353{
1354 bAddon *addon = static_cast<bAddon *>(ptr->data);
1355
1356 /* The module may be empty (for newly created data), skip the preferences search.
1357 * Note that changing existing add-ons module isn't a common operation.
1358 * Support this to allow for an extension repositories module to change at run-time. */
1359 bAddonPrefType *apt = addon->module[0] ? BKE_addon_pref_type_find(addon->module, true) : nullptr;
1360
1361 size_t module_len = STRNCPY_UTF8_RLEN(addon->module, value);
1362
1363 /* Reserve half of `bAddon::module` for a package component.
1364 * Ensure the trailing component is less than half `sizeof(bAddon::module)`.
1365 * This is needed because the size of the add-on name should never work on not depending on
1366 * the user defined module prefix. Trimming off the trailing characters is a silent failure
1367 * however there isn't a practical way to notify the user an over long name was used.
1368 * In practice this is something only add-on developers should run into,
1369 * so it's more of a paper cut for developers. */
1370 const size_t submodule_len_limit = sizeof(bAddon::module) / 2;
1371 if (module_len >= submodule_len_limit) [[unlikely]] {
1372 char *submodule_end = addon->module + module_len;
1373 char *submodule_beg = addon->module;
1374 for (size_t i = module_len - 1; i > 0; i--) {
1375 if (addon->module[i] == '.') {
1376 submodule_beg = addon->module + i;
1377 break;
1378 }
1379 }
1380 if ((submodule_end - submodule_beg) > submodule_len_limit) {
1381 submodule_beg[submodule_len_limit] = '\0';
1382 BLI_str_utf8_invalid_strip(submodule_beg, submodule_len_limit);
1383 }
1384 }
1385
1386 if (apt) {
1387 /* Keep the associated preferences. */
1388 STRNCPY(apt->idname, addon->module);
1389 }
1390}
1391
1392static IDProperty **rna_AddonPref_idprops(PointerRNA *ptr)
1393{
1394 return reinterpret_cast<IDProperty **>(&ptr->data);
1395}
1396
1397static PointerRNA rna_Addon_preferences_get(PointerRNA *ptr)
1398{
1399 bAddon *addon = static_cast<bAddon *>(ptr->data);
1400 bAddonPrefType *apt = BKE_addon_pref_type_find(addon->module, true);
1401 if (apt) {
1402 if (addon->prop == nullptr) {
1403 /* name is unimportant. */
1404 addon->prop = bke::idprop::create_group(addon->module, IDP_FLAG_STATIC_TYPE).release();
1405 }
1406 return RNA_pointer_create_with_parent(*ptr, apt->rna_ext.srna, addon->prop);
1407 }
1408 else {
1409 return {};
1410 }
1411}
1412
1413static bool rna_AddonPref_unregister(Main *bmain, StructRNA *type)
1414{
1415 bAddonPrefType *apt = static_cast<bAddonPrefType *>(RNA_struct_blender_type_get(type));
1416
1417 if (!apt) {
1418 return false;
1419 }
1421 RNA_struct_free_extension(type, &apt->rna_ext);
1423
1425
1426 /* update while blender is running */
1428 return true;
1429}
1430
1431static StructRNA *rna_AddonPref_register(Main *bmain,
1432 ReportList *reports,
1433 void *data,
1434 const char *identifier,
1435 StructValidateFunc validate,
1436 StructCallbackFunc call,
1438{
1439 const char *error_prefix = "Registering add-on preferences class:";
1440 bAddonPrefType *apt, dummy_apt = {{'\0'}};
1441 bAddon dummy_addon = {nullptr};
1442 // bool have_function[1];
1443
1444 /* Setup dummy add-on preference and it's type to store static properties in. */
1445 PointerRNA dummy_addon_ptr = RNA_pointer_create_discrete(
1446 nullptr, RNA_AddonPreferences, &dummy_addon);
1447
1448 /* validate the python class */
1449 if (validate(&dummy_addon_ptr, data, nullptr /*have_function*/) != 0) {
1450 return nullptr;
1451 }
1452
1453 STRNCPY(dummy_apt.idname, dummy_addon.module);
1454 if (strlen(identifier) >= sizeof(dummy_apt.idname)) {
1455 BKE_reportf(reports,
1456 RPT_ERROR,
1457 "%s '%s' is too long, maximum length is %d",
1458 error_prefix,
1459 identifier,
1460 int(sizeof(dummy_apt.idname)));
1461 return nullptr;
1462 }
1463
1464 /* Check if we have registered this add-on preference type before, and remove it. */
1465 apt = BKE_addon_pref_type_find(dummy_addon.module, true);
1466 if (apt) {
1467 BKE_reportf(reports,
1468 RPT_INFO,
1469 "%s '%s', bl_idname '%s' has been registered before, unregistering previous",
1470 error_prefix,
1471 identifier,
1472 dummy_apt.idname);
1473
1474 StructRNA *srna = apt->rna_ext.srna;
1475 if (!(srna && rna_AddonPref_unregister(bmain, srna))) {
1476 BKE_reportf(reports,
1477 RPT_ERROR,
1478 "%s '%s', bl_idname '%s' %s",
1479 error_prefix,
1480 identifier,
1481 dummy_apt.idname,
1482 srna ? "is built-in" : "could not be unregistered");
1483
1484 return nullptr;
1485 }
1486 }
1487
1488 /* Create a new add-on preference type. */
1489 apt = MEM_new_uninitialized<bAddonPrefType>("addonpreftype");
1490 memcpy(apt, &dummy_apt, sizeof(dummy_apt));
1492
1493 apt->rna_ext.srna = RNA_def_struct_ptr(&RNA_blender_rna_get(), identifier, RNA_AddonPreferences);
1494 apt->rna_ext.data = data;
1495 apt->rna_ext.call = call;
1496 apt->rna_ext.free = free;
1497 RNA_struct_blender_type_set(apt->rna_ext.srna, apt);
1498
1499 // apt->draw = (have_function[0]) ? header_draw : nullptr;
1500
1501 /* update while blender is running */
1503
1504 return apt->rna_ext.srna;
1505}
1506
1507/* placeholder, doesn't do anything useful yet */
1508static StructRNA *rna_AddonPref_refine(PointerRNA *ptr)
1509{
1510 return (ptr->type) ? ptr->type : RNA_AddonPreferences;
1511}
1512
1513static float rna_ThemeUI_roundness_get(PointerRNA *ptr)
1514{
1515 /* Remap from relative radius to 0..1 range. */
1516 uiWidgetColors *tui = static_cast<uiWidgetColors *>(ptr->data);
1517 return tui->roundness * 2.0f;
1518}
1519
1520static void rna_ThemeUI_roundness_set(PointerRNA *ptr, float value)
1521{
1522 uiWidgetColors *tui = static_cast<uiWidgetColors *>(ptr->data);
1523 tui->roundness = value * 0.5f;
1524}
1525
1526/* Studio Light */
1527static void rna_UserDef_studiolight_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1528{
1530}
1531
1532static void rna_StudioLights_refresh(UserDef * /*userdef*/)
1533{
1535}
1536
1537static void rna_StudioLights_remove(UserDef * /*userdef*/, StudioLight *studio_light)
1538{
1539 BKE_studiolight_remove(studio_light);
1540}
1541
1542static StudioLight *rna_StudioLights_load(UserDef * /*userdef*/, const char *filepath, int type)
1543{
1544 return BKE_studiolight_load(filepath, type);
1545}
1546
1547/* TODO: Make it accept arguments. */
1548static StudioLight *rna_StudioLights_new(UserDef *userdef, const char *filepath)
1549{
1550 return BKE_studiolight_create(filepath, userdef->light_param, userdef->light_ambient);
1551}
1552
1553/* StudioLight.name */
1554static void rna_UserDef_studiolight_name_get(PointerRNA *ptr, char *value)
1555{
1556 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1557 strcpy(value, sl->name);
1558}
1559
1560static int rna_UserDef_studiolight_name_length(PointerRNA *ptr)
1561{
1562 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1563 return strlen(sl->name);
1564}
1565
1566/* StudioLight.path */
1567static void rna_UserDef_studiolight_path_get(PointerRNA *ptr, char *value)
1568{
1569 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1570 strcpy(value, sl->filepath);
1571}
1572
1573static int rna_UserDef_studiolight_path_length(PointerRNA *ptr)
1574{
1575 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1576 return strlen(sl->filepath);
1577}
1578
1579/* StudioLight.index */
1580static int rna_UserDef_studiolight_index_get(PointerRNA *ptr)
1581{
1582 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1583 return sl->index;
1584}
1585
1586/* StudioLight.is_user_defined */
1587static bool rna_UserDef_studiolight_is_user_defined_get(PointerRNA *ptr)
1588{
1589 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1590 return (sl->flag & STUDIOLIGHT_USER_DEFINED) != 0;
1591}
1592
1593/* StudioLight.is_user_defined */
1594static bool rna_UserDef_studiolight_has_specular_highlight_pass_get(PointerRNA *ptr)
1595{
1596 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1598}
1599
1600/* StudioLight.type */
1601
1602static int rna_UserDef_studiolight_type_get(PointerRNA *ptr)
1603{
1604 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1606}
1607
1608/* StudioLight.solid_lights */
1609
1610static void rna_UserDef_studiolight_solid_lights_begin(CollectionPropertyIterator *iter,
1611 PointerRNA *ptr)
1612{
1613 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1615 iter, ptr, sl->light, sizeof(*sl->light), ARRAY_SIZE(sl->light), 0, nullptr);
1616}
1617
1618static int rna_UserDef_studiolight_solid_lights_length(PointerRNA * /*ptr*/)
1619{
1620 return ARRAY_SIZE((static_cast<StudioLight *>(nullptr))->light);
1621}
1622
1623/* StudioLight.light_ambient */
1624
1625static void rna_UserDef_studiolight_light_ambient_get(PointerRNA *ptr, float *values)
1626{
1627 StudioLight *sl = static_cast<StudioLight *>(ptr->data);
1628 copy_v3_v3(values, sl->light_ambient);
1629}
1630
1631static const EnumPropertyItem *rna_userdef_date_format_itemf(bContext * /*C*/,
1632 PointerRNA * /*ptr*/,
1633 PropertyRNA * /*prop*/,
1634 bool *r_free)
1635{
1636 int totitem = 0;
1637 EnumPropertyItem *result = nullptr;
1638 static std::string date_format_names[8];
1639 const char *lang = BLT_lang_get();
1640 for (int i = 0; rna_enum_date_format_items[i].identifier != nullptr; i++) {
1642 constexpr std::tm test = {59, 59, 11, 20, 2, 60, 5, 139, 0}; /* March 20, 1960 11:59:59 */
1643 BLI_assert(i <= ARRAY_SIZE(date_format_names) - 1);
1644 date_format_names[i] = date_string::date(
1645 test, (i == 0) ? lang : nullptr, date_string::DateFormat(item->value));
1646 EnumPropertyItem new_item = {
1647 item->value, item->identifier, 0, date_format_names[i].c_str(), item->description};
1648 RNA_enum_item_add(&result, &totitem, &new_item);
1649 }
1650 RNA_enum_item_end(&result, &totitem);
1651 *r_free = true;
1652 return result;
1653}
1654
1655int rna_show_statusbar_vram_editable(const PointerRNA * /*ptr*/, const char ** /*r_info*/)
1656{
1658}
1659
1660static const EnumPropertyItem *rna_preference_gpu_backend_itemf(bContext * /*C*/,
1661 PointerRNA * /*ptr*/,
1662 PropertyRNA * /*prop*/,
1663 bool *r_free)
1664{
1665 int totitem = 0;
1666 EnumPropertyItem *result = nullptr;
1667 for (int i = 0; rna_enum_preference_gpu_backend_items[i].identifier != nullptr; i++) {
1669# ifndef WITH_OPENGL_BACKEND
1670 if (item->value == GPU_BACKEND_OPENGL) {
1671 continue;
1672 }
1673# endif
1674# ifndef WITH_METAL_BACKEND
1675 if (item->value == GPU_BACKEND_METAL) {
1676 continue;
1677 }
1678# endif
1679# ifndef WITH_VULKAN_BACKEND
1680 if (item->value == GPU_BACKEND_VULKAN) {
1681 continue;
1682 }
1683# endif
1684 RNA_enum_item_add(&result, &totitem, item);
1685 }
1686
1687 RNA_enum_item_end(&result, &totitem);
1688 *r_free = true;
1689 return result;
1690}
1691
1692static const EnumPropertyItem *rna_preference_video_decoding_device_itemf(bContext * /*C*/,
1693 PointerRNA * /*ptr*/,
1694 PropertyRNA * /*prop*/,
1695 bool *r_free)
1696{
1697 int totitem = 0;
1698 EnumPropertyItem *result = nullptr;
1699 for (int i = 0; rna_enum_preference_video_decoding_device_items[i].identifier != nullptr; i++) {
1701# ifdef __APPLE__
1702 if (ELEM(item->value,
1706 {
1707 continue;
1708 }
1709# elif defined(_WIN32)
1710 if (item->value == USER_VIDEO_DECODING_DEVICE_VIDEOTOOLBOX) {
1711 continue;
1712 }
1713# else
1714 if (ELEM(item->value,
1717 {
1718 continue;
1719 }
1720# endif
1721 RNA_enum_item_add(&result, &totitem, item);
1722 }
1723
1724 RNA_enum_item_end(&result, &totitem);
1725 *r_free = true;
1726 return result;
1727}
1728
1729static const EnumPropertyItem *rna_preference_gpu_preferred_device_itemf(bContext * /*C*/,
1730 PointerRNA * /*ptr*/,
1731 PropertyRNA * /*prop*/,
1732 bool *r_free)
1733{
1734 int totitem = 0;
1735 EnumPropertyItem *result = nullptr;
1736
1737 for (int i = 0; rna_enum_preference_gpu_preferred_device_items[i].identifier != nullptr; i++) {
1739 RNA_enum_item_add(&result, &totitem, item);
1740 }
1741 int index = 1;
1742 for (const GPUDevice &gpu_device : GPU_platform_devices_list()) {
1743 EnumPropertyItem item = {};
1744 item.value = index;
1745 item.identifier = gpu_device.identifier.c_str();
1746 item.name = gpu_device.name.c_str();
1747 item.description = gpu_device.name.c_str();
1748 RNA_enum_item_add(&result, &totitem, &item);
1749 index += 1;
1750 }
1751
1752 RNA_enum_item_end(&result, &totitem);
1753 *r_free = true;
1754 return result;
1755}
1756
1757static int rna_preference_gpu_preferred_device_get(PointerRNA *ptr)
1758{
1759 UserDef *preferences = static_cast<UserDef *>(ptr->data);
1760 int index = 1;
1761 for (const GPUDevice &gpu_device : GPU_platform_devices_list()) {
1762 if (gpu_device.index == preferences->gpu_preferred_index &&
1763 gpu_device.vendor_id == preferences->gpu_preferred_vendor_id &&
1764 gpu_device.device_id == preferences->gpu_preferred_device_id)
1765 {
1766 /* Offset by one as first item in the list is always auto-detection. */
1767 return index;
1768 }
1769 index += 1;
1770 }
1771
1772 return 0;
1773}
1774
1775static void rna_preference_gpu_preferred_device_set(PointerRNA *ptr, int value)
1776{
1777 UserDef *preferences = static_cast<UserDef *>(ptr->data);
1778 if (value > 0) {
1779 value -= 1;
1781 if (value < devices.size()) {
1782 const GPUDevice &device = devices[value];
1783 preferences->gpu_preferred_index = device.index;
1784 preferences->gpu_preferred_vendor_id = device.vendor_id;
1785 preferences->gpu_preferred_device_id = device.device_id;
1786 return;
1787 }
1788 }
1789 preferences->gpu_preferred_index = 0;
1790 preferences->gpu_preferred_vendor_id = 0u;
1791 preferences->gpu_preferred_device_id = 0u;
1792}
1793
1794static const EnumPropertyItem *rna_preference_asset_libray_import_method_itemf(
1795 bContext * /*C*/, PointerRNA *ptr, PropertyRNA * /*prop*/, bool *r_free)
1796{
1797 const bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
1798
1799 EnumPropertyItem *items = nullptr;
1800 int items_num = 0;
1801 for (const EnumPropertyItem *item = rna_enum_asset_import_method_items; item->identifier; item++)
1802 {
1803 if ((library->flag & ASSET_LIBRARY_USE_REMOTE_URL) != 0) {
1804 if (item->value == ASSET_IMPORT_LINK) {
1805 /* Don't allow linking with remote libraries. */
1806 continue;
1807 }
1808 }
1809
1810 switch (eAssetImportMethod(item->value)) {
1812 if (U.experimental.no_data_block_packing) {
1813 RNA_enum_item_add(&items, &items_num, item);
1814 }
1815 break;
1816 }
1817 case ASSET_IMPORT_PACK: {
1818 if (!U.experimental.no_data_block_packing) {
1819 RNA_enum_item_add(&items, &items_num, item);
1820 }
1821 break;
1822 }
1823 default: {
1824 RNA_enum_item_add(&items, &items_num, item);
1825 break;
1826 }
1827 }
1828 }
1829 RNA_enum_item_end(&items, &items_num);
1830 *r_free = true;
1831 return items;
1832}
1833
1834int rna_preference_asset_libray_import_method_default(PointerRNA *ptr, PropertyRNA * /*prop*/)
1835{
1836 if (RNA_struct_is_a(ptr->type, RNA_ProjectAssetLibrary)) {
1837 return ASSET_IMPORT_LINK;
1838 }
1839 return U.experimental.no_data_block_packing ? ASSET_IMPORT_APPEND_REUSE : ASSET_IMPORT_PACK;
1840}
1841
1842static void rna_experimental_no_data_block_packing_update(bContext *C, PointerRNA *ptr)
1843{
1844 Main *bmain = CTX_data_main(C);
1845 Scene *scene = CTX_data_scene(C);
1846 rna_userdef_update(bmain, scene, ptr);
1848 rna_userdef_asset_libraries_refresh(C, ptr);
1849}
1850
1851static void rna_experimental_use_3d_texture_paint_update(bContext *C, PointerRNA *ptr)
1852{
1853 Main *bmain = CTX_data_main(C);
1854 Scene *scene = CTX_data_scene(C);
1855 rna_userdef_update(bmain, scene, ptr);
1856
1857 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
1858 Object *object = CTX_data_active_object(C);
1859 if (!object || (object->mode & OB_MODE_TEXTURE_PAINT) == 0) {
1860 return;
1861 }
1862
1863 PropertyRNA *prop = RNA_struct_find_property(ptr, "use_3d_texture_paint");
1864 const bool new_value = RNA_property_boolean_get(ptr, prop);
1865
1866 if (new_value) {
1867 if (object->runtime->sculpt_session == nullptr) {
1870 BKE_scene_graph_evaluated_ensure(depsgraph, bmain);
1871 BKE_sculptsession_update_for_edit(depsgraph, object, true);
1872 }
1873 }
1874 else {
1875 BKE_sculptsession_free(object);
1876 }
1877}
1878
1879} // namespace blender
1880
1881#else
1882
1883namespace blender {
1884
1885# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \
1886 RNA_define_fallback_property_update(0, "rna_userdef_is_dirty_update")
1887
1888# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE RNA_define_fallback_property_update(0, nullptr)
1889
1890/* TODO(@sergey): This technically belongs to `blenlib`, but we don't link
1891 * makesrna against it.
1892 */
1893
1894/* Get maximum addressable memory in megabytes, */
1896{
1897 /* Maximum addressable bytes on this platform. */
1898 const size_t limit_bytes = size_t(1) << (sizeof(size_t[8]) - 1);
1899 /* Convert it to megabytes and return. */
1900 return (limit_bytes >> 20);
1901}
1902
1903/* Same as #max_memory_in_megabytes, but clipped to int capacity. */
1905{
1906 const size_t limit_megabytes = max_memory_in_megabytes();
1907 /* NOTE: The result will fit into integer. */
1908 return int(min_zz(limit_megabytes, size_t(INT_MAX)));
1909}
1910
1912{
1913 StructRNA *srna;
1914 PropertyRNA *prop;
1915
1916 srna = RNA_def_struct(brna, "ThemeFontStyle", nullptr);
1917 RNA_def_struct_sdna(srna, "uiFontStyle");
1918 RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
1919
1920 prop = RNA_def_property(srna, "points", PROP_FLOAT, PROP_UNSIGNED);
1921 RNA_def_property_range(prop, 6.0f, 32.0f);
1922 RNA_def_property_ui_range(prop, 8.0f, 20.0f, 10.0f, 1);
1923 RNA_def_property_ui_text(prop, "Points", "Font size in points");
1924 RNA_def_property_update(prop, 0, "rna_userdef_gpu_and_text_update");
1925
1926 prop = RNA_def_property(srna, "character_weight", PROP_INT, PROP_NONE);
1928 RNA_def_property_range(prop, 100.0f, 900.0f);
1929 RNA_def_property_ui_range(prop, 100.0f, 900.0f, 50, 0);
1931 prop, "Character Weight", "Weight of the characters. 100-900, 400 is normal.");
1932 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
1933
1934 prop = RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
1935 RNA_def_property_range(prop, 0, 6);
1936 RNA_def_property_ui_text(prop, "Shadow Size", "Shadow type (0 none, 3, 5 blur, 6 outline)");
1937 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1938
1939 prop = RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_PIXEL);
1940 RNA_def_property_int_sdna(prop, nullptr, "shadx");
1941 RNA_def_property_range(prop, -10, 10);
1942 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
1943 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1944
1945 prop = RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_PIXEL);
1946 RNA_def_property_int_sdna(prop, nullptr, "shady");
1947 RNA_def_property_range(prop, -10, 10);
1948 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
1949 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1950
1951 prop = RNA_def_property(srna, "shadow_alpha", PROP_FLOAT, PROP_FACTOR);
1952 RNA_def_property_float_sdna(prop, nullptr, "shadowalpha");
1953 RNA_def_property_range(prop, 0.0f, 1.0f);
1954 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
1955 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1956
1957 prop = RNA_def_property(srna, "shadow_value", PROP_FLOAT, PROP_FACTOR);
1958 RNA_def_property_float_sdna(prop, nullptr, "shadowcolor");
1959 RNA_def_property_range(prop, 0.0f, 1.0f);
1960 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in gray value");
1961 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1962}
1963
1965{
1966 StructRNA *srna;
1967 PropertyRNA *prop;
1968
1970
1971 srna = RNA_def_struct(brna, "ThemeStyle", nullptr);
1972 RNA_def_struct_sdna(srna, "uiStyle");
1973 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
1974
1975 prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
1977 RNA_def_property_pointer_sdna(prop, nullptr, "paneltitle");
1978 RNA_def_property_struct_type(prop, "ThemeFontStyle");
1979 RNA_def_property_ui_text(prop, "Panel Title Font", "");
1980 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1981
1982 prop = RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
1984 RNA_def_property_pointer_sdna(prop, nullptr, "widget");
1985 RNA_def_property_struct_type(prop, "ThemeFontStyle");
1986 RNA_def_property_ui_text(prop, "Widget Style", "");
1987 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1988
1989 prop = RNA_def_property(srna, "tooltip", PROP_POINTER, PROP_NONE);
1991 RNA_def_property_pointer_sdna(prop, nullptr, "tooltip");
1992 RNA_def_property_struct_type(prop, "ThemeFontStyle");
1993 RNA_def_property_ui_text(prop, "Tooltip Style", "");
1994 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1995}
1996
1998{
1999 StructRNA *srna;
2000 PropertyRNA *prop;
2001
2002 srna = RNA_def_struct(brna, "ThemeWidgetColors", nullptr);
2003 RNA_def_struct_sdna(srna, "uiWidgetColors");
2004 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
2005
2006 prop = RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
2007 RNA_def_property_array(prop, 4);
2008 RNA_def_property_ui_text(prop, "Outline", "");
2009 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2010
2011 prop = RNA_def_property(srna, "outline_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2012 RNA_def_property_array(prop, 4);
2013 RNA_def_property_ui_text(prop, "Outline Selected", "");
2014 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2015
2016 prop = RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
2017 RNA_def_property_array(prop, 4);
2018 RNA_def_property_ui_text(prop, "Inner", "");
2019 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2020
2021 prop = RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2022 RNA_def_property_array(prop, 4);
2023 RNA_def_property_ui_text(prop, "Inner Selected", "");
2024 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2025
2026 prop = RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
2027 RNA_def_property_array(prop, 4);
2028 RNA_def_property_ui_text(prop, "Item", "");
2029 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2030
2031 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2032 RNA_def_property_array(prop, 3);
2033 RNA_def_property_ui_text(prop, "Text", "");
2034 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2035
2036 prop = RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2037 RNA_def_property_array(prop, 3);
2038 RNA_def_property_ui_text(prop, "Text Selected", "");
2039 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2040
2041 prop = RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
2042 RNA_def_property_boolean_sdna(prop, nullptr, "shaded", 1);
2043 RNA_def_property_ui_text(prop, "Shaded", "");
2044 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2045
2046 prop = RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
2047 RNA_def_property_range(prop, -100, 100);
2048 RNA_def_property_ui_text(prop, "Shade Top", "");
2049 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2050
2051 prop = RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
2052 RNA_def_property_range(prop, -100, 100);
2053 RNA_def_property_ui_text(prop, "Shade Down", "");
2054 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2055
2056 prop = RNA_def_property(srna, "roundness", PROP_FLOAT, PROP_FACTOR);
2058 prop, "rna_ThemeUI_roundness_get", "rna_ThemeUI_roundness_set", nullptr);
2059 RNA_def_property_ui_text(prop, "Roundness", "Amount of edge rounding");
2060 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2061}
2062
2064{
2065 StructRNA *srna;
2066 PropertyRNA *prop;
2067
2068 srna = RNA_def_struct(brna, "ThemeWidgetStateColors", nullptr);
2069 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
2071 srna, "Theme Widget State Color", "Theme settings for widget state colors");
2072
2073 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_COLOR_GAMMA);
2074 RNA_def_property_array(prop, 4);
2075 RNA_def_property_ui_text(prop, "Error", "Color for error items");
2076 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2077
2078 prop = RNA_def_property(srna, "warning", PROP_FLOAT, PROP_COLOR_GAMMA);
2079 RNA_def_property_array(prop, 4);
2080 RNA_def_property_ui_text(prop, "Warning", "Color for warning items");
2081 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2082
2083 prop = RNA_def_property(srna, "info", PROP_FLOAT, PROP_COLOR_GAMMA);
2084 RNA_def_property_array(prop, 4);
2085 RNA_def_property_ui_text(prop, "Info", "Color for informational items");
2086 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2087
2088 prop = RNA_def_property(srna, "success", PROP_FLOAT, PROP_COLOR_GAMMA);
2089 RNA_def_property_array(prop, 4);
2090 RNA_def_property_ui_text(prop, "Success", "Color for successful items");
2091 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2092
2093 prop = RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
2094 RNA_def_property_array(prop, 3);
2095 RNA_def_property_ui_text(prop, "Animated", "");
2096 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2097
2098 prop = RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2099 RNA_def_property_array(prop, 3);
2100 RNA_def_property_ui_text(prop, "Animated Selected", "");
2101 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2102
2103 prop = RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
2104 RNA_def_property_array(prop, 3);
2105 RNA_def_property_ui_text(prop, "Keyframe", "");
2106 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2107
2108 prop = RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2109 RNA_def_property_array(prop, 3);
2110 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
2111 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2112
2113 prop = RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
2114 RNA_def_property_array(prop, 3);
2115 RNA_def_property_ui_text(prop, "Driven", "");
2116 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2117
2118 prop = RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2119 RNA_def_property_array(prop, 3);
2120 RNA_def_property_ui_text(prop, "Driven Selected", "");
2121 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2122
2123 prop = RNA_def_property(srna, "inner_overridden", PROP_FLOAT, PROP_COLOR_GAMMA);
2124 RNA_def_property_array(prop, 3);
2125 RNA_def_property_ui_text(prop, "Overridden", "");
2126 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2127
2128 prop = RNA_def_property(srna, "inner_overridden_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2129 RNA_def_property_array(prop, 3);
2130 RNA_def_property_ui_text(prop, "Overridden Selected", "");
2131 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2132
2133 prop = RNA_def_property(srna, "inner_changed", PROP_FLOAT, PROP_COLOR_GAMMA);
2134 RNA_def_property_array(prop, 3);
2135 RNA_def_property_ui_text(prop, "Changed", "");
2136 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2137
2138 prop = RNA_def_property(srna, "inner_changed_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
2139 RNA_def_property_array(prop, 3);
2140 RNA_def_property_ui_text(prop, "Changed Selected", "");
2141 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2142
2143 prop = RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
2144 RNA_def_property_ui_text(prop, "Blend", "");
2145 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2146}
2147
2150 "SINGLE_COLOR",
2151 0,
2152 "Single Color",
2153 "Use a solid color as viewport background"},
2155 "LINEAR",
2156 0,
2157 "Linear Gradient",
2158 "Use a screen space vertical linear gradient as viewport background"},
2160 "RADIAL",
2161 0,
2162 "Vignette",
2163 "Use a radial gradient as viewport background"},
2164 {0, nullptr, 0, nullptr, nullptr},
2165};
2166
2168{
2169 /* Fake struct, keep this for compatible theme presets. */
2170 StructRNA *srna;
2171 PropertyRNA *prop;
2172
2173 srna = RNA_def_struct(brna, "ThemeGradientColors", nullptr);
2174 RNA_def_struct_sdna(srna, "ThemeSpace");
2176 srna, "Theme Background Color", "Theme settings for background colors and gradient");
2177
2178 prop = RNA_def_property(srna, "background_type", PROP_ENUM, PROP_NONE);
2179 RNA_def_property_enum_sdna(prop, nullptr, "background_type");
2181 RNA_def_property_ui_text(prop, "Background Type", "Type of background in the 3D viewport");
2182 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2183
2184 prop = RNA_def_property(srna, "high_gradient", PROP_FLOAT, PROP_COLOR_GAMMA);
2185 RNA_def_property_float_sdna(prop, nullptr, "back");
2186 RNA_def_property_array(prop, 3);
2187 RNA_def_property_ui_text(prop, "Gradient High/Off", "");
2188 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2189
2190 prop = RNA_def_property(srna, "gradient", PROP_FLOAT, PROP_COLOR_GAMMA);
2191 RNA_def_property_float_sdna(prop, nullptr, "back_grad");
2192 RNA_def_property_array(prop, 3);
2193 RNA_def_property_ui_text(prop, "Gradient Low", "");
2194 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2195}
2196
2198{
2199 StructRNA *srna;
2200 PropertyRNA *prop;
2201
2205
2206 srna = RNA_def_struct(brna, "ThemeUserInterface", nullptr);
2207 RNA_def_struct_sdna(srna, "ThemeUI");
2209 srna, "Theme User Interface", "Theme settings for user interface elements");
2210
2211 prop = RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
2213 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
2214 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2215
2216 prop = RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
2218 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
2219 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2220
2221 prop = RNA_def_property(srna, "wcol_toolbar_item", PROP_POINTER, PROP_NONE);
2223 RNA_def_property_ui_text(prop, "Toolbar Item Widget Colors", "");
2224 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2225
2226 prop = RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
2228 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
2229 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2230
2231 prop = RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
2233 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
2234 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2235
2236 prop = RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
2238 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
2239 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2240
2241 prop = RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
2243 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
2244 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2245
2246 prop = RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
2248 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
2249 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2250
2251 prop = RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
2253 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
2254 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2255
2256 prop = RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
2258 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
2259 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2260
2261 prop = RNA_def_property(srna, "wcol_curve", PROP_POINTER, PROP_NONE);
2263 RNA_def_property_ui_text(prop, "Curve Widget Colors", "");
2264 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2265
2266 prop = RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
2268 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
2269 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2270
2271 prop = RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
2273 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
2274 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2275
2276 prop = RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
2278 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
2279 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2280
2281 prop = RNA_def_property(srna, "wcol_pie_menu", PROP_POINTER, PROP_NONE);
2283 RNA_def_property_ui_text(prop, "Pie Menu Colors", "");
2284 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2285
2286 prop = RNA_def_property(srna, "wcol_tooltip", PROP_POINTER, PROP_NONE);
2288 RNA_def_property_ui_text(prop, "Tooltip Colors", "");
2289 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2290
2291 prop = RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
2293 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
2294 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2295
2296 prop = RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
2298 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
2299 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2300
2301 prop = RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
2303 RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
2304 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2305
2306 prop = RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
2308 RNA_def_property_ui_text(prop, "List Item Colors", "");
2309 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2310
2311 prop = RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
2313 RNA_def_property_ui_text(prop, "State Colors", "");
2314 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2315
2316 prop = RNA_def_property(srna, "wcol_tab", PROP_POINTER, PROP_NONE);
2318 RNA_def_property_ui_text(prop, "Tab Colors", "");
2319 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2320
2321 prop = RNA_def_property(srna, "menu_shadow_fac", PROP_FLOAT, PROP_FACTOR);
2323 prop, "Panel/Menu Shadow Strength", "Blending factor for panel and menu shadows");
2324 RNA_def_property_range(prop, 0.01f, 1.0f);
2325 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2326
2327 prop = RNA_def_property(srna, "menu_shadow_width", PROP_INT, PROP_PIXEL);
2329 prop, "Panel/Menu Shadow Width", "Width of panel and menu shadows, set to zero to disable");
2330 RNA_def_property_range(prop, 0.0f, 24.0f);
2331 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2332
2333 prop = RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR);
2335 prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast");
2336 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2337
2338 prop = RNA_def_property(srna, "icon_saturation", PROP_FLOAT, PROP_FACTOR);
2339 RNA_def_property_ui_text(prop, "Icon Saturation", "Saturation of icons in the interface");
2340 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2341
2342 prop = RNA_def_property(srna, "widget_emboss", PROP_FLOAT, PROP_COLOR_GAMMA);
2343 RNA_def_property_float_sdna(prop, nullptr, "widget_emboss");
2344 RNA_def_property_array(prop, 4);
2346 prop, "Widget Emboss", "Color of the 1px shadow line underlying widgets");
2347 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2348
2349 prop = RNA_def_property(srna, "link", PROP_FLOAT, PROP_COLOR_GAMMA);
2350 RNA_def_property_float_sdna(prop, nullptr, "link");
2351 RNA_def_property_array(prop, 4);
2352 RNA_def_property_ui_text(prop, "Link", "Color of link widgets");
2353 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2354
2355 prop = RNA_def_property(srna, "editor_border", PROP_FLOAT, PROP_COLOR_GAMMA);
2356 RNA_def_property_float_sdna(prop, nullptr, "editor_border");
2357 RNA_def_property_array(prop, 3);
2358 RNA_def_property_ui_text(prop, "Editor Border", "Color of the border between editors");
2359 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2360
2361 prop = RNA_def_property(srna, "editor_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
2362 RNA_def_property_float_sdna(prop, nullptr, "editor_outline");
2363 RNA_def_property_array(prop, 4);
2365 prop, "Editor Outline", "Color of the outline of each editor, except the active one");
2366 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2367
2368 prop = RNA_def_property(srna, "editor_outline_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2369 RNA_def_property_float_sdna(prop, nullptr, "editor_outline_active");
2370 RNA_def_property_array(prop, 4);
2372 prop, "Active Editor Outline", "Color of the outline of the active editor");
2373 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2374
2375 prop = RNA_def_property(srna, "widget_text_cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
2376 RNA_def_property_float_sdna(prop, nullptr, "widget_text_cursor");
2377 RNA_def_property_array(prop, 3);
2378 RNA_def_property_ui_text(prop, "Text Cursor", "Color of the text insertion cursor (caret)");
2379 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2380
2381 prop = RNA_def_property(srna, "panel_roundness", PROP_FLOAT, PROP_FACTOR);
2383 prop, "Panel Roundness", "Roundness of the corners of panels and sub-panels");
2384 RNA_def_property_range(prop, 0.0f, 1.0f);
2386 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2387
2388 prop = RNA_def_property(srna, "panel_header", PROP_FLOAT, PROP_COLOR_GAMMA);
2389 RNA_def_property_ui_text(prop, "Panel Header", "");
2390 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2391
2392 prop = RNA_def_property(srna, "panel_title", PROP_FLOAT, PROP_COLOR_GAMMA);
2393 RNA_def_property_array(prop, 3);
2394 RNA_def_property_ui_text(prop, "Panel Title", "");
2395 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2396
2397 prop = RNA_def_property(srna, "panel_text", PROP_FLOAT, PROP_COLOR_GAMMA);
2398 RNA_def_property_array(prop, 3);
2399 RNA_def_property_ui_text(prop, "Panel Text", "");
2400 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2401
2402 prop = RNA_def_property(srna, "panel_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2403 RNA_def_property_ui_text(prop, "Panel Background", "");
2404 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2405
2406 prop = RNA_def_property(srna, "panel_sub_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2407 RNA_def_property_ui_text(prop, "Sub-Panel Background", "");
2408 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2409
2410 prop = RNA_def_property(srna, "panel_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
2411 RNA_def_property_ui_text(prop, "Panel Outline", "Color of the outline of top-level panels");
2412 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2413
2414 prop = RNA_def_property(srna, "panel_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2415 RNA_def_property_array(prop, 4);
2417 prop, "Active Panel Outline", "Color of the outline of top-level panels that are active");
2418 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2419
2420 /* Transparent Grid */
2421 prop = RNA_def_property(srna, "transparent_checker_primary", PROP_FLOAT, PROP_COLOR_GAMMA);
2422 RNA_def_property_float_sdna(prop, nullptr, "transparent_checker_primary");
2423 RNA_def_property_array(prop, 3);
2425 prop, "Primary Color", "Primary color of checkerboard pattern indicating transparent areas");
2426 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2427
2428 prop = RNA_def_property(srna, "transparent_checker_secondary", PROP_FLOAT, PROP_COLOR_GAMMA);
2429 RNA_def_property_float_sdna(prop, nullptr, "transparent_checker_secondary");
2430 RNA_def_property_array(prop, 3);
2432 "Secondary Color",
2433 "Secondary color of checkerboard pattern indicating transparent areas");
2434 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2435
2436 prop = RNA_def_property(srna, "transparent_checker_size", PROP_INT, PROP_PIXEL);
2438 prop, "Checkerboard Size", "Size of checkerboard pattern indicating transparent areas");
2439 RNA_def_property_range(prop, 2, 48);
2440 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2441
2442 /* axis */
2443 prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_COLOR_GAMMA);
2444 RNA_def_property_float_sdna(prop, nullptr, "xaxis");
2445 RNA_def_property_array(prop, 3);
2446 RNA_def_property_ui_text(prop, "X Axis", "");
2447 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2448
2449 prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_COLOR_GAMMA);
2450 RNA_def_property_float_sdna(prop, nullptr, "yaxis");
2451 RNA_def_property_array(prop, 3);
2452 RNA_def_property_ui_text(prop, "Y Axis", "");
2453 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2454
2455 prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_COLOR_GAMMA);
2456 RNA_def_property_float_sdna(prop, nullptr, "zaxis");
2457 RNA_def_property_array(prop, 3);
2458 RNA_def_property_ui_text(prop, "Z Axis", "");
2459 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2460
2461 prop = RNA_def_property(srna, "axis_w", PROP_FLOAT, PROP_COLOR_GAMMA);
2462 RNA_def_property_float_sdna(prop, nullptr, "waxis");
2463 RNA_def_property_array(prop, 3);
2464 RNA_def_property_ui_text(prop, "W Axis", "W-axis for quaternion and axis-angle rotations");
2465 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2466
2467 /* Generic gizmo colors. */
2468 prop = RNA_def_property(srna, "gizmo_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
2469 RNA_def_property_float_sdna(prop, nullptr, "gizmo_hi");
2470 RNA_def_property_array(prop, 3);
2471 RNA_def_property_ui_text(prop, "Gizmo Highlight", "");
2472 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2473
2474 prop = RNA_def_property(srna, "gizmo_primary", PROP_FLOAT, PROP_COLOR_GAMMA);
2475 RNA_def_property_float_sdna(prop, nullptr, "gizmo_primary");
2476 RNA_def_property_array(prop, 3);
2477 RNA_def_property_ui_text(prop, "Gizmo Primary", "");
2478 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2479
2480 prop = RNA_def_property(srna, "gizmo_secondary", PROP_FLOAT, PROP_COLOR_GAMMA);
2481 RNA_def_property_float_sdna(prop, nullptr, "gizmo_secondary");
2482 RNA_def_property_array(prop, 3);
2483 RNA_def_property_ui_text(prop, "Gizmo Secondary", "");
2484 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2485
2486 prop = RNA_def_property(srna, "gizmo_view_align", PROP_FLOAT, PROP_COLOR_GAMMA);
2487 RNA_def_property_float_sdna(prop, nullptr, "gizmo_view_align");
2488 RNA_def_property_array(prop, 3);
2489 RNA_def_property_ui_text(prop, "Gizmo View Align", "");
2490 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2491
2492 prop = RNA_def_property(srna, "gizmo_a", PROP_FLOAT, PROP_COLOR_GAMMA);
2493 RNA_def_property_float_sdna(prop, nullptr, "gizmo_a");
2494 RNA_def_property_array(prop, 3);
2495 RNA_def_property_ui_text(prop, "Gizmo A", "");
2496 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2497
2498 prop = RNA_def_property(srna, "gizmo_b", PROP_FLOAT, PROP_COLOR_GAMMA);
2499 RNA_def_property_float_sdna(prop, nullptr, "gizmo_b");
2500 RNA_def_property_array(prop, 3);
2501 RNA_def_property_ui_text(prop, "Gizmo B", "");
2502 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2503
2504 /* Icon colors. */
2505 prop = RNA_def_property(srna, "icon_scene", PROP_FLOAT, PROP_COLOR_GAMMA);
2506 RNA_def_property_float_sdna(prop, nullptr, "icon_scene");
2507 RNA_def_property_array(prop, 4);
2508 RNA_def_property_ui_text(prop, "Scene", "");
2509 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2510
2511 prop = RNA_def_property(srna, "icon_collection", PROP_FLOAT, PROP_COLOR_GAMMA);
2512 RNA_def_property_float_sdna(prop, nullptr, "icon_collection");
2513 RNA_def_property_array(prop, 4);
2514 RNA_def_property_ui_text(prop, "Collection", "");
2515 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2516
2517 prop = RNA_def_property(srna, "icon_object", PROP_FLOAT, PROP_COLOR_GAMMA);
2518 RNA_def_property_float_sdna(prop, nullptr, "icon_object");
2519 RNA_def_property_array(prop, 4);
2520 RNA_def_property_ui_text(prop, "Object", "");
2521 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2522
2523 prop = RNA_def_property(srna, "icon_object_data", PROP_FLOAT, PROP_COLOR_GAMMA);
2524 RNA_def_property_float_sdna(prop, nullptr, "icon_object_data");
2525 RNA_def_property_array(prop, 4);
2526 RNA_def_property_ui_text(prop, "Object Data", "");
2527 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2528
2529 prop = RNA_def_property(srna, "icon_modifier", PROP_FLOAT, PROP_COLOR_GAMMA);
2530 RNA_def_property_float_sdna(prop, nullptr, "icon_modifier");
2531 RNA_def_property_array(prop, 4);
2532 RNA_def_property_ui_text(prop, "Modifier", "");
2533 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2534
2535 prop = RNA_def_property(srna, "icon_shading", PROP_FLOAT, PROP_COLOR_GAMMA);
2536 RNA_def_property_float_sdna(prop, nullptr, "icon_shading");
2537 RNA_def_property_array(prop, 4);
2538 RNA_def_property_ui_text(prop, "Shading", "");
2539 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2540
2541 prop = RNA_def_property(srna, "icon_folder", PROP_FLOAT, PROP_COLOR_GAMMA);
2542 RNA_def_property_float_sdna(prop, nullptr, "icon_folder");
2543 RNA_def_property_array(prop, 4);
2544 RNA_def_property_ui_text(prop, "File Folders", "Color of folders in the file browser");
2545 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2546
2547 prop = RNA_def_property(srna, "icon_autokey", PROP_FLOAT, PROP_COLOR_GAMMA);
2548 RNA_def_property_float_sdna(prop, nullptr, "icon_autokey");
2549 RNA_def_property_array(prop, 4);
2551 prop, "Auto Keying Indicator", "Color of Auto Keying indicator when enabled");
2552 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2553
2554 prop = RNA_def_property(srna, "icon_border_intensity", PROP_FLOAT, PROP_FACTOR);
2555 RNA_def_property_float_sdna(prop, nullptr, "icon_border_intensity");
2557 prop, "Icon Border", "Control the intensity of the border around themes icons");
2558 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
2559 RNA_def_property_update(prop, 0, "rna_userdef_theme_update_icons");
2560}
2561
2562/* Asset Shelf region */
2564{
2565 StructRNA *srna;
2566 PropertyRNA *prop;
2567
2568 srna = RNA_def_struct(brna, "ThemeRegionsAssetShelf", nullptr);
2569 RNA_def_struct_ui_text(srna, "Asset Shelf Region Theme", "Theme settings for asset shelves");
2570
2571 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2572 RNA_def_property_array(prop, 4);
2573 RNA_def_property_ui_text(prop, "Background", "");
2574 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2575
2576 prop = RNA_def_property(srna, "header_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2577 RNA_def_property_array(prop, 4);
2578 RNA_def_property_ui_text(prop, "Header Background", "");
2579 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2580}
2581
2582/* Channels region */
2584{
2585 StructRNA *srna;
2586 PropertyRNA *prop;
2587
2588 srna = RNA_def_struct(brna, "ThemeRegionsChannels", nullptr);
2589 RNA_def_struct_ui_text(srna, "Source List Region Settings", "");
2590
2591 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2592 RNA_def_property_array(prop, 3);
2593 RNA_def_property_ui_text(prop, "Background", "");
2594 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2595
2596 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2597 RNA_def_property_array(prop, 3);
2598 RNA_def_property_ui_text(prop, "Text", "");
2599 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2600
2601 prop = RNA_def_property(srna, "text_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2602 RNA_def_property_array(prop, 3);
2603 RNA_def_property_ui_text(prop, "Selected Text", "");
2604 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2605}
2606
2607/* Scrubbing / Markers region */
2609{
2610 StructRNA *srna;
2611 PropertyRNA *prop;
2612
2613 srna = RNA_def_struct(brna, "ThemeRegionsScrubbing", nullptr);
2614 RNA_def_struct_ui_text(srna, "Scrubbing & Markers Region Settings", "");
2615
2616 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2617 RNA_def_property_array(prop, 4);
2618 RNA_def_property_ui_text(prop, "Background", "");
2619 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2620
2621 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2622 RNA_def_property_array(prop, 3);
2623 RNA_def_property_ui_text(prop, "Timestamp", "");
2624 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2625
2626 /* Marker properties */
2627 prop = RNA_def_property(srna, "time_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
2628 RNA_def_property_array(prop, 4);
2629 RNA_def_property_ui_text(prop, "Marker", "");
2630 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2631
2632 prop = RNA_def_property(srna, "time_marker_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2633 RNA_def_property_array(prop, 4);
2634 RNA_def_property_ui_text(prop, "Marker Selected", "");
2635 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2636}
2637
2638/* Sidebar & Toolbar region */
2640{
2641 StructRNA *srna;
2642 PropertyRNA *prop;
2643
2644 srna = RNA_def_struct(brna, "ThemeRegionsSidebars", nullptr);
2645 RNA_def_struct_ui_text(srna, "Sidebar & Toolbar Region Settings", "");
2646
2647 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2648 RNA_def_property_array(prop, 4);
2649 RNA_def_property_ui_text(prop, "Background", "");
2650 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2651
2652 prop = RNA_def_property(srna, "tab_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2653 RNA_def_property_array(prop, 4);
2654 RNA_def_property_ui_text(prop, "Navigation/Tabs Background", "");
2655 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2656}
2657
2659{
2660 StructRNA *srna;
2661 PropertyRNA *prop;
2662
2667
2668 srna = RNA_def_struct(brna, "ThemeRegions", nullptr);
2670 "Shared Region Properties",
2671 "Theme settings for regions that are common among editors");
2672
2673 prop = RNA_def_property(srna, "asset_shelf", PROP_POINTER, PROP_NONE);
2675 RNA_def_property_ui_text(prop, "Asset Shelf", "");
2676 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2677
2678 prop = RNA_def_property(srna, "channels", PROP_POINTER, PROP_NONE);
2680 RNA_def_property_ui_text(prop, "Channels", "");
2681 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2682
2683 prop = RNA_def_property(srna, "scrubbing", PROP_POINTER, PROP_NONE);
2685 RNA_def_property_ui_text(prop, "Scrubbing / Markers", "");
2686 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2687
2688 prop = RNA_def_property(srna, "sidebars", PROP_POINTER, PROP_NONE);
2690 RNA_def_property_ui_text(prop, "Toolbar / Sidebar", "");
2691 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2692}
2693
2695{
2696 StructRNA *srna;
2697 PropertyRNA *prop;
2698
2699 srna = RNA_def_struct(brna, "ThemeCommonAnim", nullptr);
2700 RNA_def_struct_sdna(srna, "ThemeCommonAnim");
2701 RNA_def_struct_ui_text(srna, "Common Animation Properties", "Shared animation theme properties");
2702
2703 prop = RNA_def_property(srna, "playhead", PROP_FLOAT, PROP_COLOR_GAMMA);
2704 RNA_def_property_float_sdna(prop, nullptr, "playhead");
2705 RNA_def_property_array(prop, 4);
2706 RNA_def_property_ui_text(prop, "Playhead", "");
2707 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2708
2709 prop = RNA_def_property(srna, "preview_range", PROP_FLOAT, PROP_COLOR_GAMMA);
2710 RNA_def_property_float_sdna(prop, nullptr, "preview_range");
2711 RNA_def_property_array(prop, 4);
2712 RNA_def_property_ui_text(prop, "Preview Range", "Color of preview range overlay");
2713 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2714
2715 prop = RNA_def_property(srna, "scene_strip_range", PROP_FLOAT, PROP_COLOR_GAMMA);
2716 RNA_def_property_float_sdna(prop, nullptr, "scene_strip_range");
2717 RNA_def_property_array(prop, 4);
2718 RNA_def_property_ui_text(prop, "Scene Strip Range", "Color of scene strip range overlay");
2719 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2720
2721 /* Channel properties */
2722 prop = RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
2723 RNA_def_property_array(prop, 4);
2724 RNA_def_property_ui_text(prop, "Channels", "");
2725 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2726
2727 prop = RNA_def_property(srna, "channels_sub", PROP_FLOAT, PROP_COLOR_GAMMA);
2728 RNA_def_property_array(prop, 4);
2729 RNA_def_property_ui_text(prop, "Sub-channels", "");
2730 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2731
2732 prop = RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
2733 RNA_def_property_float_sdna(prop, nullptr, "channel_group");
2734 RNA_def_property_array(prop, 4);
2735 RNA_def_property_ui_text(prop, "Channel Group", "");
2736 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2737
2738 prop = RNA_def_property(srna, "channel_group_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2739 RNA_def_property_float_sdna(prop, nullptr, "channel_group_active");
2740 RNA_def_property_array(prop, 4);
2741 RNA_def_property_ui_text(prop, "Active Channel Group", "");
2742 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2743
2744 prop = RNA_def_property(srna, "channel", PROP_FLOAT, PROP_COLOR_GAMMA);
2745 RNA_def_property_array(prop, 4);
2746 RNA_def_property_ui_text(prop, "Channel", "");
2747 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2748
2749 prop = RNA_def_property(srna, "channel_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2750 RNA_def_property_array(prop, 4);
2751 RNA_def_property_ui_text(prop, "Selected Channel", "");
2752 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2753
2754 /* Keyframe properties */
2755 prop = RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
2756 RNA_def_property_array(prop, 3);
2757 RNA_def_property_ui_text(prop, "Keyframe", "Color of regular keyframe");
2758 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2759
2760 prop = RNA_def_property(srna, "keyframe_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2761 RNA_def_property_array(prop, 3);
2762 RNA_def_property_ui_text(prop, "Keyframe Selected", "Color of selected keyframe");
2763 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2764
2765 prop = RNA_def_property(srna, "keyframe_extreme", PROP_FLOAT, PROP_COLOR_GAMMA);
2766 RNA_def_property_array(prop, 3);
2767 RNA_def_property_ui_text(prop, "Extreme Keyframe", "Color of extreme keyframe");
2768 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2769
2770 prop = RNA_def_property(srna, "keyframe_extreme_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2771 RNA_def_property_array(prop, 3);
2773 prop, "Extreme Keyframe Selected", "Color of selected extreme keyframe");
2774 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2775
2776 prop = RNA_def_property(srna, "keyframe_breakdown", PROP_FLOAT, PROP_COLOR_GAMMA);
2777 RNA_def_property_array(prop, 3);
2778 RNA_def_property_ui_text(prop, "Breakdown Keyframe", "Color of breakdown keyframe");
2779 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2780
2781 prop = RNA_def_property(srna, "keyframe_breakdown_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2782 RNA_def_property_array(prop, 3);
2784 prop, "Breakdown Keyframe Selected", "Color of selected breakdown keyframe");
2785 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2786
2787 prop = RNA_def_property(srna, "keyframe_jitter", PROP_FLOAT, PROP_COLOR_GAMMA);
2788 RNA_def_property_array(prop, 3);
2789 RNA_def_property_ui_text(prop, "Jitter Keyframe", "Color of jitter keyframe");
2790 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2791
2792 prop = RNA_def_property(srna, "keyframe_jitter_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2793 RNA_def_property_array(prop, 3);
2794 RNA_def_property_ui_text(prop, "Jitter Keyframe Selected", "Color of selected jitter keyframe");
2795 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2796
2797 prop = RNA_def_property(srna, "keyframe_moving_hold", PROP_FLOAT, PROP_COLOR_GAMMA);
2798 RNA_def_property_array(prop, 3);
2799 RNA_def_property_ui_text(prop, "Moving Hold Keyframe", "Color of moving hold keyframe");
2800 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2801
2802 prop = RNA_def_property(srna, "keyframe_moving_hold_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2803 RNA_def_property_array(prop, 3);
2805 prop, "Moving Hold Keyframe Selected", "Color of selected moving hold keyframe");
2806 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2807
2808 prop = RNA_def_property(srna, "keyframe_generated", PROP_FLOAT, PROP_COLOR_GAMMA);
2809 RNA_def_property_array(prop, 3);
2810 RNA_def_property_ui_text(prop, "Generated Keyframe", "Color of generated keyframe");
2811 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2812
2813 prop = RNA_def_property(srna, "keyframe_generated_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2814 RNA_def_property_array(prop, 3);
2816 prop, "Generated Keyframe Selected", "Color of selected generated keyframe");
2817 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2818
2819 prop = RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
2820 RNA_def_property_array(prop, 4);
2821 RNA_def_property_ui_text(prop, "Long Key", "");
2822 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2823
2824 prop = RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2825 RNA_def_property_array(prop, 4);
2826 RNA_def_property_ui_text(prop, "Long Key Selected", "");
2827 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2828}
2829
2831{
2832 StructRNA *srna;
2833 PropertyRNA *prop;
2834
2835 srna = RNA_def_struct(brna, "ThemeCommonCurves", nullptr);
2836 RNA_def_struct_sdna(srna, "ThemeCommonCurves");
2837 RNA_def_struct_ui_text(srna, "Common Curve Properties", "Shared curve theme properties");
2838
2839 /* Curve handle colors. */
2840 prop = RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
2841 RNA_def_property_float_sdna(prop, nullptr, "handle_free");
2842 RNA_def_property_array(prop, 3);
2843 RNA_def_property_ui_text(prop, "Free Handle", "");
2844 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2845
2846 prop = RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
2847 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_free");
2848 RNA_def_property_array(prop, 3);
2849 RNA_def_property_ui_text(prop, "Free Handle Selected", "");
2850 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2851
2852 prop = RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
2853 RNA_def_property_float_sdna(prop, nullptr, "handle_auto");
2854 RNA_def_property_array(prop, 3);
2855 RNA_def_property_ui_text(prop, "Auto Handle", "");
2856 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2857
2858 prop = RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
2859 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_auto");
2860 RNA_def_property_array(prop, 3);
2861 RNA_def_property_ui_text(prop, "Auto Handle Selected", "");
2862 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2863
2864 prop = RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
2865 RNA_def_property_float_sdna(prop, nullptr, "handle_vect");
2866 RNA_def_property_array(prop, 3);
2867 RNA_def_property_ui_text(prop, "Vector Handle", "");
2868 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2869
2870 prop = RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
2871 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_vect");
2872 RNA_def_property_array(prop, 3);
2873 RNA_def_property_ui_text(prop, "Vector Handle Selected", "");
2874 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2875
2876 prop = RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
2877 RNA_def_property_float_sdna(prop, nullptr, "handle_align");
2878 RNA_def_property_array(prop, 3);
2879 RNA_def_property_ui_text(prop, "Align Handle", "");
2880 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2881
2882 prop = RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
2883 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_align");
2884 RNA_def_property_array(prop, 3);
2885 RNA_def_property_ui_text(prop, "Align Handle Selected", "");
2886 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2887
2888 prop = RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
2889 RNA_def_property_float_sdna(prop, nullptr, "handle_auto_clamped");
2890 RNA_def_property_array(prop, 3);
2891 RNA_def_property_ui_text(prop, "Auto-Clamped Handle", "");
2892 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2893
2894 prop = RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
2895 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_auto_clamped");
2896 RNA_def_property_array(prop, 3);
2897 RNA_def_property_ui_text(prop, "Auto-Clamped Handle Selected", "");
2898 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2899
2900 /* Curve handle point colors & size. */
2901 prop = RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
2902 RNA_def_property_array(prop, 3);
2903 RNA_def_property_ui_text(prop, "Handle Vertex", "");
2904 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2905
2906 prop = RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2907 RNA_def_property_array(prop, 3);
2908 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
2909 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2910
2911 prop = RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_PIXEL);
2912 RNA_def_property_range(prop, 1, 100);
2913 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
2914 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2915}
2916
2918{
2919 StructRNA *srna;
2920 PropertyRNA *prop;
2921
2924
2925 srna = RNA_def_struct(brna, "ThemeCommon", nullptr);
2927 srna, "Common Theme Properties", "Theme properties shared by different editors");
2928
2929 prop = RNA_def_property(srna, "anim", PROP_POINTER, PROP_NONE);
2931 RNA_def_property_ui_text(prop, "Animation", "");
2932 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2933
2934 prop = RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
2936 RNA_def_property_ui_text(prop, "Curves", "");
2937 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2938}
2939
2941{
2942 PropertyRNA *prop;
2943
2944 /* header */
2945 prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
2946 RNA_def_property_array(prop, 4);
2947 RNA_def_property_ui_text(prop, "Header", "");
2948 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2949
2950 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2951 RNA_def_property_array(prop, 3);
2952 RNA_def_property_ui_text(prop, "Text", "");
2953 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2954
2955 prop = RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
2956 RNA_def_property_array(prop, 3);
2957 RNA_def_property_ui_text(prop, "Text Highlight", "");
2958 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2959}
2960
2962{
2963 StructRNA *srna;
2964 PropertyRNA *prop;
2965
2966 srna = RNA_def_struct(brna, "ThemeSpaceGradient", nullptr);
2967 RNA_def_struct_sdna(srna, "ThemeSpace");
2968 RNA_def_struct_ui_text(srna, "Theme Space Settings", "");
2969
2970 /* gradient/background settings */
2971 prop = RNA_def_property(srna, "gradients", PROP_POINTER, PROP_NONE);
2973 RNA_def_property_struct_type(prop, "ThemeGradientColors");
2974 RNA_def_property_pointer_funcs(prop, "rna_Theme_gradient_colors_get", nullptr, nullptr, nullptr);
2975 RNA_def_property_ui_text(prop, "Gradient Colors", "");
2976 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2977
2979}
2980
2982{
2983 StructRNA *srna;
2984 PropertyRNA *prop;
2985
2986 srna = RNA_def_struct(brna, "ThemeSpaceGeneric", nullptr);
2987 RNA_def_struct_sdna(srna, "ThemeSpace");
2988 RNA_def_struct_ui_text(srna, "Theme Space Settings", "");
2989
2990 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2991 RNA_def_property_array(prop, 3);
2992 RNA_def_property_ui_text(prop, "Window Background", "");
2993 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2994
2996}
2997
2999{
3000 PropertyRNA *prop;
3001
3002 prop = RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
3004 RNA_def_property_struct_type(prop, "ThemeSpaceGeneric");
3005 RNA_def_property_pointer_funcs(prop, "rna_Theme_space_generic_get", nullptr, nullptr, nullptr);
3006 RNA_def_property_ui_text(prop, "Theme Space", "Settings for space");
3007}
3008
3010{
3011 PropertyRNA *prop;
3012
3013 prop = RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
3015 RNA_def_property_struct_type(prop, "ThemeSpaceGradient");
3016 RNA_def_property_pointer_funcs(prop, "rna_Theme_space_gradient_get", nullptr, nullptr, nullptr);
3017 RNA_def_property_ui_text(prop, "Theme Space", "Settings for space");
3018}
3019
3020static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna, const bool has_vertex_active)
3021{
3022 PropertyRNA *prop;
3023
3024 prop = RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
3025 RNA_def_property_array(prop, 3);
3026 RNA_def_property_ui_text(prop, "Vertex", "");
3027 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3028
3029 prop = RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3030 RNA_def_property_array(prop, 3);
3031 RNA_def_property_ui_text(prop, "Vertex Select", "");
3032 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3033
3034 if (has_vertex_active) {
3035 prop = RNA_def_property(srna, "vertex_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3036 RNA_def_property_array(prop, 3);
3037 RNA_def_property_ui_text(prop, "Active Vertex", "");
3038 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3039 }
3040
3041 prop = RNA_def_property(srna, "vertex_size", PROP_INT, PROP_PIXEL);
3042 RNA_def_property_range(prop, 1, 32);
3043 RNA_def_property_ui_text(prop, "Vertex Size", "");
3044 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3045}
3046
3048{
3049 PropertyRNA *prop;
3050
3051 prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3052 RNA_def_property_array(prop, 3);
3053 RNA_def_property_ui_text(prop, "Edge Selection", "");
3054 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3055
3056 prop = RNA_def_property(srna, "edge_mode_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3057 RNA_def_property_array(prop, 3);
3058 RNA_def_property_ui_text(prop, "Edge Mode Selection", "");
3059 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3060}
3061
3062static void rna_def_userdef_theme_spaces_face(StructRNA *srna, const bool has_face_orientation)
3063{
3064 PropertyRNA *prop;
3065
3066 prop = RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
3067 RNA_def_property_array(prop, 4);
3068 RNA_def_property_ui_text(prop, "Face", "");
3069 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3070
3071 prop = RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3072 RNA_def_property_array(prop, 4);
3073 RNA_def_property_ui_text(prop, "Face Selection", "");
3074 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3075
3076 prop = RNA_def_property(srna, "face_mode_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3077 RNA_def_property_array(prop, 4);
3078 RNA_def_property_ui_text(prop, "Face Mode Selection", "");
3079 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3080
3081 prop = RNA_def_property(srna, "facedot_size", PROP_INT, PROP_PIXEL);
3082 RNA_def_property_range(prop, 1, 10);
3083 RNA_def_property_ui_text(prop, "Face Dot Size", "");
3084 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3085
3086 if (has_face_orientation) {
3087 prop = RNA_def_property(srna, "face_back", PROP_FLOAT, PROP_COLOR_GAMMA);
3088 RNA_def_property_array(prop, 4);
3089 RNA_def_property_ui_text(prop, "Face Orientation Back", "");
3090 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3091
3092 prop = RNA_def_property(srna, "face_front", PROP_FLOAT, PROP_COLOR_GAMMA);
3093 RNA_def_property_array(prop, 4);
3094 RNA_def_property_ui_text(prop, "Face Orientation Front", "");
3095 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3096 }
3097}
3098
3100{
3101 PropertyRNA *prop;
3102
3103 prop = RNA_def_property(srna, "gp_wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA);
3104 RNA_def_property_array(prop, 4);
3106 prop, "Grease Pencil Wire Edit", "Grease Pencil wireframe color when in edit mode");
3107 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3108
3109 prop = RNA_def_property(srna, "gp_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
3110 RNA_def_property_array(prop, 3);
3111 RNA_def_property_ui_text(prop, "Grease Pencil Vertex", "");
3112 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3113
3114 prop = RNA_def_property(srna, "gp_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3115 RNA_def_property_array(prop, 3);
3116 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Select", "");
3117 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3118
3119 prop = RNA_def_property(srna, "gp_vertex_size", PROP_INT, PROP_PIXEL);
3120 RNA_def_property_range(prop, 1, 10);
3121 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Size", "");
3122 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3123}
3124
3126{
3127 StructRNA *srna;
3128 PropertyRNA *prop;
3129
3130 /* space_view3d */
3131
3132 srna = RNA_def_struct(brna, "ThemeView3D", nullptr);
3133 RNA_def_struct_sdna(srna, "ThemeSpace");
3134 RNA_def_struct_ui_text(srna, "Theme 3D Viewport", "Theme settings for the 3D viewport");
3135
3137
3138 /* General Viewport options */
3139
3140 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3141 RNA_def_property_array(prop, 4);
3142 RNA_def_property_ui_text(prop, "Grid", "");
3143 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3144
3145 prop = RNA_def_property(srna, "grid_major", PROP_FLOAT, PROP_COLOR_GAMMA);
3146 RNA_def_property_array(prop, 4);
3147 RNA_def_property_ui_text(prop, "Major Grid Lines", "");
3148 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3149
3150 prop = RNA_def_property(srna, "grid_axis_brightness", PROP_FLOAT, PROP_FACTOR);
3151 RNA_def_property_float_sdna(prop, nullptr, "grid_axis_brightness");
3153 RNA_def_property_ui_text(prop, "Grid Axis Brightness", "Brightness of the grid axis lines");
3154 RNA_def_property_range(prop, 0.0f, 1.0f);
3155 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3156
3157 prop = RNA_def_property(srna, "clipping_border_3d", PROP_FLOAT, PROP_COLOR_GAMMA);
3158 RNA_def_property_array(prop, 4);
3159 RNA_def_property_ui_text(prop, "Clipping Border", "");
3160 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3161
3162 prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
3163 RNA_def_property_array(prop, 3);
3164 RNA_def_property_ui_text(prop, "Wire", "");
3165 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3166
3167 prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA);
3168 RNA_def_property_array(prop, 3);
3170 prop, "Wire Edit", "Color for wireframe when in edit mode, but edge selection is active");
3171 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3172
3173 prop = RNA_def_property(srna, "edge_width", PROP_INT, PROP_PIXEL);
3174 RNA_def_property_range(prop, 1, 32);
3175 RNA_def_property_ui_text(prop, "Edge Width", "");
3176 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3177
3178 /* Grease Pencil */
3179
3181
3182 prop = RNA_def_property(srna, "text_grease_pencil", PROP_FLOAT, PROP_COLOR_GAMMA);
3183 RNA_def_property_float_sdna(prop, nullptr, "time_gp_keyframe");
3184 RNA_def_property_array(prop, 3);
3186 prop, "Grease Pencil Keyframe", "Color for indicating Grease Pencil keyframes");
3187 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3188
3189 /* Object specific options */
3190
3191 prop = RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3192 RNA_def_property_float_sdna(prop, nullptr, "select");
3193 RNA_def_property_array(prop, 3);
3194 RNA_def_property_ui_text(prop, "Object Selected", "");
3195 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3196
3197 prop = RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3198 RNA_def_property_float_sdna(prop, nullptr, "active");
3199 RNA_def_property_array(prop, 3);
3200 RNA_def_property_ui_text(prop, "Active Object", "");
3201 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3202
3203 /* Object type options */
3204
3205 prop = RNA_def_property(srna, "camera", PROP_FLOAT, PROP_COLOR_GAMMA);
3206 RNA_def_property_array(prop, 3);
3207 RNA_def_property_ui_text(prop, "Camera", "");
3208 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3209
3210 prop = RNA_def_property(srna, "empty", PROP_FLOAT, PROP_COLOR_GAMMA);
3211 RNA_def_property_array(prop, 3);
3212 RNA_def_property_ui_text(prop, "Empty", "");
3214 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3215
3216 prop = RNA_def_property(srna, "light", PROP_FLOAT, PROP_COLOR_GAMMA);
3217 RNA_def_property_float_sdna(prop, nullptr, "lamp");
3218 RNA_def_property_array(prop, 4);
3219 RNA_def_property_ui_text(prop, "Light", "");
3221 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3222
3223 prop = RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
3224 RNA_def_property_array(prop, 3);
3225 RNA_def_property_ui_text(prop, "Speaker", "");
3226 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3227
3228 /* Mesh Object specific */
3229
3233
3234 prop = RNA_def_property(srna, "bevel", PROP_FLOAT, PROP_COLOR_GAMMA);
3235 RNA_def_property_array(prop, 3);
3236 RNA_def_property_ui_text(prop, "Bevel", "");
3237 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
3238
3239 prop = RNA_def_property(srna, "seam", PROP_FLOAT, PROP_COLOR_GAMMA);
3240 RNA_def_property_array(prop, 3);
3241 RNA_def_property_ui_text(prop, "Seam", "");
3242 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
3243
3244 prop = RNA_def_property(srna, "sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
3245 RNA_def_property_array(prop, 3);
3246 RNA_def_property_ui_text(prop, "Sharp", "");
3247 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
3248
3249 prop = RNA_def_property(srna, "crease", PROP_FLOAT, PROP_COLOR_GAMMA);
3250 RNA_def_property_array(prop, 3);
3251 RNA_def_property_ui_text(prop, "Crease", "");
3253 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
3254
3255 prop = RNA_def_property(srna, "freestyle", PROP_FLOAT, PROP_COLOR_GAMMA);
3256 RNA_def_property_array(prop, 4);
3257 RNA_def_property_ui_text(prop, "Freestyle", "");
3258 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3259
3260 prop = RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
3261 RNA_def_property_array(prop, 3);
3262 RNA_def_property_ui_text(prop, "Edge Length Text", "");
3263 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3264
3265 prop = RNA_def_property(srna, "extra_edge_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
3266 RNA_def_property_array(prop, 3);
3267 RNA_def_property_ui_text(prop, "Edge Angle Text", "");
3268 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3269
3270 prop = RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
3271 RNA_def_property_array(prop, 3);
3272 RNA_def_property_ui_text(prop, "Face Angle Text", "");
3273 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3274
3275 prop = RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
3276 RNA_def_property_array(prop, 3);
3277 RNA_def_property_ui_text(prop, "Face Area Text", "");
3278 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3279
3280 prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3281 RNA_def_property_array(prop, 4);
3282 RNA_def_property_ui_text(prop, "Active Vertex/Edge/Face", "");
3283 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3284
3285 prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
3286 RNA_def_property_array(prop, 3);
3287 RNA_def_property_ui_text(prop, "Face Normal", "");
3288 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3289
3290 prop = RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
3291 RNA_def_property_array(prop, 3);
3292 RNA_def_property_ui_text(prop, "Vertex Normal", "");
3293 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3294
3295 prop = RNA_def_property(srna, "split_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
3296 RNA_def_property_float_sdna(prop, nullptr, "loop_normal");
3297 RNA_def_property_array(prop, 3);
3298 RNA_def_property_ui_text(prop, "Custom Normal", "");
3299 RNA_def_property_update(prop, 0, "rna_userdef_update");
3300
3301 prop = RNA_def_property(srna, "vertex_unreferenced", PROP_FLOAT, PROP_COLOR_GAMMA);
3302 RNA_def_property_array(prop, 3);
3303 RNA_def_property_ui_text(prop, "Vertex Group Unreferenced", "");
3304 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3305
3306 prop = RNA_def_property(srna, "face_retopology", PROP_FLOAT, PROP_COLOR_GAMMA);
3307 RNA_def_property_array(prop, 4);
3308 RNA_def_property_ui_text(prop, "Face Retopology", "");
3309 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3310
3311 /* Curve Object specific */
3312
3313 prop = RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
3314 RNA_def_property_float_sdna(prop, nullptr, "nurb_uline");
3315 RNA_def_property_array(prop, 3);
3316 RNA_def_property_ui_text(prop, "NURBS U Lines", "");
3317 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3318
3319 prop = RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
3320 RNA_def_property_float_sdna(prop, nullptr, "nurb_vline");
3321 RNA_def_property_array(prop, 3);
3322 RNA_def_property_ui_text(prop, "NURBS V Lines", "");
3323 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3324
3325 prop = RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
3326 RNA_def_property_float_sdna(prop, nullptr, "nurb_sel_uline");
3327 RNA_def_property_array(prop, 3);
3328 RNA_def_property_ui_text(prop, "NURBS Active U Lines", "");
3329 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3330
3331 prop = RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
3332 RNA_def_property_float_sdna(prop, nullptr, "nurb_sel_vline");
3333 RNA_def_property_array(prop, 3);
3334 RNA_def_property_ui_text(prop, "NURBS Active V Lines", "");
3335 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3336
3337 /* Armature Object specific. */
3338
3339 prop = RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
3340 RNA_def_property_array(prop, 3);
3341 RNA_def_property_ui_text(prop, "Bone Pose Selected", "Outline color of selected pose bones");
3342 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3343
3344 prop = RNA_def_property(srna, "bone_pose_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3345 RNA_def_property_array(prop, 3);
3346 RNA_def_property_ui_text(prop, "Bone Pose Active", "Outline color of active pose bones");
3347 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3348
3349 prop = RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
3350 RNA_def_property_array(prop, 3);
3351 RNA_def_property_ui_text(prop, "Bone Solid", "Default color of the solid shapes of bones");
3352 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3353
3354 prop = RNA_def_property(srna, "bone_locked_weight", PROP_FLOAT, PROP_COLOR_GAMMA);
3355 RNA_def_property_array(prop, 4);
3357 prop,
3358 "Bone Locked Weight",
3359 "Shade for bones corresponding to a locked weight group during painting");
3360 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3361
3362 /* Time specific. */
3363 prop = RNA_def_property(srna, "before_current_frame", PROP_FLOAT, PROP_COLOR_GAMMA);
3364 RNA_def_property_array(prop, 3);
3366 prop,
3367 "Before Current Frame",
3368 "The color for things before the current frame (for onion skinning, motion paths, etc.)");
3369 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3370
3371 prop = RNA_def_property(srna, "after_current_frame", PROP_FLOAT, PROP_COLOR_GAMMA);
3372 RNA_def_property_array(prop, 3);
3374 prop,
3375 "After Current Frame",
3376 "The color for things after the current frame (for onion skinning, motion paths, etc.)");
3377 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3378
3379 /* misc */
3380
3381 prop = RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
3382 RNA_def_property_float_sdna(prop, nullptr, "bundle_solid");
3383 RNA_def_property_array(prop, 3);
3384 RNA_def_property_ui_text(prop, "Bundle Solid", "");
3385 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3386
3387 prop = RNA_def_property(srna, "camera_path", PROP_FLOAT, PROP_COLOR_GAMMA);
3388 RNA_def_property_float_sdna(prop, nullptr, "camera_path");
3389 RNA_def_property_array(prop, 3);
3390 RNA_def_property_ui_text(prop, "Camera Path", "");
3391 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3392
3393 prop = RNA_def_property(srna, "camera_passepartout", PROP_FLOAT, PROP_COLOR_GAMMA);
3394 RNA_def_property_array(prop, 3);
3395 RNA_def_property_ui_text(prop, "Camera Passepartout", "");
3396 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3397
3398 prop = RNA_def_property(srna, "skin_root", PROP_FLOAT, PROP_COLOR_GAMMA);
3399 RNA_def_property_array(prop, 3);
3400 RNA_def_property_ui_text(prop, "Skin Root", "");
3401 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3402
3403 prop = RNA_def_property(srna, "view_overlay", PROP_FLOAT, PROP_COLOR_GAMMA);
3404 RNA_def_property_array(prop, 3);
3405 RNA_def_property_ui_text(prop, "View Overlay", "");
3406 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3407
3408 prop = RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
3409 RNA_def_property_array(prop, 3);
3410 RNA_def_property_ui_text(prop, "Transform", "");
3411 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3412
3413 prop = RNA_def_property(srna, "outline_width", PROP_INT, PROP_PIXEL);
3414 RNA_def_property_range(prop, 1, 5);
3415 RNA_def_property_ui_text(prop, "Outline Width", "");
3416 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3417
3418 prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL);
3419 RNA_def_property_int_sdna(prop, nullptr, "obcenter_dia");
3420 RNA_def_property_range(prop, 4, 10);
3422 prop, "Object Origin Size", "Diameter in pixels for object/light origin display");
3423 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3424}
3425
3427{
3428 StructRNA *srna;
3429 PropertyRNA *prop;
3430
3431 /* space_graph */
3432 srna = RNA_def_struct(brna, "ThemeGraphEditor", nullptr);
3433 RNA_def_struct_sdna(srna, "ThemeSpace");
3434 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
3435
3437
3438 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3439 RNA_def_property_array(prop, 3);
3440 RNA_def_property_ui_text(prop, "Grid", "");
3441 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3442
3444}
3445
3447{
3448 StructRNA *srna;
3449 PropertyRNA *prop;
3450
3451 /* space_file */
3452
3453 srna = RNA_def_struct(brna, "ThemeFileBrowser", nullptr);
3454 RNA_def_struct_sdna(srna, "ThemeSpace");
3455 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
3456
3458
3459 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
3460 RNA_def_property_array(prop, 4);
3461 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
3462 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3463}
3464
3466{
3467 StructRNA *srna;
3468 PropertyRNA *prop;
3469
3470 /* space_outliner */
3471
3472 srna = RNA_def_struct(brna, "ThemeOutliner", nullptr);
3473 RNA_def_struct_sdna(srna, "ThemeSpace");
3474 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
3475
3477
3478 prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
3479 RNA_def_property_array(prop, 3);
3480 RNA_def_property_ui_text(prop, "Filter Match", "");
3481 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3482
3483 prop = RNA_def_property(srna, "selected_highlight", PROP_FLOAT, PROP_COLOR_GAMMA);
3484 RNA_def_property_array(prop, 3);
3485 RNA_def_property_ui_text(prop, "Selected Highlight", "");
3486 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3487
3488 prop = RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
3489 RNA_def_property_array(prop, 3);
3490 RNA_def_property_ui_text(prop, "Active Highlight", "");
3491 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3492
3493 prop = RNA_def_property(srna, "selected_object", PROP_FLOAT, PROP_COLOR_GAMMA);
3494 RNA_def_property_array(prop, 3);
3495 RNA_def_property_ui_text(prop, "Selected Objects", "");
3496 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3497
3498 prop = RNA_def_property(srna, "active_object", PROP_FLOAT, PROP_COLOR_GAMMA);
3499 RNA_def_property_array(prop, 3);
3500 RNA_def_property_ui_text(prop, "Active Object", "");
3501 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3502
3503 prop = RNA_def_property(srna, "edited_object", PROP_FLOAT, PROP_COLOR_GAMMA);
3504 RNA_def_property_array(prop, 4);
3505 RNA_def_property_ui_text(prop, "Edited Object", "");
3506 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3507
3508 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
3509 RNA_def_property_array(prop, 4);
3510 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
3511 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3512}
3513
3515{
3516 StructRNA *srna;
3517 PropertyRNA *prop;
3518
3519 /* space_userpref */
3520
3521 srna = RNA_def_struct(brna, "ThemePreferences", nullptr);
3522 RNA_def_struct_sdna(srna, "ThemeSpace");
3523 RNA_def_struct_ui_text(srna, "Theme Preferences", "Theme settings for the Blender Preferences");
3524
3525 prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
3526 RNA_def_property_array(prop, 3);
3527 RNA_def_property_ui_text(prop, "Search Match", "");
3528 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3529
3531}
3532
3534{
3535 StructRNA *srna;
3536 PropertyRNA *prop;
3537
3538 /* space_console */
3539
3540 srna = RNA_def_struct(brna, "ThemeConsole", nullptr);
3541 RNA_def_struct_sdna(srna, "ThemeSpace");
3542 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
3543
3545
3546 prop = RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
3547 RNA_def_property_float_sdna(prop, nullptr, "console_output");
3548 RNA_def_property_array(prop, 3);
3549 RNA_def_property_ui_text(prop, "Line Output", "");
3550 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3551
3552 prop = RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
3553 RNA_def_property_float_sdna(prop, nullptr, "console_input");
3554 RNA_def_property_array(prop, 3);
3555 RNA_def_property_ui_text(prop, "Line Input", "");
3556 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3557
3558 prop = RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
3559 RNA_def_property_float_sdna(prop, nullptr, "console_info");
3560 RNA_def_property_array(prop, 3);
3561 RNA_def_property_ui_text(prop, "Line Info", "");
3562 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3563
3564 prop = RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
3565 RNA_def_property_float_sdna(prop, nullptr, "console_error");
3566 RNA_def_property_array(prop, 3);
3567 RNA_def_property_ui_text(prop, "Line Error", "");
3568 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3569
3570 prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
3571 RNA_def_property_float_sdna(prop, nullptr, "console_cursor");
3572 RNA_def_property_array(prop, 3);
3573 RNA_def_property_ui_text(prop, "Cursor", "");
3574 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3575
3576 prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
3577 RNA_def_property_float_sdna(prop, nullptr, "console_select");
3578 RNA_def_property_array(prop, 4);
3579 RNA_def_property_ui_text(prop, "Selection", "");
3580 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3581}
3582
3584{
3585 StructRNA *srna;
3586 PropertyRNA *prop;
3587
3588 /* space_info */
3589
3590 srna = RNA_def_struct(brna, "ThemeInfo", nullptr);
3591 RNA_def_struct_sdna(srna, "ThemeSpace");
3592 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
3593
3595
3596 prop = RNA_def_property(srna, "info_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3597 RNA_def_property_array(prop, 3);
3598 RNA_def_property_ui_text(prop, "Selected Line Background", "Background color of selected line");
3599 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3600
3601 prop = RNA_def_property(srna, "info_selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3602 RNA_def_property_array(prop, 3);
3603 RNA_def_property_ui_text(prop, "Selected Line Text Color", "Text color of selected line");
3604 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3605
3606 prop = RNA_def_property(srna, "info_error_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3607 RNA_def_property_array(prop, 3);
3608 RNA_def_property_ui_text(prop, "Error Icon Foreground", "Foreground color of Error icon");
3609 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3610
3611 prop = RNA_def_property(srna, "info_warning_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3612 RNA_def_property_array(prop, 3);
3613 RNA_def_property_ui_text(prop, "Warning Icon Foreground", "Foreground color of Warning icon");
3614 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3615
3616 prop = RNA_def_property(srna, "info_info_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3617 RNA_def_property_array(prop, 3);
3618 RNA_def_property_ui_text(prop, "Info Icon Foreground", "Foreground color of Info icon");
3619 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3620
3621 prop = RNA_def_property(srna, "info_debug", PROP_FLOAT, PROP_COLOR_GAMMA);
3622 RNA_def_property_array(prop, 4);
3623 RNA_def_property_ui_text(prop, "Debug Icon Background", "Background color of Debug icon");
3624 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3625
3626 prop = RNA_def_property(srna, "info_debug_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3627 RNA_def_property_array(prop, 3);
3628 RNA_def_property_ui_text(prop, "Debug Icon Foreground", "Foreground color of Debug icon");
3629 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3630
3631 prop = RNA_def_property(srna, "info_property", PROP_FLOAT, PROP_COLOR_GAMMA);
3632 RNA_def_property_array(prop, 4);
3633 RNA_def_property_ui_text(prop, "Property Icon Background", "Background color of Property icon");
3634 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3635
3636 prop = RNA_def_property(srna, "info_property_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3637 RNA_def_property_array(prop, 3);
3638 RNA_def_property_ui_text(prop, "Property Icon Foreground", "Foreground color of Property icon");
3639 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3640
3641 prop = RNA_def_property(srna, "info_operator", PROP_FLOAT, PROP_COLOR_GAMMA);
3642 RNA_def_property_array(prop, 4);
3643 RNA_def_property_ui_text(prop, "Operator Icon Background", "Background color of Operator icon");
3644 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3645
3646 prop = RNA_def_property(srna, "info_operator_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3647 RNA_def_property_array(prop, 3);
3648 RNA_def_property_ui_text(prop, "Operator Icon Foreground", "Foreground color of Operator icon");
3649 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3650}
3651
3653{
3654 StructRNA *srna;
3655 PropertyRNA *prop;
3656
3657 /* space_text */
3658
3659 srna = RNA_def_struct(brna, "ThemeTextEditor", nullptr);
3660 RNA_def_struct_sdna(srna, "ThemeSpace");
3661 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
3662
3664
3665 prop = RNA_def_property(srna, "line_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
3666 RNA_def_property_float_sdna(prop, nullptr, "line_numbers");
3667 RNA_def_property_array(prop, 3);
3668 RNA_def_property_ui_text(prop, "Line Numbers", "");
3669 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3670
3671 prop = RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
3672 RNA_def_property_float_sdna(prop, nullptr, "grid");
3673 RNA_def_property_array(prop, 3);
3674 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
3675 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3676
3677 /* no longer used */
3678# if 0
3679 prop = RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
3680 RNA_def_property_float_sdna(prop, nullptr, "shade1");
3681 RNA_def_property_array(prop, 3);
3682 RNA_def_property_ui_text(prop, "Scroll Bar", "");
3683 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3684# endif
3685
3686 prop = RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3687 RNA_def_property_float_sdna(prop, nullptr, "shade2");
3688 RNA_def_property_array(prop, 3);
3689 RNA_def_property_ui_text(prop, "Selected Text", "");
3690 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3691
3692 prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
3693 RNA_def_property_float_sdna(prop, nullptr, "hilite");
3694 RNA_def_property_array(prop, 3);
3695 RNA_def_property_ui_text(prop, "Cursor", "");
3696 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3697
3698 prop = RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
3699 RNA_def_property_float_sdna(prop, nullptr, "syntaxb");
3700 RNA_def_property_array(prop, 3);
3701 RNA_def_property_ui_text(prop, "Syntax Built-In", "");
3702 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3703
3704 prop = RNA_def_property(srna, "syntax_symbols", PROP_FLOAT, PROP_COLOR_GAMMA);
3705 RNA_def_property_float_sdna(prop, nullptr, "syntaxs");
3706 RNA_def_property_array(prop, 3);
3707 RNA_def_property_ui_text(prop, "Syntax Symbols", "");
3708 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3709
3710 prop = RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
3711 RNA_def_property_float_sdna(prop, nullptr, "syntaxv");
3712 RNA_def_property_array(prop, 3);
3713 RNA_def_property_ui_text(prop, "Syntax Special", "");
3714 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3715
3716 prop = RNA_def_property(srna, "syntax_preprocessor", PROP_FLOAT, PROP_COLOR_GAMMA);
3717 RNA_def_property_float_sdna(prop, nullptr, "syntaxd");
3718 RNA_def_property_array(prop, 3);
3719 RNA_def_property_ui_text(prop, "Syntax Preprocessor", "");
3720 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3721
3722 prop = RNA_def_property(srna, "syntax_reserved", PROP_FLOAT, PROP_COLOR_GAMMA);
3723 RNA_def_property_float_sdna(prop, nullptr, "syntaxr");
3724 RNA_def_property_array(prop, 3);
3725 RNA_def_property_ui_text(prop, "Syntax Reserved", "");
3726 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3727
3728 prop = RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
3729 RNA_def_property_float_sdna(prop, nullptr, "syntaxc");
3730 RNA_def_property_array(prop, 3);
3731 RNA_def_property_ui_text(prop, "Syntax Comment", "");
3732 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3733
3734 prop = RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
3735 RNA_def_property_float_sdna(prop, nullptr, "syntaxl");
3736 RNA_def_property_array(prop, 3);
3737 RNA_def_property_ui_text(prop, "Syntax String", "");
3738 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3739
3740 prop = RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
3741 RNA_def_property_float_sdna(prop, nullptr, "syntaxn");
3742 RNA_def_property_array(prop, 3);
3743 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
3744 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3745}
3746
3748{
3749 StructRNA *srna;
3750 PropertyRNA *prop;
3751
3752 /* space_node */
3753
3754 srna = RNA_def_struct(brna, "ThemeNodeEditor", nullptr);
3755 RNA_def_struct_sdna(srna, "ThemeSpace");
3756 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
3757
3759
3760 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3761 RNA_def_property_array(prop, 3);
3762 RNA_def_property_ui_text(prop, "Grid", "");
3763 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3764
3765 prop = RNA_def_property(srna, "node_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
3766 RNA_def_property_float_sdna(prop, nullptr, "node_outline");
3767 RNA_def_property_array(prop, 4);
3768 RNA_def_property_ui_text(prop, "Node Outline", "");
3769 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3770
3771 prop = RNA_def_property(srna, "node_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3772 RNA_def_property_float_sdna(prop, nullptr, "select");
3773 RNA_def_property_array(prop, 3);
3774 RNA_def_property_ui_text(prop, "Node Selected", "");
3775 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3776
3777 prop = RNA_def_property(srna, "node_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3778 RNA_def_property_float_sdna(prop, nullptr, "active");
3779 RNA_def_property_array(prop, 3);
3780 RNA_def_property_ui_text(prop, "Active Node", "");
3781 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3782
3783 prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
3784 RNA_def_property_float_sdna(prop, nullptr, "wire");
3785 RNA_def_property_array(prop, 4);
3786 RNA_def_property_ui_text(prop, "Wires", "");
3787 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3788
3789 prop = RNA_def_property(srna, "wire_inner", PROP_FLOAT, PROP_COLOR_GAMMA);
3790 RNA_def_property_float_sdna(prop, nullptr, "syntaxr");
3791 RNA_def_property_array(prop, 3);
3792 RNA_def_property_ui_text(prop, "Wire Color", "");
3793 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3794
3795 prop = RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3796 RNA_def_property_float_sdna(prop, nullptr, "edge_select");
3797 RNA_def_property_array(prop, 4);
3798 RNA_def_property_ui_text(prop, "Wire Select", "");
3799 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3800
3801 prop = RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
3802 RNA_def_property_float_sdna(prop, nullptr, "syntaxl");
3803 RNA_def_property_array(prop, 4);
3804 RNA_def_property_ui_text(prop, "Node Backdrop", "");
3805 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3806
3807 prop = RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3808 RNA_def_property_float_sdna(prop, nullptr, "syntaxv");
3809 RNA_def_property_array(prop, 3);
3810 RNA_def_property_ui_text(prop, "Converter Node", "");
3811 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3812
3813 prop = RNA_def_property(srna, "color_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3814 RNA_def_property_float_sdna(prop, nullptr, "syntaxb");
3815 RNA_def_property_array(prop, 3);
3816 RNA_def_property_ui_text(prop, "Color Node", "");
3817 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3818
3819 prop = RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3820 RNA_def_property_float_sdna(prop, nullptr, "syntaxc");
3821 RNA_def_property_array(prop, 3);
3822 RNA_def_property_ui_text(prop, "Group Node", "");
3823 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3824
3825 prop = RNA_def_property(srna, "group_socket_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3826 RNA_def_property_float_sdna(prop, nullptr, "console_output");
3827 RNA_def_property_array(prop, 3);
3828 RNA_def_property_ui_text(prop, "Group Socket Node", "");
3829 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3830
3831 prop = RNA_def_property(srna, "frame_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3832 RNA_def_property_float_sdna(prop, nullptr, "movie");
3833 RNA_def_property_array(prop, 4);
3834 RNA_def_property_ui_text(prop, "Frame Node", "");
3835 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3836
3837 prop = RNA_def_property(srna, "matte_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3838 RNA_def_property_float_sdna(prop, nullptr, "syntaxs");
3839 RNA_def_property_array(prop, 3);
3840 RNA_def_property_ui_text(prop, "Matte Node", "");
3841 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3842
3843 prop = RNA_def_property(srna, "distor_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3844 RNA_def_property_float_sdna(prop, nullptr, "syntaxd");
3845 RNA_def_property_array(prop, 3);
3846 RNA_def_property_ui_text(prop, "Distort Node", "");
3847 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3848
3849 prop = RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
3850 RNA_def_property_int_sdna(prop, nullptr, "noodle_curving");
3852 RNA_def_property_range(prop, 0, 10);
3853 RNA_def_property_ui_text(prop, "Noodle Curving", "Curving of the noodle");
3854 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3855
3856 prop = RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
3857 RNA_def_property_int_sdna(prop, nullptr, "grid_levels");
3859 RNA_def_property_range(prop, 0, 3);
3861 prop, "Grid Levels", "Number of subdivisions for the dot grid displayed in the background");
3862 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3863
3864 prop = RNA_def_property(srna, "dash_alpha", PROP_FLOAT, PROP_FACTOR);
3865 RNA_def_property_range(prop, 0.0f, 1.0f);
3867 RNA_def_property_ui_text(prop, "Dashed Lines Opacity", "Opacity for the dashed lines in wires");
3868 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3869
3870 prop = RNA_def_property(srna, "input_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3871 RNA_def_property_float_sdna(prop, nullptr, "syntaxn");
3872 RNA_def_property_array(prop, 3);
3873 RNA_def_property_ui_text(prop, "Input Node", "");
3874 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3875
3876 prop = RNA_def_property(srna, "output_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3877 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_output");
3878 RNA_def_property_array(prop, 3);
3879 RNA_def_property_ui_text(prop, "Output Node", "");
3880 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3881
3882 prop = RNA_def_property(srna, "filter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3883 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_filter");
3884 RNA_def_property_array(prop, 3);
3885 RNA_def_property_ui_text(prop, "Filter Node", "");
3886 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3887
3888 prop = RNA_def_property(srna, "vector_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3889 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_vector");
3890 RNA_def_property_array(prop, 3);
3891 RNA_def_property_ui_text(prop, "Vector Node", "");
3892 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3893
3894 prop = RNA_def_property(srna, "texture_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3895 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_texture");
3896 RNA_def_property_array(prop, 3);
3897 RNA_def_property_ui_text(prop, "Texture Node", "");
3898 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3899
3900 prop = RNA_def_property(srna, "shader_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3901 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_shader");
3902 RNA_def_property_array(prop, 3);
3903 RNA_def_property_ui_text(prop, "Shader Node", "");
3904 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3905
3906 prop = RNA_def_property(srna, "script_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3907 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_script");
3908 RNA_def_property_array(prop, 3);
3909 RNA_def_property_ui_text(prop, "Script Node", "");
3910 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3911
3912 prop = RNA_def_property(srna, "geometry_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3913 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_geometry");
3914 RNA_def_property_array(prop, 3);
3915 RNA_def_property_ui_text(prop, "Geometry Node", "");
3916 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3917
3918 prop = RNA_def_property(srna, "attribute_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3919 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_attribute");
3920 RNA_def_property_array(prop, 3);
3921 RNA_def_property_ui_text(prop, "Attribute Node", "");
3922 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3923
3924 prop = RNA_def_property(srna, "simulation_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3925 RNA_def_property_float_sdna(prop, nullptr, "node_zone_simulation");
3926 RNA_def_property_array(prop, 4);
3927 RNA_def_property_ui_text(prop, "Simulation Zone", "");
3928 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3929
3930 prop = RNA_def_property(srna, "repeat_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3931 RNA_def_property_float_sdna(prop, nullptr, "node_zone_repeat");
3932 RNA_def_property_array(prop, 4);
3933 RNA_def_property_ui_text(prop, "Repeat Zone", "");
3934 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3935
3936 prop = RNA_def_property(srna, "foreach_geometry_element_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3937 RNA_def_property_float_sdna(prop, nullptr, "node_zone_foreach_geometry_element");
3938 RNA_def_property_array(prop, 4);
3939 RNA_def_property_ui_text(prop, "For Each Geometry Element Zone", "");
3940 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3941
3942 prop = RNA_def_property(srna, "closure_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3943 RNA_def_property_float_sdna(prop, nullptr, "node_zone_closure");
3944 RNA_def_property_array(prop, 4);
3945 RNA_def_property_ui_text(prop, "Closure Zone", "");
3946 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3947}
3948
3950{
3951 StructRNA *srna;
3952 PropertyRNA *prop;
3953
3954 /* space_buts */
3955
3956 srna = RNA_def_struct(brna, "ThemeProperties", nullptr);
3957 RNA_def_struct_sdna(srna, "ThemeSpace");
3958 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
3959
3960 prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
3961 RNA_def_property_array(prop, 3);
3962 RNA_def_property_ui_text(prop, "Search Match", "");
3963 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3964
3966}
3967
3969{
3970 StructRNA *srna;
3971 PropertyRNA *prop;
3972
3973 /* space_image */
3974
3975 srna = RNA_def_struct(brna, "ThemeImageEditor", nullptr);
3976 RNA_def_struct_sdna(srna, "ThemeSpace");
3977 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
3978
3980
3981 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3982 RNA_def_property_array(prop, 4);
3983 RNA_def_property_ui_text(prop, "Grid", "");
3984 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3985
3988
3989 prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3990 RNA_def_property_array(prop, 4);
3991 RNA_def_property_ui_text(prop, "Active Vertex/Edge/Face", "");
3992 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3993
3994 prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA);
3995 RNA_def_property_array(prop, 3);
3996 RNA_def_property_ui_text(prop, "Wire Edit", "");
3997 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3998
3999 prop = RNA_def_property(srna, "edge_width", PROP_INT, PROP_PIXEL);
4000 RNA_def_property_range(prop, 1, 32);
4001 RNA_def_property_ui_text(prop, "Edge Width", "");
4002 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4003
4004 prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
4005 RNA_def_property_array(prop, 3);
4006 RNA_def_property_ui_text(prop, "Edge Select", "");
4007 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4008
4009 prop = RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
4010 RNA_def_property_float_sdna(prop, nullptr, "preview_back");
4011 RNA_def_property_array(prop, 4);
4012 RNA_def_property_ui_text(prop, "Scope Region Background", "");
4013 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4014
4015 prop = RNA_def_property(srna, "preview_stitch_face", PROP_FLOAT, PROP_COLOR_GAMMA);
4016 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_face");
4017 RNA_def_property_array(prop, 4);
4018 RNA_def_property_ui_text(prop, "Stitch Preview Face", "");
4019 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4020
4021 prop = RNA_def_property(srna, "preview_stitch_edge", PROP_FLOAT, PROP_COLOR_GAMMA);
4022 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_edge");
4023 RNA_def_property_array(prop, 4);
4024 RNA_def_property_ui_text(prop, "Stitch Preview Edge", "");
4025 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4026
4027 prop = RNA_def_property(srna, "preview_stitch_vert", PROP_FLOAT, PROP_COLOR_GAMMA);
4028 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_vert");
4029 RNA_def_property_array(prop, 4);
4030 RNA_def_property_ui_text(prop, "Stitch Preview Vertex", "");
4031 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4032
4033 prop = RNA_def_property(srna, "preview_stitch_stitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
4034 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_stitchable");
4035 RNA_def_property_array(prop, 4);
4036 RNA_def_property_ui_text(prop, "Stitch Preview Stitchable", "");
4037 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4038
4039 prop = RNA_def_property(srna, "preview_stitch_unstitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
4040 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_unstitchable");
4041 RNA_def_property_array(prop, 4);
4042 RNA_def_property_ui_text(prop, "Stitch Preview Unstitchable", "");
4043 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4044
4045 prop = RNA_def_property(srna, "preview_stitch_active", PROP_FLOAT, PROP_COLOR_GAMMA);
4046 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_active");
4047 RNA_def_property_array(prop, 4);
4048 RNA_def_property_ui_text(prop, "Stitch Preview Active Island", "");
4049 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4050
4051 prop = RNA_def_property(srna, "uv_shadow", PROP_FLOAT, PROP_COLOR_GAMMA);
4052 RNA_def_property_float_sdna(prop, nullptr, "uv_shadow");
4053 RNA_def_property_array(prop, 4);
4054 RNA_def_property_ui_text(prop, "Texture Paint/Modifier UVs", "");
4055 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4056
4057 prop = RNA_def_property(srna, "metadatabg", PROP_FLOAT, PROP_COLOR_GAMMA);
4058 RNA_def_property_float_sdna(prop, nullptr, "metadatabg");
4059 RNA_def_property_array(prop, 3);
4060 RNA_def_property_ui_text(prop, "Metadata Background", "");
4061 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4062
4063 prop = RNA_def_property(srna, "metadatatext", PROP_FLOAT, PROP_COLOR_GAMMA);
4064 RNA_def_property_float_sdna(prop, nullptr, "metadatatext");
4065 RNA_def_property_array(prop, 3);
4066 RNA_def_property_ui_text(prop, "Metadata Text", "");
4067 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4068}
4069
4071{
4072 StructRNA *srna;
4073 PropertyRNA *prop;
4074
4075 /* space_seq */
4076
4077 srna = RNA_def_struct(brna, "ThemeSequenceEditor", nullptr);
4078 RNA_def_struct_sdna(srna, "ThemeSpace");
4079 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
4080
4082
4083 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
4084 RNA_def_property_array(prop, 3);
4085 RNA_def_property_ui_text(prop, "Grid", "");
4086 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4087
4088 prop = RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4089 RNA_def_property_float_sdna(prop, nullptr, "movie");
4090 RNA_def_property_array(prop, 3);
4091 RNA_def_property_ui_text(prop, "Movie Strip", "");
4092 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4093
4094 prop = RNA_def_property(srna, "movieclip_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4095 RNA_def_property_float_sdna(prop, nullptr, "movieclip");
4096 RNA_def_property_array(prop, 3);
4097 RNA_def_property_ui_text(prop, "Clip Strip", "");
4098 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4099
4100 prop = RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4101 RNA_def_property_float_sdna(prop, nullptr, "image");
4102 RNA_def_property_array(prop, 3);
4103 RNA_def_property_ui_text(prop, "Image Strip", "");
4104 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4105
4106 prop = RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4107 RNA_def_property_float_sdna(prop, nullptr, "scene");
4108 RNA_def_property_array(prop, 3);
4109 RNA_def_property_ui_text(prop, "Scene Strip", "");
4110 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4111
4112 prop = RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4113 RNA_def_property_float_sdna(prop, nullptr, "audio");
4114 RNA_def_property_array(prop, 3);
4115 RNA_def_property_ui_text(prop, "Audio Strip", "");
4116 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4117
4118 prop = RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4119 RNA_def_property_float_sdna(prop, nullptr, "effect");
4120 RNA_def_property_array(prop, 3);
4121 RNA_def_property_ui_text(prop, "Effect Strip", "");
4122 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4123
4124 prop = RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4125 RNA_def_property_float_sdna(prop, nullptr, "transition");
4126 RNA_def_property_array(prop, 3);
4127 RNA_def_property_ui_text(prop, "Transition Strip", "");
4128 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4129
4130 prop = RNA_def_property(srna, "color_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4131 RNA_def_property_array(prop, 3);
4132 RNA_def_property_ui_text(prop, "Color Strip", "");
4133 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4134
4135 prop = RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4136 RNA_def_property_float_sdna(prop, nullptr, "meta");
4137 RNA_def_property_array(prop, 3);
4138 RNA_def_property_ui_text(prop, "Meta Strip", "");
4139 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4140
4141 prop = RNA_def_property(srna, "mask_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4142 RNA_def_property_float_sdna(prop, nullptr, "mask");
4143 RNA_def_property_array(prop, 3);
4144 RNA_def_property_ui_text(prop, "Mask Strip", "");
4145 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4146
4147 prop = RNA_def_property(srna, "text_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4148 RNA_def_property_array(prop, 3);
4149 RNA_def_property_ui_text(prop, "Text Strip", "");
4150 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4151
4152 prop = RNA_def_property(srna, "active_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4153 RNA_def_property_array(prop, 3);
4154 RNA_def_property_ui_text(prop, "Active Strip", "");
4155 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4156
4157 prop = RNA_def_property(srna, "selected_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
4158 RNA_def_property_array(prop, 3);
4159 RNA_def_property_ui_text(prop, "Selected Strips", "");
4160 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4161
4162 prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA);
4163 RNA_def_property_float_sdna(prop, nullptr, "keyborder");
4164 RNA_def_property_array(prop, 4);
4165 RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border");
4166 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4167
4168 prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4169 RNA_def_property_float_sdna(prop, nullptr, "keyborder_select");
4170 RNA_def_property_array(prop, 4);
4171 RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border");
4172 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4173
4174 prop = RNA_def_property(srna, "preview_back", PROP_FLOAT, PROP_COLOR_GAMMA);
4175 RNA_def_property_float_sdna(prop, nullptr, "preview_back");
4176 RNA_def_property_array(prop, 3);
4177 RNA_def_property_ui_text(prop, "Preview Background", "");
4178 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4179
4180 prop = RNA_def_property(srna, "metadatabg", PROP_FLOAT, PROP_COLOR_GAMMA);
4181 RNA_def_property_float_sdna(prop, nullptr, "metadatabg");
4182 RNA_def_property_array(prop, 3);
4183 RNA_def_property_ui_text(prop, "Metadata Background", "");
4184 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4185
4186 prop = RNA_def_property(srna, "metadatatext", PROP_FLOAT, PROP_COLOR_GAMMA);
4187 RNA_def_property_float_sdna(prop, nullptr, "metadatatext");
4188 RNA_def_property_array(prop, 3);
4189 RNA_def_property_ui_text(prop, "Metadata Text", "");
4190 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4191
4192 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
4193 RNA_def_property_array(prop, 4);
4194 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
4195 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4196
4197 prop = RNA_def_property(srna, "text_strip_cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
4198 RNA_def_property_float_sdna(prop, nullptr, "text_strip_cursor");
4199 RNA_def_property_array(prop, 4);
4200 RNA_def_property_ui_text(prop, "Text Strip Cursor", "Text strip editing cursor");
4201 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4202
4203 prop = RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
4204 RNA_def_property_float_sdna(prop, nullptr, "selected_text");
4205 RNA_def_property_array(prop, 4);
4206 RNA_def_property_ui_text(prop, "Selected Text", "Text strip editing selection");
4207 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4208}
4209
4211{
4212 StructRNA *srna;
4213 PropertyRNA *prop;
4214
4215 /* space_action */
4216
4217 srna = RNA_def_struct(brna, "ThemeDopeSheet", nullptr);
4218 RNA_def_struct_sdna(srna, "ThemeSpace");
4219 RNA_def_struct_ui_text(srna, "Theme Dope Sheet", "Theme settings for the Dope Sheet");
4220
4222
4223 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
4224 RNA_def_property_array(prop, 3);
4225 RNA_def_property_ui_text(prop, "Grid", "");
4226 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4227
4228 prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA);
4229 RNA_def_property_float_sdna(prop, nullptr, "keyborder");
4230 RNA_def_property_array(prop, 4);
4231 RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border");
4232 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4233
4234 prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4235 RNA_def_property_float_sdna(prop, nullptr, "keyborder_select");
4236 RNA_def_property_array(prop, 4);
4237 RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border");
4238 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4239
4240 prop = RNA_def_property(srna, "keyframe_scale_factor", PROP_FLOAT, PROP_NONE);
4241 RNA_def_property_float_sdna(prop, nullptr, "keyframe_scale_fac");
4244 prop, "Keyframe Scale Factor", "Scale factor for adjusting the height of keyframes");
4245 /* NOTE: These limits prevent buttons overlapping (min), and excessive size... (max). */
4246 RNA_def_property_range(prop, 0.8f, 5.0f);
4247 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_userdef_theme_update");
4248
4249 prop = RNA_def_property(srna, "summary", PROP_FLOAT, PROP_COLOR_GAMMA);
4250 RNA_def_property_float_sdna(prop, nullptr, "anim_active");
4251 RNA_def_property_array(prop, 4);
4252 RNA_def_property_ui_text(prop, "Summary", "Color of summary channel");
4253 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4254
4255 prop = RNA_def_property(srna, "anim_interpolation_linear", PROP_FLOAT, PROP_COLOR_GAMMA);
4256 RNA_def_property_array(prop, 4);
4258 prop, "Linear Interpolation", "Color of lines showing linear interpolation mode");
4259 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4260
4261 prop = RNA_def_property(srna, "anim_interpolation_constant", PROP_FLOAT, PROP_COLOR_GAMMA);
4262 RNA_def_property_array(prop, 4);
4264 prop, "Constant Interpolation", "Color of lines showing constant interpolation mode");
4265 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4266
4267 prop = RNA_def_property(srna, "anim_interpolation_other", PROP_FLOAT, PROP_COLOR_GAMMA);
4268 RNA_def_property_array(prop, 4);
4270 prop, "Other Interpolation", "Color of lines showing easings & dynamic interpolation mode");
4271 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4272
4273 prop = RNA_def_property(srna, "simulated_frames", PROP_FLOAT, PROP_COLOR_GAMMA);
4274 RNA_def_property_float_sdna(prop, nullptr, "simulated_frames");
4275 RNA_def_property_array(prop, 4);
4276 RNA_def_property_ui_text(prop, "Simulated Frames", "");
4277 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4278}
4279
4281{
4282 StructRNA *srna;
4283 PropertyRNA *prop;
4284
4285 /* space_nla */
4286 srna = RNA_def_struct(brna, "ThemeNLAEditor", nullptr);
4287 RNA_def_struct_sdna(srna, "ThemeSpace");
4288 RNA_def_struct_ui_text(srna, "Theme Nonlinear Animation", "Theme settings for the NLA Editor");
4289
4291
4292 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
4293 RNA_def_property_array(prop, 3);
4294 RNA_def_property_ui_text(prop, "Grid", "");
4295 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4296
4297 prop = RNA_def_property(srna, "active_action", PROP_FLOAT, PROP_COLOR_GAMMA);
4298 RNA_def_property_float_sdna(prop, nullptr, "anim_active");
4299 RNA_def_property_array(prop, 4);
4300 RNA_def_property_ui_text(prop, "Active Action", "Animation data-block has active action");
4301 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4302
4303 prop = RNA_def_property(srna, "active_action_unset", PROP_FLOAT, PROP_COLOR_GAMMA);
4304 RNA_def_property_float_sdna(prop, nullptr, "anim_non_active");
4305 RNA_def_property_array(prop, 4);
4307 prop, "No Active Action", "Animation data-block does not have active action");
4308 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4309
4310 prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
4311 RNA_def_property_float_sdna(prop, nullptr, "strip");
4312 RNA_def_property_array(prop, 3);
4313 RNA_def_property_ui_text(prop, "Strips", "Unselected Action-Clip Strip");
4314 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4315
4316 prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4317 RNA_def_property_float_sdna(prop, nullptr, "strip_select");
4318 RNA_def_property_array(prop, 3);
4319 RNA_def_property_ui_text(prop, "Strips Selected", "Selected Action-Clip Strip");
4320 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4321
4322 prop = RNA_def_property(srna, "transition_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
4323 RNA_def_property_float_sdna(prop, nullptr, "nla_transition");
4324 RNA_def_property_array(prop, 3);
4325 RNA_def_property_ui_text(prop, "Transitions", "Unselected Transition Strip");
4326 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4327
4328 prop = RNA_def_property(srna, "transition_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4329 RNA_def_property_float_sdna(prop, nullptr, "nla_transition_sel");
4330 RNA_def_property_array(prop, 3);
4331 RNA_def_property_ui_text(prop, "Transitions Selected", "Selected Transition Strip");
4332 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4333
4334 prop = RNA_def_property(srna, "meta_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
4335 RNA_def_property_float_sdna(prop, nullptr, "nla_meta");
4336 RNA_def_property_array(prop, 3);
4338 prop, "Meta Strips", "Unselected Meta Strip (for grouping related strips)");
4339 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4340
4341 prop = RNA_def_property(srna, "meta_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4342 RNA_def_property_float_sdna(prop, nullptr, "nla_meta_sel");
4343 RNA_def_property_array(prop, 3);
4345 prop, "Meta Strips Selected", "Selected Meta Strip (for grouping related strips)");
4346 RNA_def_property_update(prop, 0, "rna_userdef_update");
4347
4348 prop = RNA_def_property(srna, "sound_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
4349 RNA_def_property_float_sdna(prop, nullptr, "nla_sound");
4350 RNA_def_property_array(prop, 3);
4352 prop, "Sound Strips", "Unselected Sound Strip (for timing speaker sounds)");
4353 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4354
4355 prop = RNA_def_property(srna, "sound_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4356 RNA_def_property_float_sdna(prop, nullptr, "nla_sound_sel");
4357 RNA_def_property_array(prop, 3);
4359 prop, "Sound Strips Selected", "Selected Sound Strip (for timing speaker sounds)");
4360 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4361
4362 prop = RNA_def_property(srna, "tweak", PROP_FLOAT, PROP_COLOR_GAMMA);
4363 RNA_def_property_float_sdna(prop, nullptr, "nla_tweaking");
4364 RNA_def_property_array(prop, 3);
4365 RNA_def_property_ui_text(prop, "Tweak", "Color for strip/action being \"tweaked\" or edited");
4366 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4367
4368 prop = RNA_def_property(srna, "tweak_duplicate", PROP_FLOAT, PROP_COLOR_GAMMA);
4369 RNA_def_property_float_sdna(prop, nullptr, "nla_tweakdupli");
4370 RNA_def_property_array(prop, 3);
4372 prop,
4373 "Tweak Duplicate Flag",
4374 "Warning/error indicator color for strips referencing the strip being tweaked");
4375 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4376
4377 prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA);
4378 RNA_def_property_float_sdna(prop, nullptr, "keyborder");
4379 RNA_def_property_array(prop, 4);
4380 RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border");
4381 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4382
4383 prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4384 RNA_def_property_float_sdna(prop, nullptr, "keyborder_select");
4385 RNA_def_property_array(prop, 4);
4386 RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border");
4387 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4388}
4389
4391{
4392 StructRNA *srna;
4393 PropertyRNA *prop;
4394
4395 srna = RNA_def_struct(brna, "ThemeBoneColorSet", nullptr);
4396 RNA_def_struct_sdna(srna, "ThemeWireColor");
4397 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
4398
4399 prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
4400 RNA_def_property_float_sdna(prop, nullptr, "solid");
4401 RNA_def_property_array(prop, 3);
4402 RNA_def_property_ui_text(prop, "Regular", "Color used for the surface of bones");
4403 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4405
4406 prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
4407 RNA_def_property_float_sdna(prop, nullptr, "select");
4408 RNA_def_property_array(prop, 3);
4409 RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
4410 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4412
4413 prop = RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
4414 RNA_def_property_array(prop, 3);
4415 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
4416 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4418
4419 prop = RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
4422 prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
4423 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4424}
4425
4427{
4428 StructRNA *srna;
4429 PropertyRNA *prop;
4430
4431 srna = RNA_def_struct(brna, "ThemeCollectionColor", nullptr);
4432 RNA_def_struct_sdna(srna, "ThemeCollectionColor");
4433 RNA_def_struct_ui_text(srna, "Theme Collection Color", "Theme settings for collection colors");
4434
4435 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
4436 RNA_def_property_float_sdna(prop, nullptr, "color");
4437 RNA_def_property_array(prop, 3);
4438 RNA_def_property_ui_text(prop, "Color", "Collection Color Tag");
4439 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4440}
4441
4443{
4444 StructRNA *srna;
4445 PropertyRNA *prop;
4446
4447 srna = RNA_def_struct(brna, "ThemeStripColor", nullptr);
4448 RNA_def_struct_sdna(srna, "ThemeStripColor");
4449 RNA_def_struct_ui_text(srna, "Theme Strip Color", "Theme settings for strip colors");
4450
4451 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
4452 RNA_def_property_float_sdna(prop, nullptr, "color");
4453 RNA_def_property_array(prop, 3);
4454 RNA_def_property_ui_text(prop, "Color", "Strip Color");
4455 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4456}
4457
4459{
4460 StructRNA *srna;
4461 PropertyRNA *prop;
4462
4463 /* space_clip */
4464
4465 srna = RNA_def_struct(brna, "ThemeClipEditor", nullptr);
4466 RNA_def_struct_sdna(srna, "ThemeSpace");
4467 RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
4468
4470
4471 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
4472 RNA_def_property_array(prop, 4);
4473 RNA_def_property_ui_text(prop, "Grid", "");
4474 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4475
4476 prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
4477 RNA_def_property_float_sdna(prop, nullptr, "marker_outline");
4478 RNA_def_property_array(prop, 3);
4479 RNA_def_property_ui_text(prop, "Marker Outline", "Color of marker's outline");
4480 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4481
4482 prop = RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4483 RNA_def_property_float_sdna(prop, nullptr, "marker");
4484 RNA_def_property_array(prop, 3);
4485 RNA_def_property_ui_text(prop, "Marker", "Color of marker");
4487 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4488
4489 prop = RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4490 RNA_def_property_float_sdna(prop, nullptr, "act_marker");
4491 RNA_def_property_array(prop, 3);
4492 RNA_def_property_ui_text(prop, "Active Marker", "Color of active marker");
4493 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4494
4495 prop = RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4496 RNA_def_property_float_sdna(prop, nullptr, "sel_marker");
4497 RNA_def_property_array(prop, 3);
4498 RNA_def_property_ui_text(prop, "Selected Marker", "Color of selected marker");
4499 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4500
4501 prop = RNA_def_property(srna, "disabled_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4502 RNA_def_property_float_sdna(prop, nullptr, "dis_marker");
4503 RNA_def_property_array(prop, 3);
4504 RNA_def_property_ui_text(prop, "Disabled Marker", "Color of disabled marker");
4505 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4506
4507 prop = RNA_def_property(srna, "locked_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4508 RNA_def_property_float_sdna(prop, nullptr, "lock_marker");
4509 RNA_def_property_array(prop, 3);
4510 RNA_def_property_ui_text(prop, "Locked Marker", "Color of locked marker");
4511 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4512
4513 prop = RNA_def_property(srna, "path_before", PROP_FLOAT, PROP_COLOR_GAMMA);
4514 RNA_def_property_float_sdna(prop, nullptr, "path_before");
4515 RNA_def_property_array(prop, 3);
4516 RNA_def_property_ui_text(prop, "Path Before", "Color of path before current frame");
4517 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4518
4519 prop = RNA_def_property(srna, "path_after", PROP_FLOAT, PROP_COLOR_GAMMA);
4520 RNA_def_property_float_sdna(prop, nullptr, "path_after");
4521 RNA_def_property_array(prop, 3);
4522 RNA_def_property_ui_text(prop, "Path After", "Color of path after current frame");
4523 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4524
4525 prop = RNA_def_property(srna, "path_keyframe_before", PROP_FLOAT, PROP_COLOR_GAMMA);
4526 RNA_def_property_array(prop, 3);
4528 prop, "Path Keyframe Before", "Color of keyframes on a path before current frame");
4529 RNA_def_property_update(prop, 0, "rna_userdef_update");
4530
4531 prop = RNA_def_property(srna, "path_keyframe_after", PROP_FLOAT, PROP_COLOR_GAMMA);
4532 RNA_def_property_array(prop, 3);
4534 prop, "Path Keyframe After", "Color of keyframes on a path after current frame");
4535 RNA_def_property_update(prop, 0, "rna_userdef_update");
4536
4537 prop = RNA_def_property(srna, "metadatabg", PROP_FLOAT, PROP_COLOR_GAMMA);
4538 RNA_def_property_float_sdna(prop, nullptr, "metadatabg");
4539 RNA_def_property_array(prop, 3);
4540 RNA_def_property_ui_text(prop, "Metadata Background", "");
4541 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4542
4543 prop = RNA_def_property(srna, "metadatatext", PROP_FLOAT, PROP_COLOR_GAMMA);
4544 RNA_def_property_float_sdna(prop, nullptr, "metadatatext");
4545 RNA_def_property_array(prop, 3);
4546 RNA_def_property_ui_text(prop, "Metadata Text", "");
4547 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4548}
4549
4551{
4552 StructRNA *srna;
4553
4554 /* space_topbar */
4555
4556 srna = RNA_def_struct(brna, "ThemeTopBar", nullptr);
4557 RNA_def_struct_sdna(srna, "ThemeSpace");
4558 RNA_def_struct_ui_text(srna, "Theme Top Bar", "Theme settings for the Top Bar");
4559
4561}
4562
4564{
4565 StructRNA *srna;
4566
4567 /* space_statusbar */
4568
4569 srna = RNA_def_struct(brna, "ThemeStatusBar", nullptr);
4570 RNA_def_struct_sdna(srna, "ThemeSpace");
4571 RNA_def_struct_ui_text(srna, "Theme Status Bar", "Theme settings for the Status Bar");
4572
4574}
4575
4577{
4578 StructRNA *srna;
4579 PropertyRNA *prop;
4580
4581 /* space_spreadsheet */
4582
4583 srna = RNA_def_struct(brna, "ThemeSpreadsheet", nullptr);
4584 RNA_def_struct_sdna(srna, "ThemeSpace");
4585 RNA_def_struct_ui_text(srna, "Theme Spreadsheet", "Theme settings for the Spreadsheet");
4586
4587 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
4588 RNA_def_property_array(prop, 4);
4589 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
4590 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4591
4593}
4594
4596{
4597 StructRNA *srna;
4598 PropertyRNA *prop;
4599
4600 static const EnumPropertyItem active_theme_area[] = {
4601 {0, "USER_INTERFACE", ICON_WORKSPACE, "User Interface", ""},
4602 {19, "STYLE", ICON_FONTPREVIEW, "Text Style", ""},
4603 {26, "REGIONS", ICON_NONE, "Regions", ""},
4604 {25, "COMMON", ICON_NONE, "Common", ""},
4605 {1, "VIEW_3D", ICON_VIEW3D, "3D Viewport", ""},
4606 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet/Timeline", ""},
4607 {16, "FILE_BROWSER", ICON_FILEBROWSER, "File/Asset Browser", ""},
4608 {3, "GRAPH_EDITOR", ICON_GRAPH, "Graph Editor/Drivers", ""},
4609 {6, "IMAGE_EDITOR", ICON_IMAGE, "Image/UV Editor", ""},
4610 {15, "INFO", ICON_INFO, "Info", ""},
4611 {20, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", ""},
4612 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
4613 {5, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", ""},
4614 {12, "OUTLINER", ICON_OUTLINER, "Outliner", ""},
4615 {14, "PREFERENCES", ICON_PREFERENCES, "Preferences", ""},
4616 {11, "PROPERTIES", ICON_PROPERTIES, "Properties", ""},
4617 {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
4618 {23, "SPREADSHEET", ICON_SPREADSHEET, "Spreadsheet"},
4619 {22, "STATUSBAR", ICON_STATUSBAR, "Status Bar", ""},
4620 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
4621 {21, "TOPBAR", ICON_TOPBAR, "Top Bar", ""},
4622 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", ""},
4623 {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
4624 {0, nullptr, 0, nullptr, nullptr},
4625 };
4626
4627 srna = RNA_def_struct(brna, "Theme", nullptr);
4628 RNA_def_struct_sdna(srna, "bTheme");
4629 RNA_def_struct_ui_text(srna, "Theme", "User interface styling and color settings");
4630
4631 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4632 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
4633 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_Theme_name_set");
4634 RNA_def_struct_name_property(srna, prop);
4635 /* XXX: for now putting this in presets is silly - its just Default */
4637
4638 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
4639 RNA_def_property_string_sdna(prop, nullptr, "filepath");
4641 prop, "File Path", "The path to the preset loaded into this theme (if any)");
4642 /* Don't store in presets. */
4644 RNA_def_property_update(prop, 0, "rna_userdef_update");
4645
4646 prop = RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
4647 RNA_def_property_enum_sdna(prop, nullptr, "active_theme_area");
4649 RNA_def_property_enum_items(prop, active_theme_area);
4650 RNA_def_property_ui_text(prop, "Active Theme Area", "");
4651
4652 prop = RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
4654 RNA_def_property_pointer_sdna(prop, nullptr, "tui");
4655 RNA_def_property_struct_type(prop, "ThemeUserInterface");
4656 RNA_def_property_ui_text(prop, "User Interface", "");
4657
4658 prop = RNA_def_property(srna, "regions", PROP_POINTER, PROP_NONE);
4660 RNA_def_property_struct_type(prop, "ThemeRegions");
4661 RNA_def_property_ui_text(prop, "Regions", "Theme properties for common editor regions");
4662
4663 prop = RNA_def_property(srna, "common", PROP_POINTER, PROP_NONE);
4665 RNA_def_property_struct_type(prop, "ThemeCommon");
4666 RNA_def_property_ui_text(prop, "Common", "Theme properties shared by different editors");
4667
4668 /* Space Types */
4669 prop = RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
4671 RNA_def_property_pointer_sdna(prop, nullptr, "space_view3d");
4672 RNA_def_property_struct_type(prop, "ThemeView3D");
4673 RNA_def_property_ui_text(prop, "3D Viewport", "");
4674
4675 prop = RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
4677 RNA_def_property_pointer_sdna(prop, nullptr, "space_graph");
4678 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
4679 RNA_def_property_ui_text(prop, "Graph Editor", "");
4680
4681 prop = RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
4683 RNA_def_property_pointer_sdna(prop, nullptr, "space_file");
4684 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
4685 RNA_def_property_ui_text(prop, "File Browser", "");
4686
4687 prop = RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
4689 RNA_def_property_pointer_sdna(prop, nullptr, "space_nla");
4690 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
4691 RNA_def_property_ui_text(prop, "Nonlinear Animation", "");
4692
4693 prop = RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
4695 RNA_def_property_pointer_sdna(prop, nullptr, "space_action");
4696 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
4697 RNA_def_property_ui_text(prop, "Dope Sheet", "");
4698
4699 prop = RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
4701 RNA_def_property_pointer_sdna(prop, nullptr, "space_image");
4702 RNA_def_property_struct_type(prop, "ThemeImageEditor");
4703 RNA_def_property_ui_text(prop, "Image Editor", "");
4704
4705 prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
4707 RNA_def_property_pointer_sdna(prop, nullptr, "space_sequencer");
4708 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
4709 RNA_def_property_ui_text(prop, "Sequence Editor", "");
4710
4711 prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
4713 RNA_def_property_pointer_sdna(prop, nullptr, "space_properties");
4714 RNA_def_property_struct_type(prop, "ThemeProperties");
4715 RNA_def_property_ui_text(prop, "Properties", "");
4716
4717 prop = RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
4719 RNA_def_property_pointer_sdna(prop, nullptr, "space_text");
4720 RNA_def_property_struct_type(prop, "ThemeTextEditor");
4721 RNA_def_property_ui_text(prop, "Text Editor", "");
4722
4723 prop = RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
4725 RNA_def_property_pointer_sdna(prop, nullptr, "space_node");
4726 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
4727 RNA_def_property_ui_text(prop, "Node Editor", "");
4728
4729 prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
4731 RNA_def_property_pointer_sdna(prop, nullptr, "space_outliner");
4732 RNA_def_property_struct_type(prop, "ThemeOutliner");
4733 RNA_def_property_ui_text(prop, "Outliner", "");
4734
4735 prop = RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
4737 RNA_def_property_pointer_sdna(prop, nullptr, "space_info");
4738 RNA_def_property_struct_type(prop, "ThemeInfo");
4739 RNA_def_property_ui_text(prop, "Info", "");
4740
4741 prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
4743 RNA_def_property_pointer_sdna(prop, nullptr, "space_preferences");
4744 RNA_def_property_struct_type(prop, "ThemePreferences");
4745 RNA_def_property_ui_text(prop, "Preferences", "");
4746
4747 prop = RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
4749 RNA_def_property_pointer_sdna(prop, nullptr, "space_console");
4750 RNA_def_property_struct_type(prop, "ThemeConsole");
4751 RNA_def_property_ui_text(prop, "Console", "");
4752
4753 prop = RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE);
4755 RNA_def_property_pointer_sdna(prop, nullptr, "space_clip");
4756 RNA_def_property_struct_type(prop, "ThemeClipEditor");
4757 RNA_def_property_ui_text(prop, "Clip Editor", "");
4758
4759 prop = RNA_def_property(srna, "topbar", PROP_POINTER, PROP_NONE);
4761 RNA_def_property_pointer_sdna(prop, nullptr, "space_topbar");
4762 RNA_def_property_struct_type(prop, "ThemeTopBar");
4763 RNA_def_property_ui_text(prop, "Top Bar", "");
4764
4765 prop = RNA_def_property(srna, "statusbar", PROP_POINTER, PROP_NONE);
4767 RNA_def_property_pointer_sdna(prop, nullptr, "space_statusbar");
4768 RNA_def_property_struct_type(prop, "ThemeStatusBar");
4769 RNA_def_property_ui_text(prop, "Status Bar", "");
4770
4771 prop = RNA_def_property(srna, "spreadsheet", PROP_POINTER, PROP_NONE);
4773 RNA_def_property_pointer_sdna(prop, nullptr, "space_spreadsheet");
4774 RNA_def_property_struct_type(prop, "ThemeSpreadsheet");
4775 RNA_def_property_ui_text(prop, "Spreadsheet", "");
4776 /* end space types */
4777
4778 prop = RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
4780 RNA_def_property_collection_sdna(prop, nullptr, "tarm", "");
4781 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
4782 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
4783
4784 prop = RNA_def_property(srna, "collection_color", PROP_COLLECTION, PROP_NONE);
4786 RNA_def_property_collection_sdna(prop, nullptr, "collection_color", "");
4787 RNA_def_property_struct_type(prop, "ThemeCollectionColor");
4788 RNA_def_property_ui_text(prop, "Collection Color", "");
4789
4790 prop = RNA_def_property(srna, "strip_color", PROP_COLLECTION, PROP_NONE);
4792 RNA_def_property_collection_sdna(prop, nullptr, "strip_color", "");
4793 RNA_def_property_struct_type(prop, "ThemeStripColor");
4794 RNA_def_property_ui_text(prop, "Strip Color", "");
4795}
4796
4798{
4799 StructRNA *srna;
4800 PropertyRNA *prop;
4801
4802 srna = RNA_def_struct(brna, "Addon", nullptr);
4803 RNA_def_struct_sdna(srna, "bAddon");
4804 RNA_def_struct_ui_text(srna, "Add-on", "Python add-ons to be loaded automatically");
4805
4806 prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
4807 RNA_def_property_ui_text(prop, "Module", "Module name");
4808 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_Addon_module_set");
4809 RNA_def_struct_name_property(srna, prop);
4810
4811 /* Collection active property */
4812 prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
4813 RNA_def_property_struct_type(prop, "AddonPreferences");
4814 RNA_def_property_pointer_funcs(prop, "rna_Addon_preferences_get", nullptr, nullptr, nullptr);
4815}
4816
4818{
4819 StructRNA *srna;
4820 FunctionRNA *func;
4821 PropertyRNA *parm;
4822
4823 srna = RNA_def_struct(brna, "StudioLights", nullptr);
4824 RNA_def_struct_sdna(srna, "UserDef");
4825 RNA_def_struct_ui_text(srna, "Studio Lights", "Collection of studio lights");
4826
4827 func = RNA_def_function(srna, "load", "rna_StudioLights_load");
4828 RNA_def_function_ui_description(func, "Load studiolight from file");
4829 parm = RNA_def_string(
4830 func, "path", nullptr, 0, "File Path", "File path where the studio light file can be found");
4832 parm = RNA_def_enum(func,
4833 "type",
4836 "Type",
4837 "The type for the new studio light");
4840 parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "Newly created StudioLight");
4841 RNA_def_function_return(func, parm);
4842
4843 func = RNA_def_function(srna, "new", "rna_StudioLights_new");
4844 RNA_def_function_ui_description(func, "Create studiolight from default lighting");
4845 parm = RNA_def_string(
4846 func,
4847 "path",
4848 nullptr,
4849 0,
4850 "Path",
4851 "Path to the file that will contain the lighting info (without extension)");
4853 parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "Newly created StudioLight");
4855 RNA_def_function_return(func, parm);
4856
4857 func = RNA_def_function(srna, "remove", "rna_StudioLights_remove");
4858 RNA_def_function_ui_description(func, "Remove a studio light");
4859 parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "The studio light to remove");
4861
4862 func = RNA_def_function(srna, "refresh", "rna_StudioLights_refresh");
4863 RNA_def_function_ui_description(func, "Refresh Studio Lights from disk");
4864}
4865
4867{
4868 StructRNA *srna;
4869 PropertyRNA *prop;
4870
4872 srna = RNA_def_struct(brna, "StudioLight", nullptr);
4873 RNA_def_struct_ui_text(srna, "Studio Light", "Studio light");
4874
4875 prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
4876 RNA_def_property_int_funcs(prop, "rna_UserDef_studiolight_index_get", nullptr, nullptr);
4878 RNA_def_property_ui_text(prop, "Index", "");
4879
4880 prop = RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
4881 RNA_def_property_boolean_funcs(prop, "rna_UserDef_studiolight_is_user_defined_get", nullptr);
4883 RNA_def_property_ui_text(prop, "User Defined", "");
4884
4885 prop = RNA_def_property(srna, "has_specular_highlight_pass", PROP_BOOLEAN, PROP_NONE);
4887 prop, "rna_UserDef_studiolight_has_specular_highlight_pass_get", nullptr);
4890 prop,
4891 "Has Specular Highlight",
4892 "Studio light image file has separate \"diffuse\" and \"specular\" passes");
4893
4894 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4896 RNA_def_property_enum_funcs(prop, "rna_UserDef_studiolight_type_get", nullptr, nullptr);
4898 RNA_def_property_ui_text(prop, "Type", "");
4900
4901 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4903 prop, "rna_UserDef_studiolight_name_get", "rna_UserDef_studiolight_name_length", nullptr);
4904 RNA_def_property_ui_text(prop, "Name", "");
4906 RNA_def_struct_name_property(srna, prop);
4907
4908 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
4910 prop, "rna_UserDef_studiolight_path_get", "rna_UserDef_studiolight_path_length", nullptr);
4911 RNA_def_property_ui_text(prop, "Path", "");
4913
4914 prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
4915 RNA_def_property_collection_sdna(prop, nullptr, "light_param", "");
4916 RNA_def_property_struct_type(prop, "UserSolidLight");
4918 "rna_UserDef_studiolight_solid_lights_begin",
4919 "rna_iterator_array_next",
4920 "rna_iterator_array_end",
4921 "rna_iterator_array_get",
4922 "rna_UserDef_studiolight_solid_lights_length",
4923 nullptr,
4924 nullptr,
4925 nullptr);
4927 prop, "Solid Lights", "Lights used to display objects in solid draw mode");
4929
4930 prop = RNA_def_property(srna, "light_ambient", PROP_FLOAT, PROP_COLOR);
4931 RNA_def_property_array(prop, 3);
4933 prop, "rna_UserDef_studiolight_light_ambient_get", nullptr, nullptr);
4935 prop, "Ambient Color", "Color of the ambient light that uniformly lit the scene");
4937
4939}
4940
4942{
4943 StructRNA *srna;
4944 PropertyRNA *prop;
4945
4946 srna = RNA_def_struct(brna, "PathCompare", nullptr);
4947 RNA_def_struct_sdna(srna, "bPathCompare");
4948 RNA_def_struct_ui_text(srna, "Path Compare", "Match paths against this value");
4949
4950 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
4951 RNA_def_property_ui_text(prop, "Path", "");
4953 RNA_def_struct_name_property(srna, prop);
4954
4955 prop = RNA_def_property(srna, "use_glob", PROP_BOOLEAN, PROP_NONE);
4956 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_PATHCMP_GLOB);
4957 RNA_def_property_ui_text(prop, "Use Wildcard", "Enable wildcard globbing");
4958}
4959
4961{
4962 StructRNA *srna;
4963 PropertyRNA *prop;
4964
4965 srna = RNA_def_struct(brna, "AddonPreferences", nullptr);
4966 RNA_def_struct_ui_text(srna, "Add-on Preferences", "");
4967 RNA_def_struct_sdna(srna, "bAddon"); /* WARNING: only a bAddon during registration */
4968
4969 RNA_def_struct_refine_func(srna, "rna_AddonPref_refine");
4971 srna, "rna_AddonPref_register", "rna_AddonPref_unregister", nullptr);
4972 RNA_def_struct_system_idprops_func(srna, "rna_AddonPref_idprops");
4974
4976
4977 /* registration */
4979 prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
4980 RNA_def_property_string_sdna(prop, nullptr, "module");
4983
4985}
4986
5021
5023{
5024 StructRNA *srna;
5025 PropertyRNA *prop;
5026
5027 srna = RNA_def_struct(brna, "UserSolidLight", nullptr);
5028 RNA_def_struct_sdna(srna, "SolidLight");
5030 srna, "Solid Light", "Light used for Studio lighting in solid shading mode");
5031
5032 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
5033 RNA_def_property_boolean_sdna(prop, nullptr, "flag", 1);
5035 RNA_def_property_ui_text(prop, "Enabled", "Enable this light in solid shading mode");
5036 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
5037
5038 prop = RNA_def_property(srna, "smooth", PROP_FLOAT, PROP_FACTOR);
5039 RNA_def_property_float_sdna(prop, nullptr, "smooth");
5041 RNA_def_property_range(prop, 0.0f, 1.0f);
5042 RNA_def_property_ui_text(prop, "Smooth", "Smooth the lighting from this light");
5044 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
5045
5046 prop = RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
5047 RNA_def_property_float_sdna(prop, nullptr, "vec");
5048 RNA_def_property_array(prop, 3);
5049 RNA_def_property_ui_text(prop, "Direction", "Direction that the light is shining");
5050 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
5051
5052 prop = RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
5053 RNA_def_property_float_sdna(prop, nullptr, "spec");
5054 RNA_def_property_array(prop, 3);
5055 RNA_def_property_ui_text(prop, "Specular Color", "Color of the light's specular highlight");
5056 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
5057
5058 prop = RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
5059 RNA_def_property_float_sdna(prop, nullptr, "col");
5060 RNA_def_property_array(prop, 3);
5061 RNA_def_property_ui_text(prop, "Diffuse Color", "Color of the light's diffuse highlight");
5062 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
5063}
5064
5066{
5067 StructRNA *srna;
5068 PropertyRNA *prop;
5069
5070 srna = RNA_def_struct(brna, "WalkNavigation", nullptr);
5071 RNA_def_struct_sdna(srna, "WalkNavigation");
5072 RNA_def_struct_ui_text(srna, "Walk Navigation", "Walk navigation settings");
5073
5074 prop = RNA_def_property(srna, "mouse_speed", PROP_FLOAT, PROP_NONE);
5075 RNA_def_property_range(prop, 0.01f, 10.0f);
5077 prop,
5078 "Mouse Sensitivity",
5079 "Speed factor for when looking around, high values mean faster mouse movement");
5080
5081 prop = RNA_def_property(srna, "walk_speed", PROP_FLOAT, PROP_VELOCITY);
5082 RNA_def_property_range(prop, 0.01f, 100.0f);
5083 RNA_def_property_ui_text(prop, "Walk Speed", "Base speed for walking and flying");
5084
5085 prop = RNA_def_property(srna, "walk_speed_factor", PROP_FLOAT, PROP_NONE);
5086 RNA_def_property_range(prop, 0.01f, 10.0f);
5088 prop, "Speed Factor", "Multiplication factor when using the fast or slow modifiers");
5089
5090 prop = RNA_def_property(srna, "view_height", PROP_FLOAT, PROP_UNIT_LENGTH);
5091 RNA_def_property_ui_range(prop, 0.1f, 10.0f, 0.1, 2);
5092 RNA_def_property_range(prop, 0.0f, 1000.0f);
5093 RNA_def_property_ui_text(prop, "View Height", "View distance from the floor when walking");
5094
5095 prop = RNA_def_property(srna, "jump_height", PROP_FLOAT, PROP_UNIT_LENGTH);
5096 RNA_def_property_ui_range(prop, 0.1f, 10.0f, 0.1, 2);
5097 RNA_def_property_range(prop, 0.1f, 100.0f);
5098 RNA_def_property_ui_text(prop, "Jump Height", "Maximum height of a jump");
5099
5100 prop = RNA_def_property(srna, "teleport_time", PROP_FLOAT, PROP_NONE);
5101 RNA_def_property_range(prop, 0.0f, 10.0f);
5103 prop, "Teleport Duration", "Interval of time warp when teleporting in navigation mode");
5104
5105 prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_BOOLEAN);
5106 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_WALK_GRAVITY);
5107 RNA_def_property_ui_text(prop, "Gravity", "Walk with gravity, or free navigate");
5108
5109 prop = RNA_def_property(srna, "use_mouse_reverse", PROP_BOOLEAN, PROP_BOOLEAN);
5111 RNA_def_property_ui_text(prop, "Reverse Mouse", "Reverse the vertical movement of the mouse");
5112}
5113
5115{
5116 StructRNA *srna;
5117 PropertyRNA *prop;
5118
5119 srna = RNA_def_struct(brna, "XrNavigation", nullptr);
5120 RNA_def_struct_sdna(srna, "XrNavigation");
5121 RNA_def_struct_ui_text(srna, "VR Navigation", "VR navigation settings");
5122
5123 prop = RNA_def_property(srna, "vignette_intensity", PROP_FLOAT, PROP_PERCENTAGE);
5124 RNA_def_property_range(prop, 0, 100.0);
5125 RNA_def_property_ui_range(prop, 0, 100.0, 1000, 0);
5127 prop, "Vignette Intensity", "Intensity of vignette that appears when moving");
5128
5129 prop = RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_ANGLE);
5131 RNA_def_property_ui_range(prop, 0, FLT_MAX, 1000, 0);
5132 RNA_def_property_ui_text(prop, "Turn Speed", "Turn speed in degrees per second");
5133
5134 prop = RNA_def_property(srna, "turn_amount", PROP_FLOAT, PROP_ANGLE);
5135 RNA_def_property_range(prop, 0, DEG2RAD(360));
5136 RNA_def_property_ui_range(prop, 0, DEG2RAD(360), 1000, 0);
5137 RNA_def_property_ui_text(prop, "Turn Amount", "Amount in degrees per turn when using snap turn");
5138
5139 prop = RNA_def_property(srna, "snap_turn", PROP_BOOLEAN, PROP_NONE);
5142 prop,
5143 "Snap Turn",
5144 "Instantly rotates the camera by a fixed angle instead of smoothly turning");
5145
5146 prop = RNA_def_property(srna, "invert_rotation", PROP_BOOLEAN, PROP_NONE);
5148 RNA_def_property_ui_text(prop, "Invert Rotation", "Reverses the direction of rotation input");
5149}
5150
5152{
5153 static const EnumPropertyItem timecode_styles[] = {
5155 "MINIMAL",
5156 0,
5157 "Minimal Info",
5158 "Most compact representation, uses '+' as separator for sub-second frame numbers, "
5159 "with left and right truncation of the timecode as necessary"},
5161 "SMPTE",
5162 0,
5163 "SMPTE (Full)",
5164 "Full SMPTE timecode (format is HH:MM:SS:FF)"},
5166 "SMPTE_COMPACT",
5167 0,
5168 "SMPTE (Compact)",
5169 "SMPTE timecode showing minutes, seconds, and frames only - "
5170 "hours are also shown if necessary, but not by default"},
5172 "MILLISECONDS",
5173 0,
5174 "Compact with Decimals",
5175 "Similar to SMPTE (Compact), except that the decimal part of the second is shown instead "
5176 "of frames"},
5178 "SECONDS_ONLY",
5179 0,
5180 "Only Seconds",
5181 "Direct conversion of frame numbers to seconds"},
5182 {0, nullptr, 0, nullptr, nullptr},
5183 };
5184
5185 static const EnumPropertyItem color_picker_types[] = {
5187 "CIRCLE_HSV",
5188 0,
5189 "Circle (HSV)",
5190 "A circular Hue/Saturation color wheel, with "
5191 "Value slider"},
5193 "CIRCLE_HSL",
5194 0,
5195 "Circle (HSL)",
5196 "A circular Hue/Saturation color wheel, with "
5197 "Lightness slider"},
5199 "SQUARE_SV",
5200 0,
5201 "Square (SV + H)",
5202 "A square showing Saturation/Value, with Hue slider"},
5204 "SQUARE_HS",
5205 0,
5206 "Square (HS + V)",
5207 "A square showing Hue/Saturation, with Value slider"},
5209 "SQUARE_HV",
5210 0,
5211 "Square (HV + S)",
5212 "A square showing Hue/Value, with Saturation slider"},
5213 {0, nullptr, 0, nullptr, nullptr},
5214 };
5215
5216 static const EnumPropertyItem zoom_frame_modes[] = {
5217 {ZOOM_FRAME_MODE_KEEP_RANGE, "KEEP_RANGE", 0, "Keep Range", ""},
5218 {ZOOM_FRAME_MODE_SECONDS, "SECONDS", 0, "Seconds", ""},
5219 {ZOOM_FRAME_MODE_KEYFRAMES, "KEYFRAMES", 0, "Keyframes", ""},
5220 {0, nullptr, 0, nullptr, nullptr},
5221 };
5222
5223 static const EnumPropertyItem line_width[] = {
5224 {-1, "THIN", 0, "Thin", "Thinner lines than the default"},
5225 {0, "AUTO", 0, "Default", "Automatic line width based on UI scale"},
5226 {1, "THICK", 0, "Thick", "Thicker lines than the default"},
5227 {0, nullptr, 0, nullptr, nullptr},
5228 };
5229
5230 static const EnumPropertyItem render_display_types[] = {
5232 "NONE",
5233 0,
5234 "Keep User Interface",
5235 "Images are rendered without changing the user interface"},
5237 "SCREEN",
5238 0,
5239 "Maximized Area",
5240 "Images are rendered in a maximized Image Editor"},
5242 "AREA",
5243 0,
5244 "Image Editor",
5245 "Images are rendered in an Image Editor"},
5247 "WINDOW",
5248 0,
5249 "New Window",
5250 "Images are rendered in a new window"},
5251 {0, nullptr, 0, nullptr, nullptr},
5252 };
5253 static const EnumPropertyItem temp_space_display_types[] = {
5255 "SCREEN", /* Could be FULLSCREEN, but keeping it consistent with render_display_types */
5256 0,
5257 "Maximized Area",
5258 "Open the temporary editor in a maximized screen"},
5260 "WINDOW",
5261 0,
5262 "New Window",
5263 "Open the temporary editor in a new window"},
5264 {0, nullptr, 0, nullptr, nullptr},
5265 };
5266
5267 PropertyRNA *prop;
5268 StructRNA *srna;
5269
5270 srna = RNA_def_struct(brna, "PreferencesView", nullptr);
5271 RNA_def_struct_sdna(srna, "UserDef");
5272 RNA_def_struct_nested(brna, srna, "Preferences");
5273 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
5274
5275 /* View. */
5276 prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_NONE);
5278 prop, "UI Scale", "Changes the size of the fonts and widgets in the interface");
5279 RNA_def_property_range(prop, 0.5f, 6.0f);
5280 RNA_def_property_ui_range(prop, 0.5f, 3.0f, 1, 2);
5281 RNA_def_property_update(prop, 0, "rna_userdef_gpu_and_text_update");
5282
5283 prop = RNA_def_property(srna, "border_width", PROP_INT, PROP_NONE);
5284 RNA_def_property_ui_text(prop, "Border Width", "Size of the padding around each editor.");
5285 RNA_def_property_range(prop, 1.0f, 10.0f);
5286 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
5287
5288 prop = RNA_def_property(srna, "ui_line_width", PROP_ENUM, PROP_NONE);
5289 RNA_def_property_enum_items(prop, line_width);
5291 prop,
5292 "UI Line Width",
5293 "Changes the thickness of widget outlines, lines and dots in the interface");
5294 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
5295
5296 /* display */
5297 prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
5298 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_TOOLTIPS);
5300 prop, "Tooltips", "Display tooltips (when disabled, hold Alt then hover to force display)");
5301
5302 prop = RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
5304 RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips");
5305
5306 prop = RNA_def_property(srna, "show_developer_ui", PROP_BOOLEAN, PROP_NONE);
5307 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_DEVELOPER_UI);
5309 prop, "Developer Extras", "Display advanced settings and tools for developers");
5310 RNA_def_property_update(prop, 0, "rna_userdef_update");
5311
5312 prop = RNA_def_property(srna, "show_area_handle", PROP_BOOLEAN, PROP_NONE);
5314 RNA_def_property_ui_text(prop, "Corner Handles", "Show visible area maintenance corner handles");
5315 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
5316
5317 prop = RNA_def_property(srna, "show_number_arrows", PROP_BOOLEAN, PROP_NONE);
5320 prop,
5321 "Show Numeric Input Arrows",
5322 "Display arrows in numeric input fields for increasing or decreasing values");
5323 RNA_def_property_update(prop, 0, "rna_userdef_update");
5324
5325 prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
5326 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DRAWVIEWINFO);
5328 "Display Object Info",
5329 "Include the name of the active object and the current frame number in "
5330 "the text info overlay");
5331 RNA_def_property_update(prop, 0, "rna_userdef_update");
5332
5333 prop = RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
5334 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_SHOW_VIEWPORTNAME);
5336 "Display View Name",
5337 "Include the name of the view orientation in the text info overlay");
5338 RNA_def_property_update(prop, 0, "rna_userdef_update");
5339
5340 prop = RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
5342 RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
5343
5344 prop = RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
5345 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_SHOW_FPS);
5347 "Display Playback Frame Rate (FPS)",
5348 "Include the number of frames displayed per second in the text info "
5349 "overlay while animation is played back");
5350 RNA_def_property_update(prop, 0, "rna_userdef_update");
5351
5352 prop = RNA_def_property(srna, "playback_fps_samples", PROP_INT, PROP_NONE);
5353 RNA_def_property_int_sdna(prop, nullptr, "playback_fps_samples");
5354 /* NOTE(@ideasman42): this maximum is arbitrary, 5000 samples averages over the last 10 seconds
5355 * for an animation playing back at 500fps, which seems like more than enough. */
5356 RNA_def_property_range(prop, 0, 5000);
5357 RNA_def_property_ui_range(prop, 0, 500, 1, 3);
5359 prop,
5360 "FPS Average Samples",
5361 "The number of frames to use for calculating FPS average. "
5362 "Zero to calculate this automatically, where the number of samples matches the target FPS.");
5363 RNA_def_property_update(prop, 0, "rna_userdef_update");
5364
5365 prop = RNA_def_property(srna, "use_fresnel_edit", PROP_BOOLEAN, PROP_NONE);
5368 "Edit Mode",
5369 "Enable a fresnel effect on edit mesh overlays.\n"
5370 "It improves shape readability of very dense meshes, "
5371 "but increases eye fatigue when modeling lower poly");
5372 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
5373
5375 prop = RNA_def_property(srna, "show_addons_enabled_only", PROP_BOOLEAN, PROP_NONE);
5377 prop, nullptr, "space_data.flag", USER_SPACEDATA_ADDONS_SHOW_ONLY_ENABLED);
5379 "Enabled Add-ons Only",
5380 "Only show enabled add-ons. Un-check to see all installed add-ons.");
5382
5383 static const EnumPropertyItem factor_display_items[] = {
5384 {USER_FACTOR_AS_FACTOR, "FACTOR", 0, "Factor", "Display factors as values between 0 and 1"},
5385 {USER_FACTOR_AS_PERCENTAGE, "PERCENTAGE", 0, "Percentage", "Display factors as percentages"},
5386 {0, nullptr, 0, nullptr, nullptr},
5387 };
5388
5389 prop = RNA_def_property(srna, "factor_display_type", PROP_ENUM, PROP_NONE);
5390 RNA_def_property_enum_items(prop, factor_display_items);
5391 RNA_def_property_ui_text(prop, "Factor Display Type", "How factor values are displayed");
5392 RNA_def_property_update(prop, 0, "rna_userdef_update");
5393
5394 /* Weight Paint */
5395
5396 prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
5397 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_CUSTOM_RANGE);
5399 prop,
5400 "Use Weight Color Range",
5401 "Enable color range used for weight visualization in weight painting mode");
5402 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
5403
5404 prop = RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
5406 RNA_def_property_pointer_sdna(prop, nullptr, "coba_weight");
5407 RNA_def_property_struct_type(prop, "ColorRamp");
5409 "Weight Color Range",
5410 "Color range used for weight visualization in weight painting mode");
5411 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
5412
5413 prop = RNA_def_property(srna, "show_navigate_ui", PROP_BOOLEAN, PROP_NONE);
5416 prop,
5417 "Navigation Controls",
5418 "Show navigation controls in 2D and 3D views which do not have scroll bars");
5419 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5420
5421 /* menus */
5422 prop = RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
5423 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_MENUOPENAUTO);
5425 prop,
5426 "Open on Mouse Over",
5427 "Open menu buttons and pull-downs automatically when the mouse is hovering");
5428
5429 prop = RNA_def_property(srna, "menu_close_leave", PROP_BOOLEAN, PROP_NONE);
5432 prop, "Close Menu on Leave", "Close menus when the mouse is moved out of the region.");
5433
5434 prop = RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
5435 RNA_def_property_int_sdna(prop, nullptr, "menuthreshold1");
5436 RNA_def_property_range(prop, 1, 40);
5438 prop,
5439 "Top Level Menu Open Delay",
5440 "Time delay in 1/10 seconds before automatically opening top level menus");
5441
5442 prop = RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
5443 RNA_def_property_int_sdna(prop, nullptr, "menuthreshold2");
5444 RNA_def_property_range(prop, 1, 40);
5446 prop,
5447 "Sub Level Menu Open Delay",
5448 "Time delay in 1/10 seconds before automatically opening sub level menus");
5449
5450 prop = RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
5451 RNA_def_property_enum_items(prop, color_picker_types);
5452 RNA_def_property_enum_sdna(prop, nullptr, "color_picker_type");
5454 prop, "Color Picker Type", "Different styles of displaying the color picker widget");
5455 RNA_def_property_update(prop, 0, "rna_userdef_update");
5456
5457 /* pie menus */
5458 prop = RNA_def_property(srna, "pie_initial_timeout", PROP_INT, PROP_NONE);
5459 RNA_def_property_range(prop, 0, 1000);
5461 prop,
5462 "Recenter Timeout",
5463 "Pie menus will use the initial mouse position as center for this amount of time "
5464 "(in 1/100ths of sec)");
5465
5466 prop = RNA_def_property(srna, "pie_tap_timeout", PROP_INT, PROP_NONE);
5467 RNA_def_property_range(prop, 0, 1000);
5469 "Tap Key Timeout",
5470 "Pie menu button held longer than this will dismiss menu on release "
5471 "(in 1/100ths of sec)");
5472
5473 prop = RNA_def_property(srna, "pie_animation_timeout", PROP_INT, PROP_NONE);
5474 RNA_def_property_range(prop, 0, 1000);
5476 prop,
5477 "Animation Timeout",
5478 "Time needed to fully animate the pie to unfolded state (in 1/100ths of sec)");
5479
5480 prop = RNA_def_property(srna, "pie_menu_radius", PROP_INT, PROP_PIXEL);
5481 RNA_def_property_range(prop, 0, 1000);
5482 RNA_def_property_ui_text(prop, "Radius", "Pie menu size in pixels");
5483
5484 prop = RNA_def_property(srna, "pie_menu_threshold", PROP_INT, PROP_PIXEL);
5485 RNA_def_property_range(prop, 0, 1000);
5487 prop, "Threshold", "Distance from center needed before a selection can be made");
5488
5489 prop = RNA_def_property(srna, "pie_menu_confirm", PROP_INT, PROP_PIXEL);
5490 RNA_def_property_range(prop, 0, 1000);
5492 "Confirm Threshold",
5493 "Distance threshold after which selection is made (zero to disable)");
5494
5495 prop = RNA_def_property(srna, "use_save_prompt", PROP_BOOLEAN, PROP_NONE);
5496 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_SAVE_PROMPT);
5498 prop, "Save Prompt", "Ask for confirmation when quitting with unsaved changes");
5499
5500 prop = RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
5501 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_PLAINMENUS);
5502 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
5503
5504 prop = RNA_def_property(srna, "use_filter_brushes_by_tool", PROP_BOOLEAN, PROP_NONE);
5507 "Filter Brushes by Tool",
5508 "Only show brushes applicable for the currently active tool in the "
5509 "asset shelf. Stored in the Preferences, which may have to be saved "
5510 "manually if Auto-Save Preferences is disabled");
5511 RNA_def_property_update(prop, 0, "rna_userdef_update");
5512
5513 prop = RNA_def_property(srna, "asset_access", PROP_ENUM, PROP_NONE);
5516 prop, "Asset Access", "Choose the visibility of online and offline assets");
5517 RNA_def_property_update(prop, 0, "rna_userdef_update");
5518
5519 static const EnumPropertyItem header_align_items[] = {
5520 {0, "NONE", 0, "Keep Existing", "Keep existing header alignment"},
5521 {USER_HEADER_FROM_PREF, "TOP", 0, "Top", "Top aligned on load"},
5523 "BOTTOM",
5524 0,
5525 "Bottom",
5526 "Bottom align on load (except for property editors)"},
5527 {0, nullptr, 0, nullptr, nullptr},
5528 };
5529 prop = RNA_def_property(srna, "header_align", PROP_ENUM, PROP_NONE);
5530 RNA_def_property_enum_items(prop, header_align_items);
5531 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "uiflag");
5533 RNA_def_property_ui_text(prop, "Header Position", "Default header position for new space-types");
5534 RNA_def_property_update(prop, 0, "rna_userdef_screen_update_header_default");
5535
5536 prop = RNA_def_property(srna, "render_display_type", PROP_ENUM, PROP_NONE);
5537 RNA_def_property_enum_items(prop, render_display_types);
5539 prop, "Render Display Type", "Default location where rendered images will be displayed in");
5540
5541 prop = RNA_def_property(srna, "filebrowser_display_type", PROP_ENUM, PROP_NONE);
5542 RNA_def_property_enum_items(prop, temp_space_display_types);
5544 "File Browser Display Type",
5545 "Default location where the File Editor will be displayed in");
5546
5547 prop = RNA_def_property(srna, "preferences_display_type", PROP_ENUM, PROP_NONE);
5548 RNA_def_property_enum_items(prop, temp_space_display_types);
5550 "Preferences Display Type",
5551 "Default location where the Preferences will be displayed in");
5552
5553 static const EnumPropertyItem text_hinting_items[] = {
5554 {0, "AUTO", 0, "Auto", ""},
5555 {USER_TEXT_HINTING_NONE, "NONE", 0, "None", ""},
5556 {USER_TEXT_HINTING_SLIGHT, "SLIGHT", 0, "Slight", ""},
5557 {USER_TEXT_HINTING_FULL, "FULL", 0, "Full", ""},
5558 {0, nullptr, 0, nullptr, nullptr},
5559 };
5560
5561 /* mini axis */
5562 static const EnumPropertyItem mini_axis_type_items[] = {
5563 {USER_MINI_AXIS_TYPE_NONE, "NONE", 0, "Off", ""},
5564 {USER_MINI_AXIS_TYPE_MINIMAL, "MINIMAL", 0, "Simple Axes", ""},
5565 {USER_MINI_AXIS_TYPE_GIZMO, "GIZMO", 0, "Interactive Navigation", ""},
5566 {0, nullptr, 0, nullptr, nullptr},
5567 };
5568
5569 prop = RNA_def_property(srna, "mini_axis_type", PROP_ENUM, PROP_NONE);
5570 RNA_def_property_enum_items(prop, mini_axis_type_items);
5572 prop,
5573 "Mini Axes Type",
5574 "Show small rotating 3D axes in the top right corner of the 3D viewport");
5575 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5576
5577 prop = RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_PIXEL);
5578 RNA_def_property_int_sdna(prop, nullptr, "rvisize");
5579 RNA_def_property_range(prop, 10, 64);
5580 RNA_def_property_ui_text(prop, "Mini Axes Size", "The axes icon's size");
5581 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5582
5583 prop = RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
5584 RNA_def_property_int_sdna(prop, nullptr, "rvibright");
5585 RNA_def_property_range(prop, 0, 10);
5586 RNA_def_property_ui_text(prop, "Mini Axes Brightness", "Brightness of the icon");
5587 RNA_def_property_update(prop, 0, "rna_userdef_update");
5588
5589 prop = RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
5590 RNA_def_property_int_sdna(prop, nullptr, "smooth_viewtx");
5591 RNA_def_property_range(prop, 0, 1000);
5593 prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable");
5594
5595 prop = RNA_def_property(srna, "rotation_angle", PROP_FLOAT, PROP_NONE);
5596 RNA_def_property_float_sdna(prop, nullptr, "pad_rot_angle");
5597 RNA_def_property_range(prop, 0, 90);
5599 prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)");
5600
5601 /* 3D transform widget */
5602 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5603 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_flag", USER_GIZMO_DRAW);
5604 RNA_def_property_ui_text(prop, "Gizmos", "Use transform gizmos by default");
5605 RNA_def_property_update(prop, 0, "rna_userdef_update");
5606
5607 prop = RNA_def_property(srna, "gizmo_size", PROP_INT, PROP_PIXEL);
5608 RNA_def_property_int_sdna(prop, nullptr, "gizmo_size");
5609 RNA_def_property_range(prop, 10, 200);
5610 RNA_def_property_ui_text(prop, "Gizmo Size", "Diameter of the gizmo");
5611 RNA_def_property_update(prop, 0, "rna_userdef_update");
5612
5613 prop = RNA_def_property(srna, "gizmo_size_navigate_v3d", PROP_INT, PROP_PIXEL);
5614 RNA_def_property_range(prop, 30, 200);
5615 RNA_def_property_ui_text(prop, "Navigate Gizmo Size", "The Navigate Gizmo size");
5616 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5617
5618 /* Lookdev */
5619 prop = RNA_def_property(srna, "lookdev_sphere_size", PROP_INT, PROP_PIXEL);
5620 RNA_def_property_int_sdna(prop, nullptr, "lookdev_sphere_size");
5621 RNA_def_property_range(prop, 50, 400);
5623 prop, "Reference Sphere Size", "Diameter of the HDRI reference spheres");
5624 RNA_def_property_update(prop, 0, "rna_userdef_update");
5625
5626 /* View2D Grid Displays */
5627 prop = RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_PIXEL);
5628 RNA_def_property_int_sdna(prop, nullptr, "v2d_min_gridsize");
5630 prop, 1, 500); /* XXX: perhaps the lower range should only go down to 5? */
5632 "2D View Minimum Grid Spacing",
5633 "Minimum number of pixels between each gridline in 2D Viewports");
5634 RNA_def_property_update(prop, 0, "rna_userdef_update");
5635
5636 /* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
5637 prop = RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
5638 RNA_def_property_enum_items(prop, timecode_styles);
5639 RNA_def_property_enum_sdna(prop, nullptr, "timecode_style");
5640 RNA_def_property_enum_funcs(prop, nullptr, "rna_userdef_timecode_style_set", nullptr);
5642 prop,
5643 "Timecode Style",
5644 "Format of timecode displayed when not displaying timing in terms of frames");
5645 RNA_def_property_update(prop, 0, "rna_userdef_update");
5646
5647 prop = RNA_def_property(srna, "view_frame_type", PROP_ENUM, PROP_NONE);
5648 RNA_def_property_enum_items(prop, zoom_frame_modes);
5649 RNA_def_property_enum_sdna(prop, nullptr, "view_frame_type");
5651 prop, "Zoom to Frame Type", "How zooming to frame focuses around current frame");
5652
5653 prop = RNA_def_property(srna, "view_frame_keyframes", PROP_INT, PROP_NONE);
5654 RNA_def_property_range(prop, 1, 500);
5655 RNA_def_property_ui_text(prop, "Zoom Keyframes", "Keyframes around cursor that we zoom around");
5656
5657 prop = RNA_def_property(srna, "view_frame_seconds", PROP_FLOAT, PROP_TIME);
5658 RNA_def_property_range(prop, 0.0, 10000.0);
5659 RNA_def_property_ui_text(prop, "Zoom Seconds", "Seconds around cursor that we zoom around");
5660
5661 /* Text. */
5662
5663 prop = RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
5664 RNA_def_property_boolean_negative_sdna(prop, nullptr, "text_render", USER_TEXT_DISABLE_AA);
5666 prop, "Text Anti-Aliasing", "Smooth jagged edges of user interface text");
5667 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
5668
5669 prop = RNA_def_property(srna, "use_text_render_subpixelaa", PROP_BOOLEAN, PROP_NONE);
5670 RNA_def_property_boolean_sdna(prop, nullptr, "text_render", USER_TEXT_RENDER_SUBPIXELAA);
5672 prop, "Text Subpixel Anti-Aliasing", "Render text for optimal horizontal placement");
5673 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
5674
5675 prop = RNA_def_property(srna, "text_hinting", PROP_ENUM, PROP_NONE);
5676 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "text_render");
5677 RNA_def_property_enum_items(prop, text_hinting_items);
5679 prop, "Text Hinting", "Method for making user interface text render sharp");
5680 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
5681
5682 prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH);
5683 RNA_def_property_string_sdna(prop, nullptr, "font_path_ui");
5684 RNA_def_property_ui_text(prop, "Interface Font", "Path to interface font");
5685 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
5686
5687 prop = RNA_def_property(srna, "font_path_ui_mono", PROP_STRING, PROP_FILEPATH);
5688 RNA_def_property_string_sdna(prop, nullptr, "font_path_ui_mono");
5689 RNA_def_property_ui_text(prop, "Monospaced Font", "Path to interface monospaced Font");
5690 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
5691
5692 /* Language. */
5693
5694 prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
5695 /* Set this flag so scripts can access language information at run-time via `enum_items`. */
5698# ifdef WITH_INTERNATIONAL
5699 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_lang_enum_properties_itemf");
5700# else
5702 prop, "rna_lang_enum_properties_get_no_international", nullptr, nullptr);
5703# endif
5704 RNA_def_property_ui_text(prop, "Language", "Language used for translation");
5705 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
5706
5707 prop = RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
5708 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_TOOLTIPS);
5710 "Translate Tooltips",
5711 "Translate the descriptions when hovering UI elements (recommended)");
5712 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5713
5714 prop = RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
5715 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_IFACE);
5717 prop,
5718 "Translate Interface",
5719 "Translate all labels in menus, buttons and panels "
5720 "(note that this might make it hard to follow tutorials or the manual)");
5721 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5722
5723 prop = RNA_def_property(srna, "use_translate_reports", PROP_BOOLEAN, PROP_NONE);
5724 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_REPORTS);
5726 prop, "Translate Reports", "Translate additional information, such as error messages");
5727 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5728
5729 prop = RNA_def_property(srna, "use_translate_new_dataname", PROP_BOOLEAN, PROP_NONE);
5730 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_NEWDATANAME);
5732 "Translate New Names",
5733 "Translate the names of new data-blocks (objects, materials...)");
5734 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5735
5736 prop = RNA_def_property(srna, "date_format", PROP_ENUM, PROP_NONE);
5738 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_userdef_date_format_itemf");
5739 RNA_def_property_ui_text(prop, "Date Format", "Format for displaying date strings");
5740 RNA_def_property_update(prop, 0, "rna_userdef_language_update");
5741
5742 static const EnumPropertyItem rna_enum_time_format_items[] = {
5744 "H24",
5745 0,
5746 "24-Hour (23:59)",
5747 "Time format: 24-hour clock with colon, eg: 23:59"},
5749 "H12",
5750 0,
5751 "12-Hour (11:59 PM)",
5752 "Time format: 12-hour clock, eg: 11:59 PM"},
5753 {0, nullptr, 0, nullptr, nullptr},
5754 };
5755
5756 prop = RNA_def_property(srna, "time_format", PROP_ENUM, PROP_NONE);
5757 RNA_def_property_enum_items(prop, rna_enum_time_format_items);
5758 RNA_def_property_ui_text(prop, "Time Format", "Format for displaying time strings");
5759 RNA_def_property_update(prop, 0, "rna_userdef_language_update");
5760
5761 /* Status-bar. */
5762
5763 prop = RNA_def_property(srna, "show_statusbar_memory", PROP_BOOLEAN, PROP_NONE);
5764 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_MEMORY);
5765 RNA_def_property_ui_text(prop, "Show Memory", "Show Blender memory usage");
5766 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5767
5768 prop = RNA_def_property(srna, "show_statusbar_vram", PROP_BOOLEAN, PROP_NONE);
5769 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_VRAM);
5770 RNA_def_property_ui_text(prop, "Show VRAM", "Show GPU video memory usage");
5771 RNA_def_property_editable_func(prop, "rna_show_statusbar_vram_editable");
5772 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5773
5774 prop = RNA_def_property(srna, "show_statusbar_version", PROP_BOOLEAN, PROP_NONE);
5775 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_VERSION);
5776 RNA_def_property_ui_text(prop, "Show Version", "Show Blender version string");
5777 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5778
5779 prop = RNA_def_property(srna, "show_statusbar_stats", PROP_BOOLEAN, PROP_NONE);
5780 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_STATS);
5781 RNA_def_property_ui_text(prop, "Show Statistics", "Show scene statistics");
5782 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5783
5784 prop = RNA_def_property(srna, "show_statusbar_scene_duration", PROP_BOOLEAN, PROP_NONE);
5785 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_SCENE_DURATION);
5786 RNA_def_property_ui_text(prop, "Show Scene Duration", "Show scene duration");
5787 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5788
5789 prop = RNA_def_property(srna, "show_extensions_updates", PROP_BOOLEAN, PROP_NONE);
5791 prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_EXTENSIONS_UPDATES);
5792 RNA_def_property_ui_text(prop, "Extensions Updates", "Show Extensions Update Count");
5793 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5794
5795 /* Accessibility. */
5796 prop = RNA_def_property(srna, "use_reduce_motion", PROP_BOOLEAN, PROP_NONE);
5797 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_REDUCE_MOTION);
5799 prop, "Reduce Motion", "Avoid animations and other motion effects in the interface");
5800 RNA_def_property_update(prop, 0, "rna_userdef_update");
5801}
5802
5804{
5805 PropertyRNA *prop;
5806 StructRNA *srna;
5807
5808 static const EnumPropertyItem auto_key_modes[] = {
5809 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
5810 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
5811 {0, nullptr, 0, nullptr, nullptr},
5812 };
5813
5814 static const EnumPropertyItem material_link_items[] = {
5815 {0,
5816 "OBDATA",
5817 0,
5818 "Object Data",
5819 "Toggle whether the material is linked to object data or the object block"},
5821 "OBJECT",
5822 0,
5823 "Object",
5824 "Toggle whether the material is linked to object data or the object block"},
5825 {0, nullptr, 0, nullptr, nullptr},
5826 };
5827
5828 static const EnumPropertyItem object_align_items[] = {
5829 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
5831 "VIEW",
5832 0,
5833 "View",
5834 "Align newly added objects to the active 3D view orientation"},
5836 "CURSOR",
5837 0,
5838 "3D Cursor",
5839 "Align newly added objects to the 3D Cursor's rotation"},
5840 {0, nullptr, 0, nullptr, nullptr},
5841 };
5842
5843 srna = RNA_def_struct(brna, "PreferencesEdit", nullptr);
5844 RNA_def_struct_sdna(srna, "UserDef");
5845 RNA_def_struct_nested(brna, srna, "Preferences");
5846 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
5847
5848 /* Edit Methods */
5849
5850 prop = RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
5851 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
5852 RNA_def_property_enum_items(prop, material_link_items);
5854 prop,
5855 "Material Link To",
5856 "Toggle whether the material is linked to object data or the object block");
5857
5858 prop = RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
5859 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
5860 RNA_def_property_enum_items(prop, object_align_items);
5862 prop, "Align Object To", "The default alignment for objects added from a 3D viewport menu");
5863
5864 prop = RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
5865 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_ADD_EDITMODE);
5867 prop, "Enter Edit Mode", "Enter edit mode automatically after adding a new object");
5868
5869 prop = RNA_def_property(srna, "collection_instance_empty_size", PROP_FLOAT, PROP_NONE);
5870 RNA_def_property_range(prop, 0.001f, FLT_MAX);
5872 "Collection Instance Empty Size",
5873 "Display size of the empty when new collection instances are created");
5874
5875 /* Text Editor */
5876
5877 prop = RNA_def_property(srna, "use_text_edit_auto_close", PROP_BOOLEAN, PROP_NONE);
5878 RNA_def_property_boolean_sdna(prop, nullptr, "text_flag", USER_TEXT_EDIT_AUTO_CLOSE);
5880 prop,
5881 "Auto Close Character Pairs",
5882 "Automatically close relevant character pairs when typing in the text editor");
5884
5885 /* Undo */
5886
5887 prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
5888 RNA_def_property_int_sdna(prop, nullptr, "undosteps");
5889 RNA_def_property_range(prop, 0, 256);
5890 RNA_def_property_int_funcs(prop, nullptr, "rna_userdef_undo_steps_set", nullptr);
5892 prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
5893
5894 prop = RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
5895 RNA_def_property_int_sdna(prop, nullptr, "undomemory");
5898 prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
5899
5900 prop = RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
5901 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_GLOBALUNDO);
5903 prop,
5904 "Global Undo",
5905 "Global undo works by keeping a full copy of the file itself in memory, "
5906 "so takes extra memory");
5907
5908 /* auto keyframing */
5909 prop = RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
5910 RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
5912 "Auto Keying Enable",
5913 "Automatic keyframe insertion for Objects and Bones "
5914 "(default setting used for new Scenes)");
5915
5916 prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
5917 RNA_def_property_enum_items(prop, auto_key_modes);
5919 prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", nullptr);
5921 "Auto Keying Mode",
5922 "Mode of automatic keyframe insertion for Objects and Bones "
5923 "(default setting used for new Scenes)");
5924
5925 prop = RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
5926 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_INSERTAVAILABLE);
5928 "Auto Keyframe Insert Available",
5929 "Insert Keyframes only for properties that are already animated");
5930
5931 prop = RNA_def_property(srna, "use_auto_keying_warning", PROP_BOOLEAN, PROP_NONE);
5934 prop,
5935 "Show Auto Keying Warning",
5936 "Show warning indicators when transforming objects and bones if auto keying is enabled");
5937
5938 /* keyframing settings */
5939 prop = RNA_def_property(srna, "key_insert_channels", PROP_ENUM, PROP_NONE);
5941 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "key_insert_channels");
5944 "Default Key Channels",
5945 "Which channels to insert keys at when no keying set is active");
5950
5951 prop = RNA_def_property(srna, "use_auto_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
5952 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_INSERTNEEDED);
5954 "Autokey Insert Needed",
5955 "Auto-Keying will skip inserting keys that don't affect the animation");
5956
5957 prop = RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
5958 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", MANUALKEY_FLAG_INSERTNEEDED);
5960 prop,
5961 "Keyframe Insert Needed",
5962 "When keying manually, skip inserting keys that don't affect the animation");
5963
5964 prop = RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
5965 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_VISUALKEY);
5967 prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
5968
5969 prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
5970 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_XYZ2RGB);
5972 prop,
5973 "New F-Curve Colors - XYZ to RGB",
5974 "Color for newly added transformation F-Curves (Location, Rotation, Scale) "
5975 "and also Color is based on the transform axis");
5976
5977 prop = RNA_def_property(srna, "use_anim_channel_group_colors", PROP_BOOLEAN, PROP_NONE);
5979 prop, nullptr, "animation_flag", USER_ANIM_SHOW_CHANNEL_GROUP_COLORS);
5981 prop,
5982 "Channel Group Colors",
5983 "Use animation channel group colors; generally this is used to show bone group colors");
5984 RNA_def_property_update(prop, 0, "rna_userdef_anim_update");
5985
5986 prop = RNA_def_property(srna, "fcurve_new_auto_smoothing", PROP_ENUM, PROP_NONE);
5988 RNA_def_property_enum_sdna(prop, nullptr, "auto_smoothing_new");
5990 "New Curve Smoothing Mode",
5991 "Auto Handle Smoothing mode used for newly added F-Curves");
5992
5993 prop = RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
5995 RNA_def_property_enum_sdna(prop, nullptr, "ipo_new");
5997 "New Interpolation Type",
5998 "Interpolation mode used for first keyframe on newly added F-Curves "
5999 "(subsequent keyframes take interpolation from preceding keyframe)");
6001
6002 prop = RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
6004 RNA_def_property_enum_sdna(prop, nullptr, "keyhandles_new");
6006 RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes");
6007
6008 /* frame numbers */
6009 prop = RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
6012 "Allow Negative Frames",
6013 "Current frame number can be manually set to a negative value");
6014
6015 /* fcurve opacity */
6016 prop = RNA_def_property(srna, "fcurve_unselected_alpha", PROP_FLOAT, PROP_FACTOR);
6017 RNA_def_property_float_sdna(prop, nullptr, "fcu_inactive_alpha");
6018 RNA_def_property_range(prop, 0.001f, 1.0f);
6020 "Unselected F-Curve Opacity",
6021 "The opacity of unselected F-Curves against the "
6022 "background of the Graph Editor");
6023 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_userdef_update");
6024
6025 /* FCurve keyframe visibility. */
6026 prop = RNA_def_property(srna, "show_only_selected_curve_keyframes", PROP_BOOLEAN, PROP_NONE);
6028 prop, nullptr, "animation_flag", USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS);
6030 "Only Show Selected F-Curve Keyframes",
6031 "Only keyframes of selected F-Curves are visible and editable");
6032 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_userdef_update");
6033
6034 /* Graph Editor line drawing quality. */
6035 prop = RNA_def_property(srna, "use_fcurve_high_quality_drawing", PROP_BOOLEAN, PROP_NONE);
6036 RNA_def_property_boolean_sdna(prop, nullptr, "animation_flag", USER_ANIM_HIGH_QUALITY_DRAWING);
6038 "F-Curve High Quality Drawing",
6039 "Draw F-Curves using Anti-Aliasing (disable for better performance)");
6040 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_userdef_update");
6041
6042 /* grease pencil */
6043 prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_PIXEL);
6044 RNA_def_property_int_sdna(prop, nullptr, "gp_manhattandist");
6045 RNA_def_property_range(prop, 0, 100);
6047 "Grease Pencil Manhattan Distance",
6048 "Pixels moved by mouse per axis when drawing stroke");
6049
6050 prop = RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_PIXEL);
6051 RNA_def_property_int_sdna(prop, nullptr, "gp_euclideandist");
6052 RNA_def_property_range(prop, 0, 100);
6054 "Grease Pencil Euclidean Distance",
6055 "Distance moved by mouse when drawing stroke to include");
6056
6057 prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_PIXEL);
6058 RNA_def_property_int_sdna(prop, nullptr, "gp_eraser");
6059 RNA_def_property_range(prop, 1, 500);
6060 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
6061
6062 prop = RNA_def_property(srna, "grease_pencil_default_color", PROP_FLOAT, PROP_COLOR_GAMMA);
6063 RNA_def_property_float_sdna(prop, nullptr, "gpencil_new_layer_col");
6064 RNA_def_property_array(prop, 4);
6065 RNA_def_property_ui_text(prop, "Annotation Default Color", "Color of new annotation layers");
6066
6067 /* sculpt and paint */
6068
6069 prop = RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
6070 RNA_def_property_float_sdna(prop, nullptr, "sculpt_paint_overlay_col");
6071 RNA_def_property_array(prop, 3);
6072 RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
6073
6074 /* VSE */
6075 prop = RNA_def_property(srna, "connect_strips_by_default", PROP_BOOLEAN, PROP_NONE);
6077 prop, nullptr, "sequencer_editor_flag", USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT);
6079 prop,
6080 "Connect Movie Strips by Default",
6081 "Connect newly added movie strips by default if they have multiple channels");
6082
6083 prop = RNA_def_property(srna, "clamp_strips_by_default", PROP_BOOLEAN, PROP_NONE);
6085 prop, nullptr, "sequencer_editor_flag", USER_SEQ_ED_CLAMP_STRIPS_BY_DEFAULT);
6087 prop,
6088 "Clamp Strips by Default",
6089 "When slipping or adjusting handles, clamp movement to the underlying content bounds by "
6090 "default to avoid producing extra hold frames or silence");
6091
6092 prop = RNA_def_property(srna, "default_strip_length", PROP_FLOAT, PROP_TIME_ABSOLUTE);
6093 RNA_def_property_float_sdna(prop, nullptr, "sequencer_default_strip_length");
6094 RNA_def_property_range(prop, 0.0f, 36000.0f);
6095 RNA_def_property_ui_range(prop, 0.1f, 360.0f, 10.0f, 3);
6097 prop,
6098 "Default Strip Length",
6099 "Duration of newly added strips that have no inherent length, such as color, text and "
6100 "image strips");
6101
6102 /* duplication linking */
6103 prop = RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
6104 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_MESH);
6106 prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
6107
6108 prop = RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
6109 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_SURF);
6111 prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
6112
6113 prop = RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
6114 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_CURVE);
6116 prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
6117
6118 prop = RNA_def_property(srna, "use_duplicate_lattice", PROP_BOOLEAN, PROP_NONE);
6119 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_LATTICE);
6121 prop, "Duplicate Lattice", "Causes lattice data to be duplicated with the object");
6122
6123 prop = RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
6124 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_FONT);
6126 prop, "Duplicate Text", "Causes text data to be duplicated with the object");
6127
6128 prop = RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
6129 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_MBALL);
6131 prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
6132
6133 prop = RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
6134 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_ARM);
6136 prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
6137
6138 prop = RNA_def_property(srna, "use_duplicate_camera", PROP_BOOLEAN, PROP_NONE);
6139 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_CAMERA);
6141 prop, "Duplicate Camera", "Causes camera data to be duplicated with the object");
6142
6143 prop = RNA_def_property(srna, "use_duplicate_speaker", PROP_BOOLEAN, PROP_NONE);
6144 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_SPEAKER);
6146 prop, "Duplicate Speaker", "Causes speaker data to be duplicated with the object");
6147
6148 prop = RNA_def_property(srna, "use_duplicate_light", PROP_BOOLEAN, PROP_NONE);
6149 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_LAMP);
6151 prop, "Duplicate Light", "Causes light data to be duplicated with the object");
6152
6153 prop = RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
6154 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_MAT);
6156 prop, "Duplicate Material", "Causes material data to be duplicated with the object");
6157
6158 /* Not implemented, keep because this is useful functionality. */
6159# if 0
6160 prop = RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
6161 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_TEX);
6163 prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
6164
6165 prop = RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
6166 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_FCURVE);
6168 prop, "Duplicate F-Curve", "Causes F-Curve data to be duplicated with the object");
6169# endif
6170
6171 prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
6172 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_ACT);
6174 prop, "Duplicate Action", "Causes actions to be duplicated with the data-blocks");
6175
6176 prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
6177 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_PSYS);
6179 prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
6180
6181 prop = RNA_def_property(srna, "use_duplicate_lightprobe", PROP_BOOLEAN, PROP_NONE);
6182 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_LIGHTPROBE);
6184 prop, "Duplicate Light Probe", "Causes light probe data to be duplicated with the object");
6185
6186 prop = RNA_def_property(srna, "use_duplicate_grease_pencil", PROP_BOOLEAN, PROP_NONE);
6187 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_GPENCIL);
6189 "Duplicate Grease Pencil",
6190 "Causes Grease Pencil data to be duplicated with the object");
6191
6192 prop = RNA_def_property(srna, "use_duplicate_curves", PROP_BOOLEAN, PROP_NONE);
6193 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_CURVES);
6195 prop, "Duplicate Curves", "Causes curves data to be duplicated with the object");
6196
6197 prop = RNA_def_property(srna, "use_duplicate_pointcloud", PROP_BOOLEAN, PROP_NONE);
6198 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_POINTCLOUD);
6200 prop, "Duplicate Point Cloud", "Causes point cloud data to be duplicated with the object");
6201
6202 prop = RNA_def_property(srna, "use_duplicate_volume", PROP_BOOLEAN, PROP_NONE);
6203 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_VOLUME);
6205 prop, "Duplicate Volume", "Causes volume data to be duplicated with the object");
6206
6207 prop = RNA_def_property(srna, "use_duplicate_node_tree", PROP_BOOLEAN, PROP_NONE);
6208 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_NTREE);
6210 "Duplicate Node Tree",
6211 "Make copies of node groups when duplicating nodes in the node editor");
6212
6213 prop = RNA_def_property(srna, "node_use_insert_offset", PROP_BOOLEAN, PROP_NONE);
6214 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_OFFSET);
6216 "Auto-offset",
6217 "Automatically offset the following or previous nodes in a "
6218 "chain when inserting a new node");
6219
6220 /* Currently only used for insert offset (aka auto-offset),
6221 * maybe also be useful for later stuff though. */
6222 prop = RNA_def_property(srna, "node_margin", PROP_INT, PROP_PIXEL);
6223 RNA_def_property_int_sdna(prop, nullptr, "node_margin");
6225 prop, "Auto-offset Margin", "Minimum distance between nodes for Auto-offsetting nodes");
6226 RNA_def_property_update(prop, 0, "rna_userdef_update");
6227
6228 prop = RNA_def_property(srna, "node_preview_resolution", PROP_INT, PROP_PIXEL);
6229 RNA_def_property_int_sdna(prop, nullptr, "node_preview_res");
6230 RNA_def_property_range(prop, 50, 250);
6232 "Node Preview Resolution",
6233 "Resolution used for Shader node previews (should be changed for "
6234 "performance convenience)");
6235 RNA_def_property_update(prop, 0, "rna_userdef_update");
6236
6237 /* cursor */
6238 prop = RNA_def_property(srna, "use_cursor_lock_adjust", PROP_BOOLEAN, PROP_NONE);
6241 prop,
6242 "Cursor Lock Adjust",
6243 "Place the cursor without 'jumping' to the new location (when lock-to-cursor is used)");
6244
6245 prop = RNA_def_property(srna, "use_mouse_depth_cursor", PROP_BOOLEAN, PROP_NONE);
6246 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DEPTH_CURSOR);
6248 prop, "Cursor Surface Project", "Use the surface depth for cursor placement");
6249}
6250
6252{
6253 PropertyRNA *prop;
6254 StructRNA *srna;
6255
6256 static const EnumPropertyItem gl_texture_clamp_items[] = {
6257 {0, "CLAMP_OFF", 0, "Off", ""},
6258 {8192, "CLAMP_8192", 0, "8192", ""},
6259 {4096, "CLAMP_4096", 0, "4096", ""},
6260 {2048, "CLAMP_2048", 0, "2048", ""},
6261 {1024, "CLAMP_1024", 0, "1024", ""},
6262 {512, "CLAMP_512", 0, "512", ""},
6263 {256, "CLAMP_256", 0, "256", ""},
6264 {128, "CLAMP_128", 0, "128", ""},
6265 {0, nullptr, 0, nullptr, nullptr},
6266 };
6267
6268 static const EnumPropertyItem anisotropic_items[] = {
6269 {1, "FILTER_0", 0, "Off", ""},
6270 {2, "FILTER_2", 0, "2" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
6271 {4, "FILTER_4", 0, "4" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
6272 {8, "FILTER_8", 0, "8" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
6273 {16, "FILTER_16", 0, "16" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
6274 {0, nullptr, 0, nullptr, nullptr},
6275 };
6276
6277 static const EnumPropertyItem audio_mixing_samples_items[] = {
6278 {256, "SAMPLES_256", 0, "256 Samples", "Set audio mixing buffer size to 256 samples"},
6279 {512, "SAMPLES_512", 0, "512 Samples", "Set audio mixing buffer size to 512 samples"},
6280 {1024, "SAMPLES_1024", 0, "1024 Samples", "Set audio mixing buffer size to 1024 samples"},
6281 {2048, "SAMPLES_2048", 0, "2048 Samples", "Set audio mixing buffer size to 2048 samples"},
6282 {4096, "SAMPLES_4096", 0, "4096 Samples", "Set audio mixing buffer size to 4096 samples"},
6283 {8192, "SAMPLES_8192", 0, "8192 Samples", "Set audio mixing buffer size to 8192 samples"},
6284 {16384,
6285 "SAMPLES_16384",
6286 0,
6287 "16384 Samples",
6288 "Set audio mixing buffer size to 16384 samples"},
6289 {32768,
6290 "SAMPLES_32768",
6291 0,
6292 "32768 Samples",
6293 "Set audio mixing buffer size to 32768 samples"},
6294 {0, nullptr, 0, nullptr, nullptr},
6295 };
6296
6297 static const EnumPropertyItem audio_rate_items[] = {
6298# if 0
6299 {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
6300 {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
6301 {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
6302 {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
6303 {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
6304# endif
6305 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
6306 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
6307# if 0
6308 {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
6309# endif
6310 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
6311 {192000,
6312 "RATE_192000",
6313 0,
6314 "192 kHz",
6315 "Set audio sampling rate to 192000 samples per second"},
6316 {0, nullptr, 0, nullptr, nullptr},
6317 };
6318
6319 static const EnumPropertyItem audio_format_items[] = {
6320 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8-bit unsigned integer"},
6321 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16-bit signed integer"},
6322 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24-bit signed integer"},
6323 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32-bit signed integer"},
6324 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32-bit float"},
6325 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64-bit float"},
6326 {0, nullptr, 0, nullptr, nullptr},
6327 };
6328
6329 static const EnumPropertyItem audio_channel_items[] = {
6330 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
6331 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
6332 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
6333 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
6334 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
6335 {0, nullptr, 0, nullptr, nullptr},
6336 };
6337
6338 static const EnumPropertyItem seq_proxy_setup_options[] = {
6339 {USER_SEQ_PROXY_SETUP_MANUAL, "MANUAL", 0, "Manual", "Set up proxies manually"},
6341 "AUTOMATIC",
6342 0,
6343 "Automatic",
6344 "Build proxies for added movie and image strips in each preview size"},
6345 {0, nullptr, 0, nullptr, nullptr},
6346 };
6347
6348 srna = RNA_def_struct(brna, "PreferencesSystem", nullptr);
6349 RNA_def_struct_sdna(srna, "UserDef");
6350 RNA_def_struct_nested(brna, srna, "Preferences");
6351 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
6352
6353 /* UI settings. */
6354
6355 prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_NONE);
6357 RNA_def_property_float_sdna(prop, nullptr, "scale_factor");
6359 prop,
6360 "UI Scale",
6361 "Size multiplier to use when displaying custom user interface elements, so that "
6362 "they are scaled correctly on screens with different DPI. This value is based "
6363 "on operating system DPI settings and Blender display scale.");
6364
6365 prop = RNA_def_property(srna, "ui_line_width", PROP_FLOAT, PROP_NONE);
6367 RNA_def_property_float_sdna(prop, nullptr, "pixelsize");
6369 prop,
6370 "UI Line Width",
6371 "Suggested line thickness and point size in pixels, for add-ons displaying custom "
6372 "user interface elements, based on operating system settings and Blender UI scale");
6373
6374 prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
6376
6377 prop = RNA_def_property(srna, "pixel_size", PROP_FLOAT, PROP_NONE);
6379 RNA_def_property_float_sdna(prop, nullptr, "pixelsize");
6380
6381 /* Memory */
6382
6383 prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
6384 RNA_def_property_int_sdna(prop, nullptr, "memcachelimit");
6386 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit (in megabytes)");
6387 RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
6388
6389 /* Nodes. */
6390
6391 prop = RNA_def_property(srna, "nodes_stack_limit", PROP_INT, PROP_NONE);
6394 prop,
6395 "Nodes Stack Limit",
6396 "Approximate maximum size of the call stack used by node group evaluation. "
6397 "For example, this corresponds to the number of allowed nested node "
6398 "groups. Setting this too high can result in crashes caused by "
6399 "running out of stack memory.");
6400 RNA_def_property_update(prop, 0, "rna_userdef_update");
6401
6402 /* Sequencer proxy setup */
6403
6404 prop = RNA_def_property(srna, "sequencer_proxy_setup", PROP_ENUM, PROP_NONE);
6405 RNA_def_property_enum_items(prop, seq_proxy_setup_options);
6406 RNA_def_property_enum_sdna(prop, nullptr, "sequencer_proxy_setup");
6407 RNA_def_property_ui_text(prop, "Proxy Setup", "When and how proxies are created");
6408
6409 /* Video hardware acceleration */
6410 prop = RNA_def_property(srna, "use_hardware_video_decoding", PROP_BOOLEAN, PROP_NONE);
6413 "Hardware Video Decoding",
6414 "Use the GPU to decode videos when supported. Videos that are already "
6415 "open are not affected");
6416
6417 prop = RNA_def_property(srna, "video_decoding_device", PROP_ENUM, PROP_NONE);
6418 RNA_def_property_enum_sdna(prop, nullptr, "video_decoding_device");
6421 prop, nullptr, nullptr, "rna_preference_video_decoding_device_itemf");
6423 "Video Decoding Device",
6424 "Force a specific hardware device to decode videos with. Videos that "
6425 "are already open are not affected");
6426
6427 prop = RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
6428 RNA_def_property_int_sdna(prop, nullptr, "scrollback");
6429 RNA_def_property_range(prop, 32, 32768);
6431 prop, "Scrollback", "Maximum number of lines to store for the console buffer");
6432
6433 /* OpenGL */
6434
6435 /* Viewport anti-aliasing */
6436 prop = RNA_def_property(srna, "use_overlay_smooth_wire", PROP_BOOLEAN, PROP_NONE);
6439 prop, "Overlay Smooth Wires", "Enable overlay smooth wires, reducing aliasing");
6440 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6441
6442 prop = RNA_def_property(srna, "use_edit_mode_smooth_wire", PROP_BOOLEAN, PROP_NONE);
6444 prop, nullptr, "gpu_flag", USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE);
6446 prop,
6447 "Edit Mode Smooth Wires",
6448 "Enable edit mode edge smoothing, reducing aliasing (requires restart)");
6449 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6450
6451 prop = RNA_def_property(srna, "use_rt_shadows", PROP_BOOLEAN, PROP_NONE);
6454 prop,
6455 "Raytraced Shadows",
6456 "Enable raytraced shadows. Requires Vulkan and a GPU with hardware raytracing support");
6457 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6458
6459 prop = RNA_def_property(srna, "use_region_overlap", PROP_BOOLEAN, PROP_NONE);
6460 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag2", USER_REGION_OVERLAP);
6462 prop, "Region Overlap", "Display tool/property regions over the main region");
6463 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6464
6465 prop = RNA_def_property(srna, "show_panel_tabs_compact", PROP_BOOLEAN, PROP_NONE);
6468 prop,
6469 "Compact Sidebar Tabs",
6470 "Display sidebar tabs in a compact size that shows icons when available");
6471 RNA_def_property_update(prop, 0, "rna_userdef_update_compact_tabs");
6472
6473 prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
6476 prop, "Viewport Anti-Aliasing", "Method of anti-aliasing in 3d viewport");
6478 RNA_def_property_update(prop, 0, "rna_userdef_update");
6479
6480 prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
6481 RNA_def_property_collection_sdna(prop, nullptr, "light_param", "");
6482 RNA_def_property_struct_type(prop, "UserSolidLight");
6484 prop, "Solid Lights", "Lights used to display objects in solid shading mode");
6485
6486 prop = RNA_def_property(srna, "light_ambient", PROP_FLOAT, PROP_COLOR);
6487 RNA_def_property_float_sdna(prop, nullptr, "light_ambient");
6488 RNA_def_property_array(prop, 3);
6490 prop, "Ambient Color", "Color of the ambient light that uniformly lit the scene");
6491 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
6492
6493 prop = RNA_def_property(srna, "use_studio_light_edit", PROP_BOOLEAN, PROP_NONE);
6494 RNA_def_property_boolean_sdna(prop, nullptr, "edit_studio_light", 1);
6496 prop, "Edit Studio Light", "View the result of the studio light editor in the viewport");
6497 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
6498
6499 prop = RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_FACTOR);
6500 RNA_def_property_float_sdna(prop, nullptr, "glalphaclip");
6501 RNA_def_property_range(prop, 0.0f, 1.0f);
6503 prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
6504 RNA_def_property_update(prop, 0, "rna_userdef_update");
6505
6506 /* Textures */
6507
6508 prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
6509 RNA_def_property_enum_sdna(prop, nullptr, "anisotropic_filter");
6510 RNA_def_property_enum_items(prop, anisotropic_items);
6511 RNA_def_property_ui_text(prop, "Anisotropic Filtering", "Quality of anisotropic filtering");
6512 RNA_def_property_update(prop, 0, "rna_userdef_update");
6513
6514 prop = RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
6515 RNA_def_property_enum_sdna(prop, nullptr, "glreslimit");
6516 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
6518 prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
6519 RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
6520
6521 prop = RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
6522 RNA_def_property_int_sdna(prop, nullptr, "textimeout");
6523 RNA_def_property_range(prop, 0, 3600);
6525 prop,
6526 "Texture Time Out",
6527 "Time since last access of a GL texture in seconds after which it is freed "
6528 "(set to 0 to keep textures allocated)");
6529
6530 prop = RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
6531 RNA_def_property_int_sdna(prop, nullptr, "texcollectrate");
6532 RNA_def_property_range(prop, 1, 3600);
6534 prop,
6535 "Texture Collection Rate",
6536 "Number of seconds between each run of the GL texture garbage collector");
6537
6538 prop = RNA_def_property(srna, "vbo_time_out", PROP_INT, PROP_NONE);
6539 RNA_def_property_int_sdna(prop, nullptr, "vbotimeout");
6540 RNA_def_property_range(prop, 0, 3600);
6542 prop,
6543 "VBO Time Out",
6544 "Time since last access of a GL vertex buffer object in seconds after which it is freed "
6545 "(set to 0 to keep VBO allocated)");
6546
6547 prop = RNA_def_property(srna, "vbo_collection_rate", PROP_INT, PROP_NONE);
6548 RNA_def_property_int_sdna(prop, nullptr, "vbocollectrate");
6549 RNA_def_property_range(prop, 1, 3600);
6551 prop,
6552 "VBO Collection Rate",
6553 "Number of seconds between each run of the GL vertex buffer object garbage collector");
6554
6555 /* GPU subdivision evaluation. */
6556
6557 prop = RNA_def_property(srna, "use_gpu_subdivision", PROP_BOOLEAN, PROP_NONE);
6560 "GPU Subdivision",
6561 "Enable GPU acceleration for evaluating the last subdivision surface "
6562 "modifiers in the stack");
6563 RNA_def_property_update(prop, 0, "rna_UserDef_subdivision_update");
6564
6565 /* GPU backend selection */
6566 prop = RNA_def_property(srna, "gpu_backend", PROP_ENUM, PROP_NONE);
6567 RNA_def_property_enum_sdna(prop, nullptr, "gpu_backend");
6569 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_preference_gpu_backend_itemf");
6571 prop,
6572 "GPU Backend",
6573 "GPU backend to use (requires restarting Blender for changes to take effect)");
6574
6575 prop = RNA_def_property(srna, "gpu_preferred_device", PROP_ENUM, PROP_NONE);
6578 "rna_preference_gpu_preferred_device_get",
6579 "rna_preference_gpu_preferred_device_set",
6580 "rna_preference_gpu_preferred_device_itemf");
6583 "Device",
6584 "Preferred device to select during detection (requires restarting "
6585 "Blender for changes to take effect)");
6586
6587 prop = RNA_def_property(srna, "gpu_shader_workers", PROP_INT, PROP_NONE);
6588 RNA_def_property_range(prop, 0, 32);
6590 "Shader Compilation Workers",
6591 "Number of shader compilation threads or subprocesses, "
6592 "clamped at the max threads supported by the CPU "
6593 "(requires restarting Blender for changes to take effect). "
6594 "A higher number increases the RAM usage while reducing "
6595 "compilation time. A value of 0 will use automatic configuration. "
6596 "(OpenGL only)");
6597
6598 static const EnumPropertyItem shader_compilation_method_items[] = {
6599 {USER_SHADER_COMPILE_THREAD, "THREAD", 0, "Thread", "Use threads for compiling shaders"},
6601 "SUBPROCESS",
6602 0,
6603 "Subprocess",
6604 "Use subprocesses for compiling shaders"},
6605 {0, nullptr, 0, nullptr, nullptr},
6606 };
6607
6608 prop = RNA_def_property(srna, "shader_compilation_method", PROP_ENUM, PROP_NONE);
6609 RNA_def_property_enum_items(prop, shader_compilation_method_items);
6611 "Shader Compilation Method",
6612 "Compilation method used for compiling shaders in parallel. "
6613 "Subprocess requires a lot more RAM for each worker "
6614 "but might compile shaders faster on some systems. "
6615 "Requires restarting Blender for changes to take effect. "
6616 "(OpenGL only)");
6617
6618 /* Network. */
6619
6620 prop = RNA_def_property(srna, "use_online_access", PROP_BOOLEAN, PROP_NONE);
6621 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_INTERNET_ALLOW);
6622 RNA_def_property_boolean_funcs(prop, nullptr, "rna_userdef_use_online_access_set");
6624 "Allow Online Access",
6625 "Allow Blender to access the internet. Add-ons that follow this "
6626 "setting will only connect to the internet if enabled. However, "
6627 "Blender cannot prevent third-party add-ons from violating this rule.");
6628 RNA_def_property_editable_func(prop, "rna_userdef_use_online_access_editable");
6629 RNA_def_property_update(prop, 0, "rna_userdef_update");
6630
6631 prop = RNA_def_property(srna, "network_timeout", PROP_INT, PROP_UNSIGNED);
6632 RNA_def_property_int_sdna(prop, nullptr, "network_timeout");
6634 prop,
6635 "Network Timeout",
6636 "The time in seconds to wait for online operations before a connection may "
6637 "fail with a time-out error. Zero uses the systems default.");
6638
6639 prop = RNA_def_property(srna, "network_connection_limit", PROP_INT, PROP_UNSIGNED);
6640 RNA_def_property_int_sdna(prop, nullptr, "network_connection_limit");
6642 prop,
6643 "Network Connection Limit",
6644 "Limit the number of simultaneous internet connections online operations may make at once. "
6645 "Zero disables the limit.");
6646
6647 /* Audio */
6648
6649 prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
6650 RNA_def_property_enum_sdna(prop, nullptr, "mixbufsize");
6651 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
6653 prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer");
6655 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6656
6657 prop = RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
6658 RNA_def_property_enum_sdna(prop, nullptr, "audiodevice");
6660 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_userdef_audio_device_itemf");
6661 RNA_def_property_ui_text(prop, "Audio Device", "Audio output device");
6663 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6664
6665 prop = RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
6666 RNA_def_property_enum_sdna(prop, nullptr, "audiorate");
6667 RNA_def_property_enum_items(prop, audio_rate_items);
6668 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Audio sample rate");
6670 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6671
6672 prop = RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
6673 RNA_def_property_enum_sdna(prop, nullptr, "audioformat");
6674 RNA_def_property_enum_items(prop, audio_format_items);
6675 RNA_def_property_ui_text(prop, "Audio Sample Format", "Audio sample format");
6677 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6678
6679 prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
6680 RNA_def_property_enum_sdna(prop, nullptr, "audiochannels");
6681 RNA_def_property_enum_items(prop, audio_channel_items);
6682 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
6684 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6685
6686# ifdef WITH_CYCLES
6687 prop = RNA_def_property(srna, "legacy_compute_device_type", PROP_INT, PROP_NONE);
6688 RNA_def_property_int_sdna(prop, nullptr, "compute_device_type");
6691 RNA_def_property_ui_text(prop, "Legacy Compute Device Type", "For backwards compatibility only");
6692# endif
6693
6694 /* Registration and Unregistration */
6695
6696 prop = RNA_def_property(srna, "register_all_users", PROP_BOOLEAN, PROP_NONE);
6699 prop,
6700 "Register for All Users",
6701 "Make this Blender version open blend files for all users. Requires elevated privileges.");
6702
6703 prop = RNA_def_boolean(
6704 srna,
6705 "is_microsoft_store_install",
6706 false,
6707 "Is Microsoft Store Install",
6708 "Whether this blender installation is a sandboxed Microsoft Store version");
6709 RNA_def_property_boolean_funcs(prop, "rna_userdef_is_microsoft_store_install_get", nullptr);
6711}
6712
6714{
6715 PropertyRNA *prop;
6716 StructRNA *srna;
6717
6718 static const EnumPropertyItem view_rotation_items[] = {
6719 {0, "TURNTABLE", 0, "Turntable", "Turntable keeps the Z-axis upright while orbiting"},
6721 "TRACKBALL",
6722 0,
6723 "Trackball",
6724 "Trackball allows you to tumble your view at any angle"},
6725 {0, nullptr, 0, nullptr, nullptr},
6726 };
6727
6728# ifdef WITH_INPUT_NDOF
6729 static const EnumPropertyItem ndof_view_navigation_items[] = {
6731 "OBJECT",
6732 0,
6733 "Object",
6734 "This mode is like reaching into the screen and holding the model in your hand. "
6735 "Push the 3D Mouse cap left, and the model moves left. Push right and the model "
6736 "moves right"},
6738 "FLY",
6739 0,
6740 "Fly",
6741 "Enables using the 3D Mouse as if it is a camera. "
6742 "Push into the scene and the camera moves forward into the scene. "
6743 "You are entering the scene as if flying around in it. "
6744 "This also inverts pan & zoom for 2D views"},
6746 "DRONE",
6747 0,
6748 "Drone",
6749 "Enables a Fly Mode navigation but pushing the cap forward "
6750 "while looking down will not change the altitude of the camera."},
6751 {0, nullptr, 0, nullptr, nullptr},
6752 };
6753
6754 static const EnumPropertyItem ndof_zoom_direction_items[] = {
6755 {0,
6756 "NDOF_ZOOM_FORWARD",
6757 0,
6758 "Forward/Backward",
6759 "Zoom by pulling the 3D Mouse cap upwards or pushing the cap downwards"},
6761 "NDOF_ZOOM_UP",
6762 0,
6763 "Up/Down",
6764 "Zoom by pulling the 3D Mouse cap upwards or pushing the cap downwards"},
6765 {0, nullptr, 0, nullptr, nullptr},
6766 };
6767# endif /* WITH_INPUT_NDOF */
6768
6769 static const EnumPropertyItem tablet_api[] = {
6771 "AUTOMATIC",
6772 0,
6773 "Automatic",
6774 "Automatically choose Wintab or Windows Ink depending on the device"},
6776 "WINDOWS_INK",
6777 0,
6778 "Windows Ink",
6779 "Use native Windows Ink API, for modern tablet and pen devices. Requires Windows 8 or "
6780 "newer."},
6782 "WINTAB",
6783 0,
6784 "Wintab",
6785 "Use Wintab driver for older tablets and Windows versions"},
6786 {0, nullptr, 0, nullptr, nullptr},
6787 };
6788
6789 static const EnumPropertyItem view_zoom_styles[] = {
6791 "CONTINUE",
6792 0,
6793 "Continue",
6794 "Continuous zooming. The zoom direction and speed depends on how far along the set Zoom "
6795 "Axis the mouse has moved."},
6797 "DOLLY",
6798 0,
6799 "Dolly",
6800 "Zoom in and out based on mouse movement along the set Zoom Axis"},
6802 "SCALE",
6803 0,
6804 "Scale",
6805 "Zoom in and out as if you are scaling the view, mouse movements relative to center"},
6806 {0, nullptr, 0, nullptr, nullptr},
6807 };
6808
6809 static const EnumPropertyItem view_zoom_axes[] = {
6810 {0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"},
6812 "HORIZONTAL",
6813 0,
6814 "Horizontal",
6815 "Zoom in and out based on horizontal mouse movement"},
6816 {0, nullptr, 0, nullptr, nullptr},
6817 };
6818
6819 srna = RNA_def_struct(brna, "PreferencesInput", nullptr);
6820 RNA_def_struct_sdna(srna, "UserDef");
6821 RNA_def_struct_nested(brna, srna, "Preferences");
6822 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
6823
6824 prop = RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
6825 RNA_def_property_enum_sdna(prop, nullptr, "viewzoom");
6826 RNA_def_property_enum_items(prop, view_zoom_styles);
6827 RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
6828
6829 prop = RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
6830 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "uiflag");
6831 RNA_def_property_enum_items(prop, view_zoom_axes);
6832 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
6833
6834 prop = RNA_def_property(srna, "use_multitouch_gestures", PROP_BOOLEAN, PROP_NONE);
6837 prop,
6838 "Multi-touch Gestures",
6839 "Use multi-touch gestures for navigation with touchpad, instead of scroll wheel emulation");
6840 RNA_def_property_update(prop, 0, "rna_userdef_input_devices");
6841
6842 prop = RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
6843 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_ZOOM_INVERT);
6845 prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
6846
6847 prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE);
6848 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DEPTH_NAVIGATE);
6850 prop,
6851 "Auto Depth",
6852 "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
6853
6854 /* view zoom */
6855 prop = RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
6856 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_ZOOM_TO_MOUSEPOS);
6858 "Zoom to Mouse Position",
6859 "Zoom in towards the mouse pointer's position in the 3D view, "
6860 "rather than the 2D window center");
6861
6862 /* view rotation */
6863 prop = RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
6864 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_AUTOPERSP);
6866 prop,
6867 "Auto Perspective",
6868 "Automatically switch between orthographic and perspective when changing "
6869 "from top/front/side views");
6870
6871 prop = RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
6872 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_ORBIT_SELECTION);
6874 "Orbit Around Selection",
6875 "Use the selection (or the last stroke center in Paint modes) as the "
6876 "pivot point for orbiting");
6877
6878 prop = RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
6879 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6880 RNA_def_property_enum_items(prop, view_rotation_items);
6881 RNA_def_property_ui_text(prop, "Orbit Method", "Orbit method in the viewport");
6882
6883 prop = RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
6884 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_CONTINUOUS_MOUSE);
6886 prop,
6887 "Continuous Grab",
6888 "Let the mouse wrap around the view boundaries so mouse movements are not limited by the "
6889 "screen size (used by transform, dragging of UI controls, etc.)");
6890
6891 prop = RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
6892 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_RELEASECONFIRM);
6894 "Release Confirms",
6895 "Moving things with a mouse drag confirms when releasing the button");
6896
6897 prop = RNA_def_property(srna, "use_numeric_input_advanced", PROP_BOOLEAN, PROP_NONE);
6900 "Default to Advanced Numeric Input",
6901 "When entering numbers while transforming, "
6902 "default to advanced mode for full math expression evaluation");
6903
6904 /* View Navigation */
6905 prop = RNA_def_property(srna, "navigation_mode", PROP_ENUM, PROP_NONE);
6906 RNA_def_property_enum_sdna(prop, nullptr, "navigation_mode");
6908 RNA_def_property_ui_text(prop, "View Navigation", "Which method to use for viewport navigation");
6909
6910 prop = RNA_def_property(srna, "walk_navigation", PROP_POINTER, PROP_NONE);
6911 RNA_def_property_pointer_sdna(prop, nullptr, "walk_navigation");
6913 RNA_def_property_struct_type(prop, "WalkNavigation");
6914 RNA_def_property_ui_text(prop, "Walk Navigation", "Settings for walk navigation mode");
6915
6916 prop = RNA_def_property(srna, "view_rotate_sensitivity_turntable", PROP_FLOAT, PROP_ANGLE);
6917 RNA_def_property_range(prop, DEG2RADF(0.001f), DEG2RADF(15.0f));
6918 RNA_def_property_ui_range(prop, DEG2RADF(0.001f), DEG2RADF(15.0f), 1.0f, 2);
6920 "Orbit Sensitivity",
6921 "Rotation amount per pixel to control how fast the viewport orbits");
6922
6923 prop = RNA_def_property(srna, "view_rotate_sensitivity_trackball", PROP_FLOAT, PROP_FACTOR);
6924 RNA_def_property_range(prop, 0.1f, 10.0f);
6925 RNA_def_property_ui_range(prop, 0.1f, 2.0f, 0.01f, 2);
6926 RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Scale trackball orbit sensitivity");
6927
6928 /* Click-drag threshold for tablet & mouse. */
6929 prop = RNA_def_property(srna, "drag_threshold_mouse", PROP_INT, PROP_PIXEL);
6930 RNA_def_property_range(prop, 1, 255);
6932 "Mouse Drag Threshold",
6933 "Number of pixels to drag before a drag event is triggered "
6934 "for mouse/trackpad input "
6935 "(otherwise click events are detected)");
6936 RNA_def_property_update(prop, 0, "rna_userdef_window_csd_params_update");
6937
6938 prop = RNA_def_property(srna, "drag_threshold_tablet", PROP_INT, PROP_PIXEL);
6939 RNA_def_property_range(prop, 1, 255);
6941 "Tablet Drag Threshold",
6942 "Number of pixels to drag before a drag event is triggered "
6943 "for tablet input "
6944 "(otherwise click events are detected)");
6945
6946 prop = RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_PIXEL);
6947 RNA_def_property_range(prop, 1, 255);
6949 "Drag Threshold",
6950 "Number of pixels to drag before a drag event is triggered "
6951 "for keyboard and other non mouse/tablet input "
6952 "(otherwise click events are detected)");
6953
6954 prop = RNA_def_property(srna, "move_threshold", PROP_INT, PROP_PIXEL);
6955 RNA_def_property_range(prop, 0, 255);
6956 RNA_def_property_ui_range(prop, 0, 10, 1, -1);
6958 "Motion Threshold",
6959 "Number of pixels to before the cursor is considered to have moved "
6960 "(used for cycling selected items on successive clicks)");
6961
6962 /* tablet pressure curve */
6963 prop = RNA_def_property(srna, "pressure_threshold_max", PROP_FLOAT, PROP_FACTOR);
6964 RNA_def_property_range(prop, 0.0f, 1.0f);
6965 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 3);
6967 prop, "Max Threshold", "Raw input pressure value that is interpreted as 100% by Blender");
6968
6969 prop = RNA_def_property(srna, "pressure_softness", PROP_FLOAT, PROP_FACTOR);
6971 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1f, 2);
6973 prop, "Softness", "Adjusts softness of the low pressure response onset using a gamma curve");
6974
6975 prop = RNA_def_property(srna, "tablet_api", PROP_ENUM, PROP_NONE);
6976 RNA_def_property_enum_items(prop, tablet_api);
6978 "Tablet API",
6979 "Select the tablet API to use for pressure sensitivity (may require "
6980 "restarting Blender for changes to take effect)");
6981 RNA_def_property_update(prop, 0, "rna_userdef_input_devices");
6982
6983 prop = RNA_def_property(srna, "show_tablet_debug_values", PROP_BOOLEAN, PROP_NONE);
6984 RNA_def_property_boolean_sdna(prop, nullptr, "tablet_flag", USER_TABLET_SHOW_DEBUG_VALUES);
6986 prop, "Show Tablet Debug Values", "Show pressure values when using a paint operator");
6987
6988 prop = RNA_def_property(srna, "xr_navigation", PROP_POINTER, PROP_NONE);
6989 RNA_def_property_pointer_sdna(prop, nullptr, "xr_navigation");
6991 RNA_def_property_struct_type(prop, "XrNavigation");
6992 RNA_def_property_ui_text(prop, "XR Navigation", "Settings for navigation in XR");
6993
6994# ifdef WITH_INPUT_NDOF
6995 /* 3D mouse settings */
6996 /* global options */
6997 prop = RNA_def_property(srna, "ndof_translation_sensitivity", PROP_FLOAT, PROP_NONE);
6998 RNA_def_property_range(prop, 0.01f, 40.0f);
7000 prop, "Pan Sensitivity", "Overall sensitivity of the 3D Mouse for translation");
7001
7002 prop = RNA_def_property(srna, "ndof_rotation_sensitivity", PROP_FLOAT, PROP_NONE);
7003 RNA_def_property_range(prop, 0.01f, 40.0f);
7005 prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for rotation");
7006
7007 prop = RNA_def_property(srna, "ndof_deadzone", PROP_FLOAT, PROP_FACTOR);
7008 RNA_def_property_range(prop, 0.0f, 1.0f);
7010 prop, "Deadzone", "Threshold of initial movement needed from the device's rest position");
7011 RNA_def_property_update(prop, 0, "rna_userdef_ndof_deadzone_update");
7012
7013 prop = RNA_def_property(srna, "ndof_zoom_direction", PROP_ENUM, PROP_NONE);
7014 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ndof_flag");
7015 RNA_def_property_enum_items(prop, ndof_zoom_direction_items);
7017 prop, "Zoom direction", "Which axis of the 3D Mouse cap zooms the view");
7018
7019 /* 3D view */
7020 prop = RNA_def_property(srna, "ndof_show_guide_orbit_axis", PROP_BOOLEAN, PROP_NONE);
7021 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_SHOW_GUIDE_ORBIT_AXIS);
7022
7023 /* TODO: update description when fly-mode visuals are in place
7024 * ("projected position in fly mode"). */
7026 prop, "Show Orbit Axis Guide", "Display the center and axis during rotation");
7027
7028 prop = RNA_def_property(srna, "ndof_show_guide_orbit_center", PROP_BOOLEAN, PROP_NONE);
7031 prop, "Show Orbit Center Guide", "Display the orbit center during rotation");
7032
7033 /* 3D view */
7034 prop = RNA_def_property(srna, "ndof_navigation_mode", PROP_ENUM, PROP_NONE);
7035 RNA_def_property_enum_items(prop, ndof_view_navigation_items);
7036 RNA_def_property_ui_text(prop, "NDOF View Navigate", "3D Mouse Navigation Mode");
7037
7038 prop = RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
7039 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_LOCK_HORIZON);
7041 prop,
7042 "NDOF Lock Horizon",
7043 "Lock Horizon forces the horizon to be kept leveled as it currently is");
7044
7045 prop = RNA_def_property(srna, "ndof_fly_speed_auto", PROP_BOOLEAN, PROP_NONE);
7046 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_FLY_SPEED_AUTO);
7048 "Auto Fly Speed",
7049 "Automatically adjusts fly navigation speed "
7050 "based on the distance of objects near the center of the viewport, "
7051 "making it easier to navigate complex scenes. "
7052 "Speed is recalculated each time movement starts.");
7053
7054 prop = RNA_def_property(srna, "ndof_orbit_center_auto", PROP_BOOLEAN, PROP_NONE);
7055 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ORBIT_CENTER_AUTO);
7057 "Auto",
7058 "Auto sets the orbit center dynamically. "
7059 "When the complete model is in view, the center of "
7060 "volume of the whole model is used as the rotation point. "
7061 "When you move closer, the orbit center will be set "
7062 "on an object close to your center of the view.");
7063
7064 prop = RNA_def_property(srna, "ndof_orbit_center_selected", PROP_BOOLEAN, PROP_NONE);
7065 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ORBIT_CENTER_SELECTED);
7067 "Selected Items",
7068 "Selected Item forces the orbit center "
7069 "to only take the currently selected objects into account.");
7070
7071 /* 3D view: yaw */
7072 prop = RNA_def_property(srna, "ndof_rotx_invert_axis", PROP_BOOLEAN, PROP_NONE);
7073 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ROTX_INVERT_AXIS);
7074 RNA_def_property_ui_text(prop, "Invert Pitch (X) Axis", "");
7075
7076 /* 3D view: pitch */
7077 prop = RNA_def_property(srna, "ndof_roty_invert_axis", PROP_BOOLEAN, PROP_NONE);
7078 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ROTY_INVERT_AXIS);
7079 RNA_def_property_ui_text(prop, "Invert Yaw (Y) Axis", "");
7080
7081 /* 3D view: roll */
7082 prop = RNA_def_property(srna, "ndof_rotz_invert_axis", PROP_BOOLEAN, PROP_NONE);
7083 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ROTZ_INVERT_AXIS);
7084 RNA_def_property_ui_text(prop, "Invert Roll (Z) Axis", "");
7085
7086 /* 3D view: pan x */
7087 prop = RNA_def_property(srna, "ndof_panx_invert_axis", PROP_BOOLEAN, PROP_NONE);
7088 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_PANX_INVERT_AXIS);
7089 RNA_def_property_ui_text(prop, "Invert X Axis", "");
7090
7091 /* 3D view: pan y */
7092 prop = RNA_def_property(srna, "ndof_pany_invert_axis", PROP_BOOLEAN, PROP_NONE);
7093 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_PANY_INVERT_AXIS);
7094 RNA_def_property_ui_text(prop, "Invert Y Axis", "");
7095
7096 /* 3D view: pan z */
7097 prop = RNA_def_property(srna, "ndof_panz_invert_axis", PROP_BOOLEAN, PROP_NONE);
7098 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_PANZ_INVERT_AXIS);
7099 RNA_def_property_ui_text(prop, "Invert Z Axis", "");
7100
7101 /* 3D view: fly */
7102 prop = RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
7103 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_FLY_HELICOPTER);
7105 "Helicopter Mode",
7106 "Device up/down directly controls the Z position of the 3D viewport");
7107
7108 prop = RNA_def_property(srna, "ndof_lock_camera_pan_zoom", PROP_BOOLEAN, PROP_NONE);
7109 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_CAMERA_PAN_ZOOM);
7111 prop,
7112 "Pan / Zoom Camera View",
7113 "Pan/zoom the camera view instead of leaving the camera view when orbiting");
7114# endif /* WITH_INPUT_NDOF */
7115
7116 prop = RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
7117 RNA_def_property_int_sdna(prop, nullptr, "dbl_click_time");
7118 RNA_def_property_range(prop, 1, 1000);
7119 RNA_def_property_ui_text(prop, "Double Click Timeout", "Time/delay (in ms) for a double click");
7120 RNA_def_property_update(prop, 0, "rna_userdef_window_csd_params_update");
7121
7122 prop = RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
7123 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_TWOBUTTONMOUSE);
7125 prop, "Emulate 3 Button Mouse", "Emulate Middle Mouse with Alt+Left Mouse");
7127 RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
7128
7129 static const EnumPropertyItem mouse_emulate_3_button_modifier[] = {
7130 {USER_EMU_MMB_MOD_ALT, "ALT", 0, "Alt", ""},
7131 {USER_EMU_MMB_MOD_OSKEY, "OSKEY", 0, "OS-Key", ""},
7132 {0, nullptr, 0, nullptr, nullptr},
7133 };
7134
7135 prop = RNA_def_property(srna, "mouse_emulate_3_button_modifier", PROP_ENUM, PROP_NONE);
7136 /* Only needed because of WIN32 inability to support the option. */
7138 prop, "rna_UserDef_mouse_emulate_3_button_modifier_get", nullptr, nullptr);
7139 RNA_def_property_enum_items(prop, mouse_emulate_3_button_modifier);
7141 prop, "Emulate 3 Button Modifier", "Hold this modifier to emulate the middle mouse button");
7143 RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
7144
7145 prop = RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
7146 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_NONUMPAD);
7148 prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)");
7149
7150 prop = RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
7151 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_WHEELZOOMDIR);
7152 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
7153
7154 static const EnumPropertyItem touchpad_scroll_direction_items[] = {
7156 "TRADITIONAL",
7157 0,
7158 "Traditional",
7159 "Traditional scroll direction"},
7160 {USER_TRACKPAD_SCROLL_DIR_NATURAL, "NATURAL", 0, "Natural", "Natural scroll direction"},
7161 {0, nullptr, 0, nullptr, nullptr},
7162 };
7163 prop = RNA_def_property(srna, "touchpad_scroll_direction", PROP_ENUM, PROP_NONE);
7164 RNA_def_property_enum_sdna(prop, nullptr, "trackpad_scroll_direction");
7165 RNA_def_property_enum_items(prop, touchpad_scroll_direction_items);
7166 RNA_def_property_ui_text(prop, "Touchpad Scroll Direction", "Scroll direction (Wayland only)");
7167}
7168
7170{
7171 PropertyRNA *prop;
7172
7173 StructRNA *srna = RNA_def_struct(brna, "PreferencesKeymap", nullptr);
7174 RNA_def_struct_sdna(srna, "UserDef");
7175 RNA_def_struct_nested(brna, srna, "Preferences");
7176 RNA_def_struct_ui_text(srna, "Keymap", "Shortcut setup for keyboards and other input devices");
7177
7178 prop = RNA_def_property(srna, "show_ui_keyconfig", PROP_BOOLEAN, PROP_NONE);
7180 prop, nullptr, "space_data.flag", USER_SPACEDATA_INPUT_HIDE_UI_KEYCONFIG);
7181 RNA_def_property_ui_text(prop, "Show UI Key-Config", "");
7182
7183 prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
7184 RNA_def_property_string_sdna(prop, nullptr, "keyconfigstr");
7185 RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
7186}
7187
7189{
7190 StructRNA *srna;
7191 PropertyRNA *prop;
7192 FunctionRNA *func;
7193
7194 srna = RNA_def_struct(brna, "UserAssetLibrary", nullptr);
7195 RNA_def_struct_sdna(srna, "bUserAssetLibrary");
7197 srna, "Asset Library", "Settings to define a reusable library for Asset Browsers to use");
7198 RNA_def_struct_refine_func(srna, "rna_UserAssetLibrary_refine");
7199
7200 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
7202 prop, "Name", "Identifier (not necessarily unique) for the asset library");
7203 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_asset_library_name_set");
7204 RNA_def_struct_name_property(srna, prop);
7205 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_update");
7206
7207 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
7209 RNA_def_property_ui_text(prop, "Enabled", "Enable the asset library");
7211 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_refresh");
7212
7213 prop = RNA_def_property(srna, "remote_url", PROP_STRING, PROP_NONE);
7214 RNA_def_property_string_sdna(prop, nullptr, "remote_url");
7216 prop, nullptr, nullptr, "rna_userdef_asset_library_remote_url_set");
7217 RNA_def_property_ui_text(prop, "URL", "Remote URL to the asset library");
7219 RNA_def_property_update(prop, 0, "rna_userdef_asset_library_remote_url_update");
7220
7221 prop = RNA_def_property(srna, "import_method", PROP_ENUM, PROP_NONE);
7224 prop, nullptr, nullptr, "rna_preference_asset_libray_import_method_itemf");
7225 RNA_def_property_enum_default_func(prop, "rna_preference_asset_libray_import_method_default");
7227 prop,
7228 "Default Import Method",
7229 "Determine how the asset will be imported, unless overridden by the Asset Browser");
7231 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_refresh");
7232
7233 prop = RNA_def_property(srna, "use_relative_path", PROP_BOOLEAN, PROP_NONE);
7236 prop, "Relative Path", "Use relative path when linking assets from this asset library");
7237 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_update");
7238
7239 prop = RNA_def_property(srna, "use_remote_url", PROP_BOOLEAN, PROP_NONE);
7241 RNA_def_property_ui_text(prop, "Use Remote", "Synchronize the asset library with a remote URL");
7243
7244 prop = RNA_def_property(srna, "use_auth_token", PROP_BOOLEAN, PROP_NONE);
7247 prop, "Requires Access Token", "Asset library requires an authentication token");
7249 RNA_def_property_update(prop, 0, "rna_userdef_asset_library_use_auth_token_update");
7250
7251 prop = RNA_def_property(srna, "auth_token", PROP_STRING, PROP_PASSWORD);
7253 prop,
7254 "Access Token",
7255 "Personal authentication token, may be required by some asset libraries");
7257 "rna_userdef_asset_library_auth_token_get",
7258 "rna_userdef_asset_library_auth_token_length",
7259 "rna_userdef_asset_library_auth_token_set");
7260
7261 prop = RNA_def_property(srna, "is_project_defined", PROP_BOOLEAN, PROP_NONE);
7264 prop, "Project Defined", "Signifies if the asset library is defined by a project");
7266
7267 prop = RNA_def_property(srna, "extension_id", PROP_STRING, PROP_NONE);
7268 RNA_def_property_string_sdna(prop, nullptr, "extension_id");
7270 prop,
7271 "Extension ID",
7272 "Identifier of the extension defining this asset library (repository module and package "
7273 "ID), empty for user defined libraries");
7274 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_update");
7275
7276 prop = RNA_def_property(srna, "uuid", PROP_STRING, PROP_NONE);
7278 "rna_userdef_asset_library_uuid_get",
7279 "rna_userdef_asset_library_uuid_length",
7280 nullptr);
7281 RNA_def_property_ui_text(prop, "UUID", "The unique identifier for the asset library");
7283
7284 prop = RNA_def_property(srna, "invalid_uuid", PROP_STRING, PROP_NONE);
7285 RNA_def_property_string_sdna(prop, nullptr, "invalid_uuid");
7287 prop,
7288 "Invalid UUID",
7289 "If the UUID is invalid for the asset, the invalid string will be available here.");
7291
7292 func = RNA_def_function(srna, "is_available", "rna_userdef_asset_library_is_available");
7294 "Check if this asset library can be used, this matches "
7295 "\"enabled\" except asset libraries defined by extensions also "
7296 "require their repository to be enabled");
7297 RNA_def_function_return(func, RNA_def_boolean(func, "result", false, "", ""));
7298}
7299
7301{
7302 StructRNA *srna;
7303 PropertyRNA *prop;
7304
7305 srna = RNA_def_struct(brna, "PreferencesAssetLibrary", "UserAssetLibrary");
7306 RNA_def_struct_sdna(srna, "bUserAssetLibrary");
7308 "Preferences Asset Library",
7309 "An asset library defined in the Preferences, available whatever project "
7310 "or blend file is open");
7311
7312 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
7313 RNA_def_property_string_sdna(prop, nullptr, "dirpath");
7315 prop, "Path", "Path to a directory with .blend files to use as an asset library");
7317 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_asset_library_path_set");
7318 RNA_def_property_editable_func(prop, "rna_userdef_asset_library_path_editable");
7320 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_refresh");
7321}
7322
7324{
7325 StructRNA *srna;
7326 PropertyRNA *prop;
7327
7328 /* Separate subclass than PreferencesAssetLibrary, to set PROP_VARIABLES_PROJECT on the path. */
7329 srna = RNA_def_struct(brna, "ProjectAssetLibrary", "UserAssetLibrary");
7330 RNA_def_struct_sdna(srna, "bUserAssetLibrary");
7332 "Project Asset Library",
7333 "Settings to define a reusable library for Asset Browsers to use");
7334
7335 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
7336 RNA_def_property_string_sdna(prop, nullptr, "dirpath");
7340 prop, "Path", "Path to a directory with .blend files to use as an asset library");
7342 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_asset_library_path_set");
7343 RNA_def_property_editable_func(prop, "rna_userdef_asset_library_path_editable");
7345 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_refresh");
7346}
7347
7349{
7350 StructRNA *srna;
7351 PropertyRNA *prop;
7352
7353 srna = RNA_def_struct(brna, "UserExtensionRepo", nullptr);
7354 RNA_def_struct_sdna(srna, "bUserExtensionRepo");
7356 srna, "Extension Repository", "Settings to define an extension repository");
7357
7358 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
7359 RNA_def_property_ui_text(prop, "Name", "Unique repository name");
7360 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_extension_repo_name_set");
7361 RNA_def_struct_name_property(srna, prop);
7362 RNA_def_property_update(prop, 0, "rna_userdef_update");
7363
7364 prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
7365 RNA_def_property_ui_text(prop, "Module", "Unique module identifier");
7366 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_extension_repo_module_set");
7367 RNA_def_property_update(prop, 0, "rna_userdef_update");
7368
7369 prop = RNA_def_property(srna, "custom_directory", PROP_STRING, PROP_DIRPATH);
7370 RNA_def_property_string_sdna(prop, nullptr, "custom_dirpath");
7371 RNA_def_property_ui_text(prop, "Custom Directory", "The local directory containing extensions");
7374 prop, nullptr, nullptr, "rna_userdef_extension_repo_custom_directory_set");
7375 RNA_def_property_update(prop, 0, "rna_userdef_update");
7376
7377 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
7378 RNA_def_property_ui_text(prop, "Directory", "The local directory containing extensions");
7382 "rna_userdef_extension_repo_directory_get",
7383 "rna_userdef_extension_repo_directory_length",
7384 nullptr);
7385
7386 prop = RNA_def_property(srna, "remote_url", PROP_STRING, PROP_NONE);
7387 RNA_def_property_string_sdna(prop, nullptr, "remote_url");
7389 prop,
7390 "URL",
7391 "Remote URL to the extension repository, "
7392 "the file-system may be referenced using the file URI scheme: \"file://\"");
7394 RNA_def_property_update(prop, 0, "rna_userdef_extension_sync_update");
7395
7396 prop = RNA_def_property(srna, "access_token", PROP_STRING, PROP_PASSWORD);
7398 prop, "Secret", "Personal access token, may be required by some repositories");
7400 "rna_userdef_extension_repo_access_token_get",
7401 "rna_userdef_extension_repo_access_token_length",
7402 "rna_userdef_extension_repo_access_token_set");
7403 RNA_def_property_update(prop, 0, "rna_userdef_extension_sync_update");
7404
7405 prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
7407 RNA_def_property_enum_funcs(prop, nullptr, "rna_userdef_extension_repo_source_set", nullptr);
7409 prop,
7410 "Source",
7411 "Select if the repository is in a user managed or system provided directory");
7412
7413 /* NOTE(@ideasman42): this is intended to be used by a package manger component
7414 * which is not yet integrated. */
7415 prop = RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
7418 "Clean Files After Install",
7419 "Downloaded package files are deleted after installation");
7420 RNA_def_property_update(prop, 0, "rna_userdef_update");
7421
7422 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
7424 RNA_def_property_ui_text(prop, "Enabled", "Enable the repository");
7425 RNA_def_property_boolean_funcs(prop, nullptr, "rna_userdef_extension_repo_enabled_set");
7426 /* The asset libraries this repository defines become usable or unusable, see
7427 * #BKE_preferences_asset_library_is_available. */
7429 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_refresh");
7430
7431 prop = RNA_def_property(srna, "use_sync_on_startup", PROP_BOOLEAN, PROP_NONE);
7434 prop, "Check for Updates on Startup", "Allow Blender to check for updates upon launch");
7435 RNA_def_property_update(prop, 0, "rna_userdef_update");
7436
7437 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
7441 prop, "Expanded", "Show the asset libraries of this repository in the preferences");
7442 RNA_def_property_update(prop, 0, "rna_userdef_update");
7443
7444 prop = RNA_def_property(srna, "use_access_token", PROP_BOOLEAN, PROP_NONE);
7446 RNA_def_property_ui_text(prop, "Requires Access Token", "Repository requires an access token");
7447 RNA_def_property_update(prop, 0, "rna_userdef_extension_sync_update");
7448
7449 prop = RNA_def_property(srna, "use_access_token_for_asset_libraries", PROP_BOOLEAN, PROP_NONE);
7453 "Access Token for Asset Libraries",
7454 "Asset libraries installed from this repository use its access token "
7455 "(cached from the repository listing when syncing)");
7456 RNA_def_property_update(prop, 0, "rna_userdef_update");
7457
7458 prop = RNA_def_property(srna, "use_custom_directory", PROP_BOOLEAN, PROP_NONE);
7460 prop, nullptr, "flag", USER_EXTENSION_REPO_FLAG_USE_CUSTOM_DIRECTORY);
7462 "Custom Directory",
7463 "Manually set the path for extensions to be stored. "
7464 "When disabled a user's extensions directory is created.");
7466 prop, nullptr, "rna_userdef_extension_repo_use_custom_directory_set");
7467 RNA_def_property_update(prop, 0, "rna_userdef_update");
7468
7469 prop = RNA_def_property(srna, "use_remote_url", PROP_BOOLEAN, PROP_NONE);
7471 RNA_def_property_ui_text(prop, "Use Remote", "Synchronize the repository with a remote URL");
7472 RNA_def_property_boolean_funcs(prop, nullptr, "rna_userdef_extension_repo_use_remote_url_set");
7473 RNA_def_property_update(prop, 0, "rna_userdef_update");
7474}
7475
7477{
7478 StructRNA *srna = RNA_def_struct(brna, "ScriptDirectory", nullptr);
7479 RNA_def_struct_sdna(srna, "bUserScriptDirectory");
7480 RNA_def_struct_ui_text(srna, "Python Scripts Directory", "");
7481
7482 PropertyRNA *prop;
7483
7484 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
7485 RNA_def_property_ui_text(prop, "Name", "Identifier for the Python scripts directory");
7486 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_script_directory_name_set");
7487 RNA_def_struct_name_property(srna, prop);
7488 RNA_def_property_update(prop, 0, "rna_userdef_update");
7489
7490 /* NOTE(@ideasman42): Ideally, changing scripts directory would behave as if
7491 * Blender were launched with different script directories (instead of requiring a restart).
7492 * Editing could re-initialize Python's `sys.path`, however this isn't enough.
7493 *
7494 * - For adding new directories this would work for the most-part, duplicate modules between
7495 * directories might cause Python's state on restart to differ however that could
7496 * be considered a corner case as duplicate modules might cause bad/unexpected behavior anyway.
7497 * - Support for removing/changing directories is more involved as there might be modules
7498 * loaded into memory which are no longer accessible.
7499 *
7500 * Properly supporting this would likely require unloading all Blender/Python modules,
7501 * then re-initializing Python's state. This is already supported with `SCRIPT_OT_reload`,
7502 * even then, there are cases that don't work well (especially if any Python operators are
7503 * running at the time this runs). So accept the limitation having to restart
7504 * before changes to script directories are taken into account. */
7505
7506 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
7507 RNA_def_property_string_sdna(prop, nullptr, "dir_path");
7509 prop,
7510 "Python Scripts Directory",
7511 "Alternate script path, matching the default layout with sub-directories: startup, add-ons, "
7512 "modules, and presets (requires restart)");
7513}
7514
7516{
7517 StructRNA *srna;
7518 FunctionRNA *func;
7519 PropertyRNA *parm;
7520
7521 RNA_def_property_srna(cprop, "ScriptDirectoryCollection");
7522 srna = RNA_def_struct(brna, "ScriptDirectoryCollection", nullptr);
7523 RNA_def_struct_ui_text(srna, "Python Scripts Directories", "");
7524
7525 func = RNA_def_function(srna, "new", "rna_userdef_script_directory_new");
7527 RNA_def_function_ui_description(func, "Add a new Python script directory");
7528 /* return type */
7529 parm = RNA_def_pointer(func, "script_directory", "ScriptDirectory", "", "");
7531 RNA_def_function_return(func, parm);
7532
7533 func = RNA_def_function(srna, "remove", "rna_userdef_script_directory_remove");
7535 RNA_def_function_ui_description(func, "Remove a Python script directory");
7536 parm = RNA_def_pointer(func, "script_directory", "ScriptDirectory", "", "");
7539}
7540
7542{
7543 StructRNA *srna;
7544 FunctionRNA *func;
7545 PropertyRNA *parm;
7546 PropertyRNA *prop;
7547
7548 RNA_def_property_srna(cprop, "AssetLibraryCollection");
7549 srna = RNA_def_struct(brna, "AssetLibraryCollection", nullptr);
7550 RNA_def_struct_ui_text(srna, "User Asset Libraries", "Collection of user asset libraries");
7551
7552 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7553 RNA_def_property_struct_type(prop, "UserAssetLibrary");
7555 "rna_AssetLibraryCollection_active_get",
7556 "rna_AssetLibraryCollection_active_set",
7557 nullptr,
7558 nullptr);
7561 prop, "Active Asset Library", "The asset library being edited in the Preferences UI");
7562 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7563
7564 func = RNA_def_function(srna, "new", "rna_userdef_asset_library_new");
7566 RNA_def_function_ui_description(func, "Add a new Asset Library");
7567 RNA_def_string(func, "name", nullptr, sizeof(bUserAssetLibrary::name), "Name", "");
7568 RNA_def_string(func, "directory", nullptr, sizeof(bUserAssetLibrary::dirpath), "Directory", "");
7569 RNA_def_string(func,
7570 "remote_url",
7571 nullptr,
7573 "Remote URL",
7574 "When set, add a remote asset library instead of a local directory");
7576 func,
7577 "extension_id",
7578 nullptr,
7580 "Extension ID",
7581 "When set, the library is defined by this extension (repository module and package ID)");
7582 /* return type */
7583 parm = RNA_def_pointer(func, "library", "UserAssetLibrary", "", "Newly added asset library");
7584 RNA_def_function_return(func, parm);
7585
7586 func = RNA_def_function(srna, "remove", "rna_userdef_asset_library_remove");
7588 RNA_def_function_ui_description(func, "Remove an Asset Library");
7589 parm = RNA_def_pointer(func, "library", "UserAssetLibrary", "", "");
7592}
7593
7595{
7596 StructRNA *srna;
7597 FunctionRNA *func;
7598 PropertyRNA *parm;
7599
7600 RNA_def_property_srna(cprop, "UserExtensionRepoCollection");
7601 srna = RNA_def_struct(brna, "UserExtensionRepoCollection", nullptr);
7603 srna, "User Extension Repositories", "Collection of user extension repositories");
7604
7605 func = RNA_def_function(srna, "new", "rna_userdef_extension_repo_new");
7607 RNA_def_function_ui_description(func, "Add a new repository");
7608
7609 RNA_def_string(func, "name", nullptr, sizeof(bUserExtensionRepo::name), "Name", "");
7610 RNA_def_string(func, "module", nullptr, sizeof(bUserExtensionRepo::module), "Module", "");
7611 RNA_def_string(func,
7612 "custom_directory",
7613 nullptr,
7615 "Custom Directory",
7616 "");
7618 func, "remote_url", nullptr, sizeof(bUserExtensionRepo::remote_url), "Remote URL", "");
7619 RNA_def_enum(func,
7620 "source",
7623 "Source",
7624 "How the repository is managed");
7625
7626 /* return type */
7627 parm = RNA_def_pointer(func, "repo", "UserExtensionRepo", "", "Newly added repository");
7629 RNA_def_function_return(func, parm);
7630
7631 func = RNA_def_function(srna, "remove", "rna_userdef_extension_repo_remove");
7633 RNA_def_function_ui_description(func, "Remove repos");
7634 parm = RNA_def_pointer(func, "repo", "UserExtensionRepo", "", "Repository to remove");
7637}
7638
7640{
7641 PropertyRNA *prop;
7642 StructRNA *srna;
7643
7644 static const EnumPropertyItem anim_player_presets[] = {
7645 {0, "INTERNAL", 0, "Internal", "Built-in animation player"},
7646 {2, "DJV", 0, "DJV", "Open source frame player"},
7647 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
7648 {4, "RV", 0, "RV", "Frame player from Tweak Software"},
7649 {5, "MPLAYER", 0, "MPlayer", "Media player for video and PNG/JPEG/SGI image sequences"},
7650 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
7651 {0, nullptr, 0, nullptr, nullptr},
7652 };
7653
7654 static const EnumPropertyItem preview_type_items[] = {
7655 {USER_FILE_PREVIEW_NONE, "NONE", 0, "None", "Do not create blend previews"},
7656 {USER_FILE_PREVIEW_AUTO, "AUTO", 0, "Auto", "Automatically select best preview type"},
7657 {USER_FILE_PREVIEW_SCREENSHOT, "SCREENSHOT", 0, "Screenshot", "Capture the entire window"},
7658 {USER_FILE_PREVIEW_CAMERA, "CAMERA", 0, "Camera View", "Workbench render of scene"},
7659 {0, nullptr, 0, nullptr, nullptr},
7660 };
7661
7662 static const EnumPropertyItem save_modified_images_items[] = {
7664 "ASK",
7665 0,
7666 "Ask Every Time",
7667 "Show dialog to save modified images when saving the .blend file"},
7669 "ALWAYS_SAVE",
7670 0,
7671 "Always Save",
7672 "Always save modified images when saving the .blend file"},
7674 "NEVER_SAVE",
7675 0,
7676 "Never Save",
7677 "Never save modified images when saving the .blend file"},
7678 {0, nullptr, 0, nullptr, nullptr},
7679 };
7680
7681 srna = RNA_def_struct(brna, "PreferencesFilePaths", nullptr);
7682 RNA_def_struct_sdna(srna, "UserDef");
7683 RNA_def_struct_nested(brna, srna, "Preferences");
7684 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
7685
7686 prop = RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
7687 RNA_def_property_boolean_negative_sdna(prop, nullptr, "uiflag", USER_HIDE_DOT);
7689 "Show Hidden Files/Data-Blocks",
7690 "Show files and data-blocks that are normally hidden");
7691
7692 prop = RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
7693 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_FILTERFILEEXTS);
7694 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files in the File Browser");
7695
7696 prop = RNA_def_property(srna, "show_recent_locations", PROP_BOOLEAN, PROP_NONE);
7699 prop, "Show Recent Locations", "Show Recent locations list in the File Browser");
7700
7701 prop = RNA_def_property(srna, "show_system_bookmarks", PROP_BOOLEAN, PROP_NONE);
7704 prop, "Show System Locations", "Show System locations list in the File Browser");
7705
7706 prop = RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
7707 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_RELPATHS);
7709 prop,
7710 "Relative Paths",
7711 "Default relative path option for the file selector, when no path is defined yet");
7712
7713 prop = RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
7714 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_FILECOMPRESS);
7716 prop, "Compress File", "Enable file compression when saving .blend files");
7717
7718 prop = RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
7720 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
7721 RNA_def_property_update(prop, 0, "rna_userdef_load_ui_update");
7722
7723 prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
7726 "Auto Run Python Scripts",
7727 "Allow any .blend file to run scripts automatically "
7728 "(unsafe with blend files from an untrusted source)");
7729 RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
7730
7731 prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
7734 prop,
7735 "Tabs as Spaces",
7736 "Automatically convert all new tabs into spaces for new and loaded text files");
7737
7738 prop = RNA_def_property(srna, "use_extension_online_access_handled", PROP_BOOLEAN, PROP_NONE);
7740 prop, nullptr, "extension_flag", USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED);
7742 prop,
7743 "Online Access",
7744 "The user has been shown the \"Online Access\" prompt and made a choice");
7745
7746 /* Directories. */
7747
7748 prop = RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
7749 RNA_def_property_string_sdna(prop, nullptr, "fontdir");
7752 prop, "Fonts Directory", "The default directory to search for loading fonts");
7753
7754 prop = RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
7755 RNA_def_property_string_sdna(prop, nullptr, "textudir");
7758 prop, "Textures Directory", "The default directory to search for textures");
7759
7760 prop = RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
7761 RNA_def_property_string_sdna(prop, nullptr, "renderdir");
7764 "Render Output Directory",
7765 "The default directory for rendering output, for new scenes");
7766
7768
7769 prop = RNA_def_property(srna, "script_directories", PROP_COLLECTION, PROP_NONE);
7770 RNA_def_property_struct_type(prop, "ScriptDirectory");
7771 RNA_def_property_ui_text(prop, "Python Scripts Directory", "");
7773
7774 prop = RNA_def_property(srna, "i18n_branches_directory", PROP_STRING, PROP_DIRPATH);
7775 RNA_def_property_string_sdna(prop, nullptr, "i18ndir");
7777 prop,
7778 "Translation Branches Directory",
7779 "The path to the '/branches' directory of your local svn-translation copy, "
7780 "to allow translating from the UI");
7781
7782 prop = RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
7783 RNA_def_property_string_sdna(prop, nullptr, "sounddir");
7784 RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
7786
7787 prop = RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
7788 RNA_def_property_string_sdna(prop, nullptr, "tempdir");
7790 "Temporary Directory",
7791 "The directory for storing temporary save files. "
7792 "The path must reference an existing directory or it will be ignored");
7793 RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
7794
7795 prop = RNA_def_property(srna, "render_cache_directory", PROP_STRING, PROP_DIRPATH);
7796 RNA_def_property_string_sdna(prop, nullptr, "render_cachedir");
7797 RNA_def_property_ui_text(prop, "Render Cache Path", "Where to cache raw render results");
7799
7800 prop = RNA_def_property(srna, "texture_cache_directory", PROP_STRING, PROP_DIRPATH);
7801 RNA_def_property_string_sdna(prop, nullptr, "texture_cachedir");
7803 prop,
7804 "Texture Cache Path",
7805 "The directory for storing tx files generated from image files, for more efficient "
7806 "rendering. Paths may be absolute, or relative to the image file. Leave blank to store "
7807 "tx files in the same directory as image files");
7809
7810 prop = RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
7811 RNA_def_property_string_sdna(prop, nullptr, "image_editor");
7812 RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
7813
7814 prop = RNA_def_property(srna, "text_editor", PROP_STRING, PROP_FILEPATH);
7815 RNA_def_property_string_sdna(prop, nullptr, "text_editor");
7817 "Text Editor",
7818 "Command to launch the text editor, "
7819 "either a full path or a command in $PATH.\n"
7820 "Use the internal editor when left blank");
7821
7822 prop = RNA_def_property(srna, "text_editor_args", PROP_STRING, PROP_NONE);
7823 RNA_def_property_string_sdna(prop, nullptr, "text_editor_args");
7825 prop,
7826 "Text Editor Args",
7827 "Defines the specific format of the arguments with which the text editor opens files. "
7828 "The supported expansions are as follows:\n"
7829 "\n"
7830 "$filepath The absolute path of the file.\n"
7831 "$line The line to open at (Optional).\n"
7832 "$column The column to open from the beginning of the line (Optional).\n"
7833 "$line0 & column0 start at zero."
7834 "\n"
7835 "Example: -f $filepath -l $line -c $column");
7836
7837 prop = RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
7838 RNA_def_property_string_sdna(prop, nullptr, "anim_player");
7840 prop, "Animation Player", "Path to a custom animation/frame sequence player");
7841
7842 prop = RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
7843 RNA_def_property_enum_sdna(prop, nullptr, "anim_player_preset");
7844 RNA_def_property_enum_items(prop, anim_player_presets);
7846 prop, "Animation Player Preset", "Preset configs for external animation players");
7847
7848 /* Auto-save. */
7849
7850 prop = RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
7851 RNA_def_property_int_sdna(prop, nullptr, "versions");
7852 RNA_def_property_range(prop, 0, 32);
7854 prop,
7855 "Save Versions",
7856 "The number of old versions to maintain in the current directory, when manually saving");
7857
7858 prop = RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
7859 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_AUTOSAVE);
7861 "Auto Save Temporary Files",
7862 "Automatic saving of temporary files in temp directory, "
7863 "uses process ID.\n"
7864 "Warning: Sculpt and edit mode data won't be saved");
7865 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
7866
7867 prop = RNA_def_property(srna, "save_modified_images", PROP_ENUM, PROP_NONE);
7868 RNA_def_property_enum_items(prop, save_modified_images_items);
7870 "Save Modified Images",
7871 "How modified images should be handled when saving the .blend file");
7872
7873 prop = RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
7874 RNA_def_property_int_sdna(prop, nullptr, "savetime");
7875 RNA_def_property_range(prop, 1, 60);
7877 prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
7878 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
7879
7880 prop = RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
7881 RNA_def_property_range(prop, 0, 1000);
7883 prop, "Recent Files", "Maximum number of recently opened files to remember");
7884
7885 prop = RNA_def_property(srna, "file_preview_type", PROP_ENUM, PROP_NONE);
7886 RNA_def_property_enum_items(prop, preview_type_items);
7887 RNA_def_property_ui_text(prop, "File Preview Type", "What type of blend preview to create");
7888
7892
7893 prop = RNA_def_property(srna, "asset_libraries", PROP_COLLECTION, PROP_NONE);
7894 RNA_def_property_struct_type(prop, "UserAssetLibrary");
7895 RNA_def_property_ui_text(prop, "Asset Libraries", "");
7897
7898 prop = RNA_def_property(srna, "active_asset_library", PROP_INT, PROP_NONE);
7900 "Active Asset Library",
7901 "Index of the asset library being edited in the Preferences UI");
7902}
7903
7905{
7906 StructRNA *srna = RNA_def_struct(brna, "PreferencesAssetLibraries", nullptr);
7907 RNA_def_struct_sdna(srna, "UserDef");
7908 RNA_def_struct_nested(brna, srna, "Preferences");
7909 RNA_def_struct_ui_text(srna, "Asset Libraries", "");
7910
7911 PropertyRNA *prop;
7912
7913 prop = RNA_def_property(srna, "use_online_essentials", PROP_BOOLEAN, PROP_NONE);
7916 prop,
7917 "Online Essentials",
7918 "Include remote assets in the Essentials asset library. Downloading requires Online Access "
7919 "to be enabled under System > Network in the Preferences");
7921 RNA_def_property_update(prop, 0, "rna_userdef_asset_libraries_use_online_essentials_update");
7922}
7923
7925{
7926 PropertyRNA *prop;
7927 StructRNA *srna;
7928
7929 srna = RNA_def_struct(brna, "PreferencesExtensions", nullptr);
7930 RNA_def_struct_sdna(srna, "UserDef");
7931 RNA_def_struct_nested(brna, srna, "Preferences");
7932 RNA_def_struct_ui_text(srna, "Extensions", "Settings for extensions");
7933
7934 prop = RNA_def_property(srna, "use_online_access_handled", PROP_BOOLEAN, PROP_NONE);
7936 prop, nullptr, "extension_flag", USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED);
7938 prop,
7939 "Online Access",
7940 "The user has been shown the \"Online Access\" prompt and made a choice");
7941
7943
7944 prop = RNA_def_property(srna, "repos", PROP_COLLECTION, PROP_NONE);
7945 RNA_def_property_collection_sdna(prop, nullptr, "extension_repos", nullptr);
7946 RNA_def_property_struct_type(prop, "UserExtensionRepo");
7947 RNA_def_property_ui_text(prop, "Extension Repositories", "");
7949
7950 prop = RNA_def_property(srna, "active_repo", PROP_INT, PROP_NONE);
7951 RNA_def_property_int_sdna(prop, nullptr, "active_extension_repo");
7953 prop,
7954 "Active Extension Repository",
7955 "Index of the extensions repository being edited in the Preferences UI");
7956
7957 /* Tag for UI-only update, meaning preferences will not be tagged as changed. */
7958 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7959}
7960
7962{
7963 PropertyRNA *prop;
7964 StructRNA *srna;
7965
7966 srna = RNA_def_struct(brna, "PreferencesApps", nullptr);
7967 RNA_def_struct_sdna(srna, "UserDef");
7968 RNA_def_struct_nested(brna, srna, "Preferences");
7969 RNA_def_struct_ui_text(srna, "Apps", "Preferences that work only for apps");
7970
7971 prop = RNA_def_property(srna, "show_corner_split", PROP_BOOLEAN, PROP_NONE);
7974 prop, "Corner Splitting", "Split and join editors by dragging from corners");
7975 RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
7976
7977 prop = RNA_def_property(srna, "show_edge_resize", PROP_BOOLEAN, PROP_NONE);
7979 RNA_def_property_ui_text(prop, "Edge Resize", "Resize editors by dragging from the edges");
7980 RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
7981
7982 prop = RNA_def_property(srna, "show_regions_visibility_toggle", PROP_BOOLEAN, PROP_NONE);
7985 prop, "Regions Visibility Toggle", "Header and side bars visibility toggles");
7986 RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
7987}
7988
7990{
7991 StructRNA *srna;
7992 PropertyRNA *prop;
7993
7994 srna = RNA_def_struct(brna, "PreferencesExperimental", nullptr);
7995 RNA_def_struct_sdna(srna, "UserDef_Experimental");
7996 RNA_def_struct_nested(brna, srna, "Preferences");
7997 RNA_def_struct_ui_text(srna, "Experimental", "Experimental features");
7998
7999 prop = RNA_def_property(srna, "use_undo_legacy", PROP_BOOLEAN, PROP_NONE);
8000 RNA_def_property_boolean_sdna(prop, nullptr, "use_undo_legacy", 1);
8002 prop,
8003 "Undo Legacy",
8004 "Use legacy undo (slower than the new default one, but may be more stable in some cases)");
8005
8006 prop = RNA_def_property(srna, "override_auto_resync", PROP_BOOLEAN, PROP_NONE);
8007 RNA_def_property_boolean_sdna(prop, nullptr, "no_override_auto_resync", 1);
8009 "No Override Auto Resync",
8010 "Disable library overrides automatic resync detection and process on "
8011 "file load (can be useful to help fixing broken files). Also see the "
8012 "\"--disable-liboverride-auto-resync\" command line option");
8013
8014 prop = RNA_def_property(srna, "use_new_curves_tools", PROP_BOOLEAN, PROP_NONE);
8015 RNA_def_property_boolean_sdna(prop, nullptr, "use_new_curves_tools", 1);
8017 prop, "New Curves Tools", "Enable additional features for the new curves data block");
8018
8019 prop = RNA_def_property(srna, "use_cycles_debug", PROP_BOOLEAN, PROP_NONE);
8020 RNA_def_property_boolean_sdna(prop, nullptr, "use_cycles_debug", 1);
8021 RNA_def_property_ui_text(prop, "Cycles Debug", "Enable Cycles debugging options for developers");
8022 RNA_def_property_update(prop, 0, "rna_userdef_update");
8023
8024 prop = RNA_def_property(srna, "use_eevee_debug", PROP_BOOLEAN, PROP_NONE);
8025 RNA_def_property_boolean_sdna(prop, nullptr, "use_eevee_debug", 1);
8026 RNA_def_property_ui_text(prop, "EEVEE Debug", "Enable EEVEE debugging options for developers");
8027 RNA_def_property_update(prop, 0, "rna_userdef_update");
8028
8029 prop = RNA_def_property(srna, "use_3d_texture_paint", PROP_BOOLEAN, PROP_NONE);
8030 RNA_def_property_boolean_sdna(prop, nullptr, "use_3d_texture_paint", 1);
8031 RNA_def_property_ui_text(prop, "3D Texture Paint", "Use experimental 3D texture painting");
8033 RNA_def_property_update(prop, 0, "rna_experimental_use_3d_texture_paint_update");
8034
8035 prop = RNA_def_property(srna, "use_extended_asset_browser", PROP_BOOLEAN, PROP_NONE);
8037 "Extended Asset Browser",
8038 "Enable Asset Browser editor and operators to manage regular "
8039 "data-blocks as assets, not just poses");
8040 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8041
8042 prop = RNA_def_property(srna, "show_asset_debug_info", PROP_BOOLEAN, PROP_NONE);
8044 "Asset Debug Info",
8045 "Enable some extra fields in the Asset Browser to aid in debugging");
8046 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8047
8048 prop = RNA_def_property(srna, "use_asset_indexing", PROP_BOOLEAN, PROP_NONE);
8049 RNA_def_property_boolean_sdna(prop, nullptr, "no_asset_indexing", 1);
8051 "No Asset Indexing",
8052 "Disable the asset indexer, to force every asset library refresh to "
8053 "completely reread assets from disk");
8054 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8055
8056 prop = RNA_def_property(srna, "use_viewport_debug", PROP_BOOLEAN, PROP_NONE);
8057 RNA_def_property_boolean_sdna(prop, nullptr, "use_viewport_debug", 1);
8059 "Viewport Debug",
8060 "Enable viewport debugging options for developers in the overlays "
8061 "pop-over");
8062 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8063
8064 prop = RNA_def_property(srna, "write_legacy_blend_file_format", PROP_BOOLEAN, PROP_NONE);
8065 RNA_def_property_boolean_sdna(prop, nullptr, "write_legacy_blend_file_format", 1);
8067 prop,
8068 "Write Legacy Blend File Format",
8069 "Use file format used before Blender 5.0. This format is more limited "
8070 "but it may have better compatibility with tools that don't support the new format yet");
8071
8072 prop = RNA_def_property(srna, "no_data_block_packing", PROP_BOOLEAN, PROP_NONE);
8073 RNA_def_property_boolean_sdna(prop, nullptr, "no_data_block_packing", 1);
8075 prop, "No Data-Block Packing", "Fall-back to appending instead of packing data-blocks");
8077 RNA_def_property_update(prop, 0, "rna_experimental_no_data_block_packing_update");
8078
8079 prop = RNA_def_property(srna, "use_all_linked_data_direct", PROP_BOOLEAN, PROP_NONE);
8081 prop,
8082 "All Linked Data Direct",
8083 "Forces all linked data to be considered as directly linked. Workaround for current "
8084 "issues/limitations in BAT (Blender studio pipeline tool)");
8085
8086 prop = RNA_def_property(srna, "use_shader_node_previews", PROP_BOOLEAN, PROP_NONE);
8088 prop, "Shader Node Previews", "Enables previews in the shader node editor");
8089 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8090
8091 prop = RNA_def_property(srna, "use_remote_asset_libraries", PROP_BOOLEAN, PROP_NONE);
8094 prop, "Remote Asset Libraries", "Enable asset libraries served over HTTP/HTTPS");
8095
8096 prop = RNA_def_property(srna, "use_extensions_debug", PROP_BOOLEAN, PROP_NONE);
8098 prop,
8099 "Extensions Debug",
8100 "Extra debugging information & developer support utilities for extensions");
8101 RNA_def_property_update(prop, 0, "rna_userdef_update");
8102
8103 prop = RNA_def_property(srna, "use_recompute_usercount_on_save_debug", PROP_BOOLEAN, PROP_NONE);
8105 prop,
8106 "Recompute ID User Count On Save",
8107 "Recompute all ID user-counts before saving to a blend-file. "
8108 "Allows to work around invalid user-count handling in code "
8109 "that may lead to loss of data due to wrongly detected unused data-blocks");
8110
8111 prop = RNA_def_property(srna, "use_paint_debug", PROP_BOOLEAN, PROP_NONE);
8112 RNA_def_property_boolean_sdna(prop, nullptr, "use_paint_debug", 1);
8114 prop, "Paint Debug", "Enable paint & sculpt debugging options for developers");
8115 RNA_def_property_update(prop, 0, "rna_userdef_update");
8116
8117 prop = RNA_def_property(srna, "use_video_decoding_debug", PROP_BOOLEAN, PROP_NONE);
8118 RNA_def_property_boolean_sdna(prop, nullptr, "use_video_decoding_debug", 1);
8120 prop, "Video Decoding Debug", "Enable video decoding debugging options for developers");
8121 RNA_def_property_update(prop, 0, "rna_userdef_update");
8122}
8123
8125{
8126 StructRNA *srna;
8127 FunctionRNA *func;
8128 PropertyRNA *parm;
8129
8130 RNA_def_property_srna(cprop, "Addons");
8131 srna = RNA_def_struct(brna, "Addons", nullptr);
8132 RNA_def_struct_ui_text(srna, "User Add-ons", "Collection of add-ons");
8133
8134 func = RNA_def_function(srna, "new", "rna_userdef_addon_new");
8136 RNA_def_function_ui_description(func, "Add a new add-on");
8137 /* return type */
8138 parm = RNA_def_pointer(func, "addon", "Addon", "", "Add-on data");
8140 RNA_def_function_return(func, parm);
8141
8142 func = RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
8144 RNA_def_function_ui_description(func, "Remove add-on");
8145 parm = RNA_def_pointer(func, "addon", "Addon", "", "Add-on to remove");
8148}
8149
8151{
8152 StructRNA *srna;
8153 FunctionRNA *func;
8154 PropertyRNA *parm;
8155
8156 RNA_def_property_srna(cprop, "PathCompareCollection");
8157 srna = RNA_def_struct(brna, "PathCompareCollection", nullptr);
8158 RNA_def_struct_ui_text(srna, "Paths Compare", "Collection of paths");
8159
8160 func = RNA_def_function(srna, "new", "rna_userdef_pathcompare_new");
8162 RNA_def_function_ui_description(func, "Add a new path");
8163 /* return type */
8164 parm = RNA_def_pointer(func, "pathcmp", "PathCompare", "", "");
8166 RNA_def_function_return(func, parm);
8167
8168 func = RNA_def_function(srna, "remove", "rna_userdef_pathcompare_remove");
8170 RNA_def_function_ui_description(func, "Remove path");
8171 parm = RNA_def_pointer(func, "pathcmp", "PathCompare", "", "");
8174}
8175
8177{
8179
8180 StructRNA *srna;
8181 PropertyRNA *prop;
8182
8187
8188 srna = RNA_def_struct(brna, "Preferences", nullptr);
8189 RNA_def_struct_sdna(srna, "UserDef");
8190 RNA_def_struct_ui_text(srna, "Preferences", "Global preferences");
8191
8192 prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
8193 RNA_def_property_enum_sdna(prop, nullptr, "space_data.section_active");
8195 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UseDef_active_section_itemf");
8196 RNA_def_property_ui_text(prop, "Active Section", "Preferences");
8197 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8198
8199 /* don't expose this directly via the UI, modify via an operator */
8200 prop = RNA_def_property(srna, "app_template", PROP_STRING, PROP_NONE);
8201 RNA_def_property_string_sdna(prop, nullptr, "app_template");
8202 RNA_def_property_ui_text(prop, "Application Template", "");
8203
8204 prop = RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
8205 RNA_def_property_collection_sdna(prop, nullptr, "themes", nullptr);
8206 RNA_def_property_struct_type(prop, "Theme");
8207 RNA_def_property_ui_text(prop, "Themes", "");
8208
8209 prop = RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
8210 RNA_def_property_collection_sdna(prop, nullptr, "uistyles", nullptr);
8211 RNA_def_property_struct_type(prop, "ThemeStyle");
8212 RNA_def_property_ui_text(prop, "Styles", "");
8213
8214 prop = RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
8215 RNA_def_property_collection_sdna(prop, nullptr, "addons", nullptr);
8216 RNA_def_property_struct_type(prop, "Addon");
8217 RNA_def_property_ui_text(prop, "Add-on", "");
8219
8220 prop = RNA_def_property(srna, "autoexec_paths", PROP_COLLECTION, PROP_NONE);
8221 RNA_def_property_collection_sdna(prop, nullptr, "autoexec_paths", nullptr);
8222 RNA_def_property_struct_type(prop, "PathCompare");
8223 RNA_def_property_ui_text(prop, "Auto-Execution Paths", "");
8225
8226 prop = RNA_def_property(srna, "use_recent_searches", PROP_BOOLEAN, PROP_NONE);
8228 RNA_def_property_ui_text(prop, "Recent Searches", "Sort the recently searched items at the top");
8229
8230 prop = RNA_def_property(srna, "show_hidden_ids", PROP_BOOLEAN, PROP_NONE);
8233 prop, "Show Hidden", "Show data-blocks with dot-prefixed names in search menus");
8234
8235 /* nested structs */
8236 prop = RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
8238 RNA_def_property_struct_type(prop, "PreferencesView");
8239 RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", nullptr, nullptr, nullptr);
8240 RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
8241
8242 prop = RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
8244 RNA_def_property_struct_type(prop, "PreferencesEdit");
8245 RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", nullptr, nullptr, nullptr);
8246 RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
8247
8248 prop = RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
8250 RNA_def_property_struct_type(prop, "PreferencesInput");
8251 RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", nullptr, nullptr, nullptr);
8252 RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
8253
8254 prop = RNA_def_property(srna, "keymap", PROP_POINTER, PROP_NONE);
8256 RNA_def_property_struct_type(prop, "PreferencesKeymap");
8257 RNA_def_property_pointer_funcs(prop, "rna_UserDef_keymap_get", nullptr, nullptr, nullptr);
8258 RNA_def_property_ui_text(prop, "Keymap", "Shortcut setup for keyboards and other input devices");
8259
8260 prop = RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
8262 RNA_def_property_struct_type(prop, "PreferencesFilePaths");
8263 RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", nullptr, nullptr, nullptr);
8264 RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
8265
8266 prop = RNA_def_property(srna, "asset_libraries", PROP_POINTER, PROP_NONE);
8268 RNA_def_property_struct_type(prop, "PreferencesAssetLibraries");
8270 prop, "rna_UserDef_asset_libraries_get", nullptr, nullptr, nullptr);
8272 prop, "Asset Libraries", "Setup for custom and builtin asset libraries");
8273
8274 prop = RNA_def_property(srna, "extensions", PROP_POINTER, PROP_NONE);
8276 RNA_def_property_struct_type(prop, "PreferencesExtensions");
8277 RNA_def_property_pointer_funcs(prop, "rna_UserDef_extensions_get", nullptr, nullptr, nullptr);
8278 RNA_def_property_ui_text(prop, "Extensions", "Settings for extensions");
8279
8280 prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
8282 RNA_def_property_struct_type(prop, "PreferencesSystem");
8283 RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", nullptr, nullptr, nullptr);
8285 prop, "System & OpenGL", "Graphics driver and operating system settings");
8286
8287 prop = RNA_def_property(srna, "apps", PROP_POINTER, PROP_NONE);
8289 RNA_def_property_struct_type(prop, "PreferencesApps");
8290 RNA_def_property_pointer_funcs(prop, "rna_UserDef_apps_get", nullptr, nullptr, nullptr);
8291 RNA_def_property_ui_text(prop, "Apps", "Preferences that work only for apps");
8292
8293 prop = RNA_def_property(srna, "experimental", PROP_POINTER, PROP_NONE);
8295 RNA_def_property_struct_type(prop, "PreferencesExperimental");
8297 prop,
8298 "Experimental",
8299 "Settings for features that are still early in their development stage");
8300
8301 prop = RNA_def_int_vector(srna,
8302 "version",
8303 3,
8304 nullptr,
8305 0,
8306 INT_MAX,
8307 "Version",
8308 "Version of Blender the userpref.blend was saved with",
8309 0,
8310 INT_MAX);
8311 RNA_def_property_int_funcs(prop, "rna_userdef_version_get", nullptr, nullptr);
8314
8315 /* StudioLight Collection */
8316 prop = RNA_def_property(srna, "studio_lights", PROP_COLLECTION, PROP_NONE);
8317 RNA_def_property_struct_type(prop, "StudioLight");
8318 RNA_def_property_srna(prop, "StudioLights");
8320 "rna_UserDef_studiolight_begin",
8321 "rna_iterator_listbase_next",
8322 "rna_iterator_listbase_end",
8323 "rna_iterator_listbase_get",
8324 nullptr,
8325 nullptr,
8326 nullptr,
8327 nullptr);
8328 RNA_def_property_ui_text(prop, "Studio Lights", "");
8329
8330 /* Preferences Flags */
8331 prop = RNA_def_property(srna, "use_preferences_save", PROP_BOOLEAN, PROP_NONE);
8332 RNA_def_property_boolean_sdna(prop, nullptr, "pref_flag", USER_PREF_FLAG_SAVE);
8334 "Save on Exit",
8335 "Save preferences on exit when modified "
8336 "(unless factory settings have been loaded)");
8337
8338 prop = RNA_def_property(srna, "use_project_auto_save", PROP_BOOLEAN, PROP_NONE);
8341 prop,
8342 "Auto-save Project",
8343 "Save projects automatically on exit and when saving or switching blend files");
8344 RNA_def_property_update(prop, 0, "rna_userdef_update");
8345
8346 prop = RNA_def_property(srna, "use_project_remember", PROP_BOOLEAN, PROP_NONE);
8349 prop,
8350 "Remember Last Project",
8351 "On startup, automatically re-open the project that was last open when Blender was closed");
8352 RNA_def_property_update(prop, 0, "rna_userdef_update");
8353
8354 prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
8355 RNA_def_property_boolean_sdna(prop, nullptr, "runtime.is_dirty", 0);
8356 RNA_def_property_ui_text(prop, "Dirty", "Preferences have changed");
8357 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
8358
8374
8376}
8377
8378} // namespace blender
8379
8380#endif
Blender util stuff.
General operations, lookup, etc. for blender objects.
#define STUDIOLIGHT_FLAG_ORIENTATIONS
#define INT32_MAX
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
#define FILE_MAX
Random number functions.
#define STRNCPY_UTF8_RLEN(dst, src)
#define STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
Compatibility-like things for windows.
#define BLT_I18NCONTEXT_ID_WINDOWMANAGER
#define BLT_I18NCONTEXT_ID_ACTION
#define BLT_I18NCONTEXT_ID_ID
#define BLT_I18NCONTEXT_ID_LIGHT
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define BLT_I18NCONTEXT_ID_MOVIECLIP
#define DATA_(msgid)
#define BLT_I18NCONTEXT_EDITOR_FILEBROWSER
Object is a sort of wrapper for general info.
@ TH_WIRECOLOR_CONSTCOLS
struct uiStyle uiStyle
struct uiWidgetColors uiWidgetColors
struct bTheme bTheme
@ TH_BACKGROUND_GRADIENT_RADIAL
@ TH_BACKGROUND_SINGLE_COLOR
@ TH_BACKGROUND_GRADIENT_LINEAR
#define UUID_STRING_SIZE
void MEM_CacheLimiter_set_maximum(size_t m)
Read Blender memory allocation and freeing.
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:762
#define C
Definition RandGen.cpp:29
#define ND_UI_FONT
Definition WM_types.hh:602
#define NC_WINDOW
Definition WM_types.hh:388
#define ND_SPACE_INFO
Definition WM_types.hh:564
#define ND_SPACE_DOPESHEET
Definition WM_types.hh:576
#define ND_SPACE_ASSET_PARAMS
Definition WM_types.hh:568
#define NC_SCREEN
Definition WM_types.hh:390
#define NA_EDITED
Definition WM_types.hh:634
#define ND_SPACE_GRAPH
Definition WM_types.hh:575
#define ND_UI_LANG
Definition WM_types.hh:604
#define NC_UI
Definition WM_types.hh:422
#define NS_VIEW3D_GPU
Definition WM_types.hh:626
#define ND_SPACE_TEXT
Definition WM_types.hh:573
#define ND_SPACE_VIEW3D
Definition WM_types.hh:571
#define NC_SPACE
Definition WM_types.hh:405
#define BLI_assert_unreachable()
#define UNUSED_VARS(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define STREQ(a, b)
constexpr int64_t size() const
Definition BLI_span.hh:256
#define offsetof(t, d)
#define FLT_MAX
#define INT_MAX
AssetLibraryReference essentials_library_reference()
void remote_library_request_download(const RemoteLibraryDefinitionRef &library_definition)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
void free(Subdiv *subdiv)
Definition subdiv.cc:192
void with_blender_project_write_lock(FunctionRef< void()> lambda)
std::string date(const std::tm &date_time, StringRef locale_iso={}, DateFormat format=DateFormat::Default)
void clear(const AssetLibraryReference *library_reference, const bContext *C)
void clear_all_library(const bContext *C)
AssetLibraryReference user_library_to_library_ref(const bUserAssetLibrary &user_library)
void set_approximate_size_limit(int64_t limit_in_bytes)
const uiStyle * style_get()
void update_text_styles()
void refresh_for_srna_unregister(Main *bmain, StructRNA *srna_to_unreg)
void reinit_font()
BMesh Iterators.
void WM_main_add_notifier(uint type, void *reference)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
UserDef U
Definition blender.cc:58
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
static void rna_def_userdef_themes(BlenderRNA *brna)
@ USER_ASSETS_USE_ONLINE_ESSENTIALS
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
void BKE_sculptsession_free(Object *ob)
SubsurfModifierData * BKE_object_get_last_subsurf_modifier(const Object *ob)
Definition object.cc:5733
void BKE_object_sculpt_data_create(Object *ob)
Definition object.cc:4337
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
__int64 int64_t
Definition BKE_text.h:90
static void rna_def_userdef_theme_regions_scrubbing(BlenderRNA *brna)
static void rna_def_userdef_theme_strip_color(BlenderRNA *brna)
StudioLight * BKE_studiolight_create(const char *filepath, const SolidLight light[4], const float light_ambient[3])
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
@ STUDIOLIGHT_USER_DEFINED
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_TYPE_STUDIO
@ STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS
@ STUDIOLIGHT_TYPE_WORLD
char * STRNCPY(char(&dst)[N], const char *src)
static void rna_def_userdef_theme_space_statusbar(BlenderRNA *brna)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
int(*)(PointerRNA *ptr, void *data, bool *have_function) StructValidateFunc
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void WM_event_add_notifier_ex(wmWindowManager *wm, const wmWindow *win, uint type, void *reference)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
static void rna_def_userdef_theme_spaces_gradient(StructRNA *srna)
static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
static void rna_def_userdef_dothemes(BlenderRNA *brna)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
const EnumPropertyItem rna_enum_asset_import_method_items[]
Definition rna_asset.cc:54
void BKE_preferences_extension_repo_custom_dirpath_set(bUserExtensionRepo *repo, const char *path)
@ STRUCT_NO_DATABLOCK_IDPROPERTIES
static void rna_def_userdef_addon(BlenderRNA *brna)
static void rna_def_project_asset_library(BlenderRNA *brna)
void RNA_def_property_enum_default_func(PropertyRNA *prop, const char *get_default)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
MINLINE void copy_v3_v3(float r[3], const float a[3])
unsigned int uint
Definition BKE_text.h:55
static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_gpencil(StructRNA *srna)
static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
static void rna_def_userdef_filepaths_asset_library(BlenderRNA *brna)
@ BKE_CB_EVT_EXTENSION_REPOS_UPDATE_PRE
@ BKE_CB_EVT_TRANSLATION_UPDATE_POST
@ BKE_CB_EVT_EXTENSION_REPOS_UPDATE_POST
@ BKE_CB_EVT_EXTENSION_REPOS_SYNC
void BLT_lang_set(const char *)
Definition blt_lang.cc:253
static void rna_def_userdef_theme_space_spreadsheet(BlenderRNA *brna)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_userdef_addon_pref(BlenderRNA *brna)
void BKE_callback_exec_null(Main *bmain, eCbEvent evt)
Definition callbacks.cc:40
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
@ USER_UIFLAG2_PANEL_TABS_COMPACT
@ USER_ALWAYS_SHOW_NUMBER_ARROWS
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Span< GPUDevice > GPU_platform_devices_list()
static void rna_def_userdef_walk_navigation(BlenderRNA *brna)
const EnumPropertyItem * BKE_preferences_active_section_itemf(const UserDef *userdef, bool *r_free)
@ ASSET_LIBRARY_USE_AUTH_TOKEN
@ ASSET_LIBRARY_PROJECT_DEFINED
@ ASSET_LIBRARY_DISABLED
@ ASSET_LIBRARY_USE_REMOTE_URL
@ ASSET_LIBRARY_RELATIVE_PATH
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void BKE_preferences_extension_repo_module_set(UserDef *userdef, bUserExtensionRepo *repo, const char *module)
static void rna_def_userdef_system(BlenderRNA *brna)
void rna_userdef_is_dirty_update(Main *bmain, Scene *scene, PointerRNA *ptr)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
@ NDOF_SHOW_GUIDE_ORBIT_CENTER
@ NDOF_SHOW_GUIDE_ORBIT_AXIS
@ NDOF_ORBIT_CENTER_SELECTED
static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
struct RNG * BLI_rng_new_srandom(unsigned int seed)
Definition rand.cc:48
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
bke::BlenderProject * BKE_blender_project_get(const Main *bmain)
void BKE_studiolight_refresh()
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
@ STATUSBAR_SHOW_EXTENSIONS_UPDATES
@ STATUSBAR_SHOW_SCENE_DURATION
@ PROP_UNIT_LENGTH
Definition RNA_types.hh:222
void BKE_addon_free(struct bAddon *addon)
Definition addon.cc:70
static void rna_def_userdef_asset_library_collection(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_userdef(BlenderRNA *brna)
struct bUserAssetLibrary * BKE_preferences_remote_asset_library_add(struct UserDef *userdef, const char *name, const char *remote_url, const char *auth_token) ATTR_NONNULL(1
static void rna_def_userdef_apps(BlenderRNA *brna)
@ FUNC_USE_REPORTS
@ FUNC_NO_SELF
Definition RNA_types.hh:998
@ FUNC_USE_CONTEXT
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void * RNA_struct_blender_type_get(StructRNA *srna)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_path_template_type(PropertyRNA *prop, PropertyPathTemplateType path_template_type)
void BKE_addon_pref_type_add(bAddonPrefType *apt)
Definition addon.cc:109
static void rna_def_userdef_studiolight(BlenderRNA *brna)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
static void rna_def_userdef_autoexec_path_collection(BlenderRNA *brna, PropertyRNA *cprop)
void BKE_preferences_extension_repo_name_set(UserDef *userdef, bUserExtensionRepo *repo, const char *name)
static void rna_def_userdef_theme_ui_gradient(BlenderRNA *brna)
@ USER_ANIM_KEY_CHANNEL_CUSTOM_PROPERTIES
@ USER_ANIM_KEY_CHANNEL_ROTATION
@ USER_ANIM_KEY_CHANNEL_ROTATION_MODE
@ USER_ANIM_KEY_CHANNEL_SCALE
@ USER_ANIM_KEY_CHANNEL_LOCATION
static void rna_def_userdef_theme_regions(BlenderRNA *brna)
static int max_memory_in_megabytes_int()
static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void WM_file_autosave_init(wmWindowManager *wm)
Definition wm_files.cc:2472
static const EnumPropertyItem rna_enum_preference_video_decoding_device_items[]
const EnumPropertyItem rna_enum_navigation_mode_items[]
static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
static void rna_def_userdef_theme_common_curves(BlenderRNA *brna)
static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
@ USER_ANIM_HIGH_QUALITY_DRAWING
@ USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS
@ USER_ANIM_SHOW_CHANNEL_GROUP_COLORS
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_preference_gpu_backend_items[]
@ USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED
static void rna_def_userdef_filepaths(BlenderRNA *brna)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ PROP_VARIABLES_PROJECT
Definition RNA_types.hh:577
void WM_reinit_gizmomap_all(Main *bmain)
void BKE_image_free_all_gpu_texture_caches(Main *bmain)
Definition image_gpu.cc:845
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
@ USER_SEQ_PROXY_SETUP_MANUAL
void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
Definition scene.cc:2872
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static const EnumPropertyItem rna_enum_userdef_theme_background_types_items[]
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:588
void RNA_def_property_float_default(PropertyRNA *prop, float value)
bool GPU_mem_stats_supported()
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
Global G
Definition blender.cc:57
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
static void rna_def_userdef_theme_space_gradient(BlenderRNA *brna)
static void rna_def_userdef_script_directory_collection(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
static void rna_def_userdef_solidlight(BlenderRNA *brna)
static void rna_def_userdef_keymap(BlenderRNA *brna)
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:593
static void rna_def_userdef_filepaths_extension_repo(BlenderRNA *brna)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void BLI_rng_get_char_n(RNG *rng, char *bytes, size_t bytes_len) ATTR_NONNULL(1
Definition rand.cc:70
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
ListBaseT< StudioLight > & BKE_studiolight_listbase()
@ USER_SECTION_EXPERIMENTAL
@ USER_SECTION_DEVELOPER_TOOLS
static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
@ ASSET_IMPORT_APPEND_REUSE
@ USER_PREF_FLAG_PROJECT_REMEMBER
@ USER_PREF_FLAG_PROJECT_SAVE
static void rna_def_userdef_script_directory(BlenderRNA *brna)
@ PROP_BOOLEAN
Definition RNA_types.hh:210
@ PROP_POINTER
Definition RNA_types.hh:215
@ PROP_STRING
Definition RNA_types.hh:213
@ PROP_COLLECTION
Definition RNA_types.hh:216
static const EnumPropertyItem rna_enum_studio_light_type_items[]
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void WM_keyconfig_reload(bContext *C)
Definition wm.cc:444
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
@ IDP_FLAG_STATIC_TYPE
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:138
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
static size_t max_memory_in_megabytes()
@ OB_MODE_TEXTURE_PAINT
BMesh const char void * data
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
static void rna_def_userdef_theme_space_common(StructRNA *srna)
void BKE_screen_header_alignment_reset(bScreen *screen)
Definition screen.cc:1303
void ED_userpref_asset_library_remove(bContext *C, struct bUserAssetLibrary *asset_library)
bAddonPrefType * BKE_addon_pref_type_find(const char *idname, bool quiet)
Definition addon.cc:86
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
struct bUserAssetLibrary * ED_userpref_asset_library_new(const struct bContext *C, const char *name, const char *dirpath, bUserAssetLibraryAddType library_type, bool is_project_defined, std::optional< UUID > uuid, std::optional< char * > auth_token)
bool BLI_windows_is_store_install(void)
static void rna_def_userdef_theme_space_generic(BlenderRNA *brna)
@ USER_EXTENSION_REPO_SOURCE_SYSTEM
@ USER_EXTENSION_REPO_SOURCE_USER
static const EnumPropertyItem rna_enum_language_default_items[]
void AS_asset_library_import_method_ensure_valid(Main &bmain)
@ USER_FILE_PREVIEW_CAMERA
@ USER_FILE_PREVIEW_SCREENSHOT
struct bAddon * BKE_addon_new()
Definition addon.cc:36
@ USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE
@ USER_GPU_FLAG_SUBDIVISION_EVALUATION
@ USER_GPU_FLAG_VIDEO_DECODING
@ USER_GPU_FLAG_WORKBENCH_RT_SHADOWS
@ USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE
@ USER_GPU_FLAG_FRESNEL_EDIT
void WM_init_input_devices()
static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
char ** BKE_sound_get_device_names()
void BKE_preferences_remote_asset_library_auth_token_set(bUserAssetLibrary *library, StringRef auth_token)
Update the remote URL authentication token.
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:277
MINLINE size_t min_zz(size_t a, size_t b)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
@ USER_FACTOR_AS_PERCENTAGE
@ USER_TEXT_EDIT_AUTO_CLOSE
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static void rna_def_userdef_theme_common_anim(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_main(StructRNA *srna)
void rna_userdef_is_dirty_update_impl()
@ USER_TRACKPAD_SCROLL_DIR_TRADITIONAL
@ USER_TRACKPAD_SCROLL_DIR_NATURAL
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
Definition rand.cc:55
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void BKE_preferences_extension_repo_remove(UserDef *userdef, bUserExtensionRepo *repo)
@ USER_XR_NAV_INVERT_ROTATION
static void rna_def_userdef_input(BlenderRNA *brna)
static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
void(*)(void *data) StructFreeFunc
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
static void rna_def_userdef_extensions(BlenderRNA *brna)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_userdef_pathcompare(BlenderRNA *brna)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void ED_reset_audio_device(bContext *C)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
static void rna_def_userdef_theme_common(BlenderRNA *brna)
static void rna_def_userdef_theme_ui(BlenderRNA *brna)
@ USER_EXTENSION_REPO_FLAG_DISABLED
@ USER_EXTENSION_REPO_FLAG_USE_REMOTE_URL
@ USER_EXTENSION_REPO_FLAG_USE_ACCESS_TOKEN_ASSET_LIBRARIES
@ USER_EXTENSION_REPO_FLAG_SYNC_ON_STARTUP
@ USER_EXTENSION_REPO_FLAG_NO_CACHE
@ USER_EXTENSION_REPO_FLAG_USE_ACCESS_TOKEN
@ USER_EXTENSION_REPO_FLAG_ASSET_LIBRARIES_COLLAPSED
@ USER_EXTENSION_REPO_FLAG_USE_CUSTOM_DIRECTORY
void BKE_studiolight_remove(StudioLight *sl)
static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
bool BKE_preferences_asset_library_is_available(const struct UserDef *userdef, const struct bUserAssetLibrary *library) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
@ USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT
@ USER_SEQ_ED_CLAMP_STRIPS_BY_DEFAULT
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
const EnumPropertyItem rna_enum_preference_section_items[]
static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
void BKE_preferences_asset_library_name_set(struct UserDef *userdef, struct bUserAssetLibrary *library, const char *name) ATTR_NONNULL()
void RNA_def_struct_flag(StructRNA *srna, StructFlag flag)
StudioLight * BKE_studiolight_load(const char *filepath, int type)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
void BLI_uuid_format(char *buffer, bUUID uuid) ATTR_NONNULL()
Definition uuid.cc:82
@ USER_TEMP_SPACE_DISPLAY_FULLSCREEN
@ USER_TEMP_SPACE_DISPLAY_WINDOW
static void rna_def_userdef_theme_regions_sidebars(BlenderRNA *brna)
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]
Definition rna_curve.cc:66
@ G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE
@ G_FLAG_INTERNET_ALLOW
@ G_FLAG_SCRIPT_AUTOEXEC
Main * CTX_data_main(const bContext *C)
static const EnumPropertyItem rna_enum_preferences_extension_repo_source_type_items[]
static void rna_def_userdef_theme_space_topbar(BlenderRNA *brna)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void BKE_preferences_remote_asset_library_url_set(bUserAssetLibrary *library, StringRef remote_url)
Update the remote URL and the cache directory derived from the URL.
static void rna_def_userdef_studiolights(BlenderRNA *brna)
@ NDOF_NAVIGATION_MODE_OBJECT
@ NDOF_NAVIGATION_MODE_DRONE
bUserExtensionRepo * BKE_preferences_extension_repo_add(UserDef *userdef, const char *name, const char *module, const char *custom_dirpath)
static void rna_def_userdef_theme_spaces_face(StructRNA *srna, const bool has_face_orientation)
@ USER_SCRIPT_AUTOEXEC_DISABLE
@ USER_HIDE_DOT_DATABLOCK
@ USER_TXT_TABSTOSPACES_DISABLE
@ USER_FLAG_NUMINPUT_ADVANCED
@ USER_FLAG_RECENT_SEARCHES_DISABLE
static void rna_def_userdef_theme_regions_asset_shelf(BlenderRNA *brna)
@ USER_NO_MULTITOUCH_GESTURES
@ USER_HIDE_SYSTEM_BOOKMARKS
@ USER_FILTER_BRUSHES_BY_TOOL
void BLF_cache_clear()
Definition blf.cc:100
const char * BLT_lang_get()
Definition blt_lang.cc:268
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void BKE_preferences_asset_library_path_set(struct bUserAssetLibrary *library, const char *path) ATTR_NONNULL()
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:477
@ PROP_EDITABLE
Definition RNA_types.hh:376
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:500
@ PROP_ENUM_FLAG
Definition RNA_types.hh:474
@ PROP_PATH_SUPPORTS_TEMPLATES
Definition RNA_types.hh:540
@ PROP_THICK_WRAP
Definition RNA_types.hh:493
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ PROP_REGISTER
Definition RNA_types.hh:481
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:526
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
@ PROP_HIDDEN
Definition RNA_types.hh:408
@ PROP_ANIMATABLE
Definition RNA_types.hh:389
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static const EnumPropertyItem rna_enum_preference_gpu_preferred_device_items[]
const EnumPropertyItem rna_enum_asset_access_items[]
Definition rna_space.cc:438
void BKE_addon_pref_type_remove(const bAddonPrefType *apt)
Definition addon.cc:114
void BKE_sculptsession_update_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
@ USER_VIDEO_DECODING_DEVICE_AUTOMATIC
@ USER_VIDEO_DECODING_DEVICE_CUDA
@ USER_VIDEO_DECODING_DEVICE_VULKAN
@ USER_VIDEO_DECODING_DEVICE_D3D11VA
@ USER_VIDEO_DECODING_DEVICE_VIDEOTOOLBOX
void WM_window_csd_params_update()
@ USER_SHADER_COMPILE_THREAD
@ USER_SHADER_COMPILE_SUBPROCESS
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
static const EnumPropertyItem rna_enum_key_insert_channels[]
@ USER_TABLET_SHOW_DEBUG_VALUES
Scene * CTX_data_scene(const bContext *C)
static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
static void rna_def_userdef_theme_regions_channels(BlenderRNA *brna)
static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_define_verify_sdna(bool verify)
@ AUTOKEY_FLAG_INSERTAVAILABLE
@ MANUALKEY_FLAG_INSERTNEEDED
@ AUTOKEY_FLAG_INSERTNEEDED
@ SCE_DISPLAY_AA_SAMPLES_8
@ SCE_DISPLAY_AA_SAMPLES_32
@ SCE_DISPLAY_AA_SAMPLES_5
@ SCE_DISPLAY_AA_SAMPLES_16
@ SCE_DISPLAY_AA_SAMPLES_11
void ED_userpref_asset_library_active_set(const struct bUserAssetLibrary &asset_library)
const EnumPropertyItem * BLT_lang_RNA_enum_properties()
Definition blt_lang.cc:186
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
@ PROP_PERCENTAGE
Definition RNA_types.hh:307
@ PROP_TIME_ABSOLUTE
Definition RNA_types.hh:311
@ PROP_FACTOR
Definition RNA_types.hh:308
@ PROP_VELOCITY
Definition RNA_types.hh:320
@ PROP_FILEPATH
Definition RNA_types.hh:284
@ PROP_DIRPATH
Definition RNA_types.hh:285
@ PROP_PASSWORD
Definition RNA_types.hh:298
@ PROP_DIRECTION
Definition RNA_types.hh:319
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:329
@ PROP_UNSIGNED
Definition RNA_types.hh:306
@ PARM_REQUIRED
Definition RNA_types.hh:631
@ PARM_RNAPTR
Definition RNA_types.hh:633
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
static void rna_def_userdef_experimental(BlenderRNA *brna)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
void BLF_default_size(float size)
const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[]
Definition rna_fcurve.cc:68
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
@ ZOOM_FRAME_MODE_KEEP_RANGE
@ ZOOM_FRAME_MODE_KEYFRAMES
static void rna_def_userdef_extension_repos_collection(BlenderRNA *brna, PropertyRNA *cprop)
Object * CTX_data_active_object(const bContext *C)
static void rna_def_userdef_edit(BlenderRNA *brna)
static void rna_def_userdef_preferences_asset_library(BlenderRNA *brna)
void RNA_def_property_array(PropertyRNA *prop, int length)
static void rna_def_userdef_view(BlenderRNA *brna)
@ USER_APP_LOCK_CORNER_SPLIT
@ USER_APP_HIDE_REGION_TOGGLE
@ USER_APP_LOCK_EDGE_RESIZE
static void rna_def_userdef_theme_collection_color(BlenderRNA *brna)
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
int(*)(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *list) StructCallbackFunc
@ USER_SPACEDATA_INPUT_HIDE_UI_KEYCONFIG
@ USER_SPACEDATA_ADDONS_SHOW_ONLY_ENABLED
static const EnumPropertyItem rna_enum_userdef_viewport_aa_items[]
void BKE_tempdir_init(const char *userdir)
Definition appdir.cc:1245
static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
struct bUserAssetLibrary * ED_userpref_asset_library_active_get()
@ USER_TEXT_RENDER_SUBPIXELAA
BlenderRNA RNA_blender_rna_get()
static const EnumPropertyItem audio_device_items[]
static void rna_def_userdef_asset_libraries(BlenderRNA *brna)
@ USER_RENDER_DISPLAY_WINDOW
@ USER_RENDER_DISPLAY_SCREEN
static void rna_def_userdef_xr_navigation(BlenderRNA *brna)
@ USER_SAVE_MODIFIED_IMAGES_ALWAYS
@ USER_SAVE_MODIFIED_IMAGES_ASK
@ USER_SAVE_MODIFIED_IMAGES_NEVER
@ USER_TIMECODE_SECONDS_ONLY
@ USER_TIMECODE_MILLISECONDS
_W64 int intptr_t
Definition BKE_text.h:119
static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna, const bool has_vertex_active)
size_t BKE_preferences_extension_repo_dirpath_get(const bUserExtensionRepo *repo, char *dirpath, int dirpath_maxncpy)
const EnumPropertyItem rna_enum_keyframe_handle_type_items[]
Definition rna_curve.cc:38
static const EnumPropertyItem rna_enum_date_format_items[]
void BKE_callback_exec(Main *bmain, PointerRNA **pointers, int pointers_num, eCbEvent evt)
Definition callbacks.cc:29
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
#define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE
#define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE
char name[64]
eUserpref_EmulateMMBMod mouse_emulate_3_button_modifier
eAutokey_Mode autokey_mode
uiFontStyle widget
#define N_(msgid)