Blender V5.0
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.h"
17#include "BLI_math_rotation.h"
19#ifdef WIN32
20# include "BLI_winstuff.h"
21#endif
22
23#include "BLT_translation.hh"
24
25#include "BKE_studiolight.h"
26
27#include "RNA_define.hh"
28#include "RNA_enum_types.hh"
29
30#include "GPU_platform.hh"
31
32#include "rna_internal.hh"
33
34#include "WM_api.hh"
35#include "WM_keymap.hh"
36#include "WM_types.hh"
37
38#include "BLT_lang.hh"
39
41 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
42 {USER_SECTION_VIEWPORT, "VIEWPORT", 0, "Viewport", ""},
43 {USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""},
44 {USER_SECTION_EDITING, "EDITING", 0, "Editing", ""},
45 {USER_SECTION_ANIMATION, "ANIMATION", 0, "Animation", ""},
48 "EXTENSIONS",
49 0,
50 "Get Extensions",
51 "Browse, install and manage extensions from remote and local repositories"},
53 {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", "Manage add-ons installed via Extensions"},
54 {USER_SECTION_THEME, "THEMES", 0, "Themes", "Edit and save themes installed via Extensions"},
55#if 0 /* def WITH_USERDEF_WORKSPACES */
57 {USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""},
58 {USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""},
59 {USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""},
60#endif
62 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
63 {USER_SECTION_NAVIGATION, "NAVIGATION", 0, "Navigation", ""},
64 {USER_SECTION_KEYMAP, "KEYMAP", 0, "Keymap", ""},
66 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
67 {USER_SECTION_SAVE_LOAD, "SAVE_LOAD", 0, "Save & Load", ""},
68 {USER_SECTION_FILE_PATHS, "FILE_PATHS", 0, "File Paths", ""},
70 {USER_SECTION_DEVELOPER_TOOLS, "DEVELOPER_TOOLS", 0, "Developer Tools", ""},
71 {USER_SECTION_EXPERIMENTAL, "EXPERIMENTAL", 0, "Experimental", ""},
72 {0, nullptr, 0, nullptr, nullptr},
73};
74
76 {0, "None", 0, "None", "No device - there will be no audio output"},
77 {0, nullptr, 0, nullptr, nullptr},
78};
79
82 "WALK",
83 0,
84 "Walk",
85 "Interactively walk or free navigate around the scene"},
86 {VIEW_NAVIGATION_FLY, "FLY", 0, "Fly", "Use fly dynamics to navigate the scene"},
87 {0, nullptr, 0, nullptr, nullptr},
88};
89
90#if defined(WITH_INTERNATIONAL) || !defined(RNA_RUNTIME)
92 {0,
93 "DEFAULT",
94 0,
95 "Automatic (Automatic)",
96 "Automatically choose the system-defined language if available, or fall-back to English "
97 "(US)"},
98 {0, nullptr, 0, nullptr, nullptr},
99};
100#endif
101
103 {STUDIOLIGHT_TYPE_STUDIO, "STUDIO", 0, "Studio", ""},
104 {STUDIOLIGHT_TYPE_WORLD, "WORLD", 0, "World", ""},
105 {STUDIOLIGHT_TYPE_MATCAP, "MATCAP", 0, "MatCap", ""},
106 {0, nullptr, 0, nullptr, nullptr},
107};
108
111 "OFF",
112 0,
113 "No Anti-Aliasing",
114 "Scene will be rendering without any anti-aliasing"},
116 "FXAA",
117 0,
118 "Single Pass Anti-Aliasing",
119 "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
121 "5",
122 0,
123 "5 Samples",
124 "Scene will be rendered using 5 anti-aliasing samples"},
126 "8",
127 0,
128 "8 Samples",
129 "Scene will be rendered using 8 anti-aliasing samples"},
131 "11",
132 0,
133 "11 Samples",
134 "Scene will be rendered using 11 anti-aliasing samples"},
136 "16",
137 0,
138 "16 Samples",
139 "Scene will be rendered using 16 anti-aliasing samples"},
141 "32",
142 0,
143 "32 Samples",
144 "Scene will be rendered using 32 anti-aliasing samples"},
145 {0, nullptr, 0, nullptr, nullptr},
146};
147
149 {USER_ANIM_KEY_CHANNEL_LOCATION, "LOCATION", 0, "Location", ""},
150 {USER_ANIM_KEY_CHANNEL_ROTATION, "ROTATION", 0, "Rotation", ""},
151 {USER_ANIM_KEY_CHANNEL_SCALE, "SCALE", 0, "Scale", ""},
152 {USER_ANIM_KEY_CHANNEL_ROTATION_MODE, "ROTATE_MODE", 0, "Rotation Mode", ""},
153 {USER_ANIM_KEY_CHANNEL_CUSTOM_PROPERTIES, "CUSTOM_PROPS", 0, "Custom Properties", ""},
154 {0, nullptr, 0, nullptr, nullptr},
155};
156
158 {GPU_BACKEND_OPENGL, "OPENGL", 0, "OpenGL", "Use OpenGL backend"},
159 {GPU_BACKEND_METAL, "METAL", 0, "Metal", "Use Metal backend"},
160 {GPU_BACKEND_VULKAN, "VULKAN", 0, "Vulkan", "Use Vulkan backend"},
161 {0, nullptr, 0, nullptr, nullptr},
162};
164 {0, "AUTO", 0, "Auto", "Auto detect best GPU for running Blender"},
166 {0, nullptr, 0, nullptr, nullptr},
167};
168
171 "USER",
172 0,
173 "User",
174 "Repository managed by the user, stored in user directories"},
176 "SYSTEM",
177 0,
178 "System",
179 "Read-only repository provided by the system"},
180 {0, nullptr, 0, nullptr, nullptr},
181};
182
184 {ASSET_IMPORT_LINK, "LINK", ICON_LINK_BLEND, "Link", "Import the assets as linked data-block"},
186 "APPEND",
187 ICON_APPEND_BLEND,
188 "Append",
189 "Import the assets as copied data-block, with no link to the original asset data-block"},
191 "APPEND_REUSE",
192 ICON_APPEND_BLEND,
193 "Append (Reuse Data)",
194 "Import the assets as copied data-block while avoiding multiple copies of nested, "
195 "typically heavy data. For example the textures of a material asset, or the mesh of an "
196 "object asset, don't have to be copied every time this asset is imported. The instances of "
197 "the asset share the data instead."},
199 "PACK",
200 ICON_PACKAGE,
201 "Pack",
202 "Import the asset as linked data-block, and pack it in the current file (ensures that it "
203 "remains unchanged in case the library data is modified, is not available anymore, etc.)"},
204 {0, nullptr, 0, nullptr, nullptr},
205};
206
207#ifdef RNA_RUNTIME
208
209# include "BLI_math_vector.h"
210# include "BLI_memory_cache.hh"
211# include "BLI_string_utils.hh"
212
213# include "DNA_object_types.h"
214# include "DNA_screen_types.h"
215
216# include "BKE_addon.h"
217# include "BKE_appdir.hh"
218# include "BKE_blender.hh"
219# include "BKE_blender_version.h"
220# include "BKE_callbacks.hh"
221# include "BKE_global.hh"
222# include "BKE_idprop.hh"
223# include "BKE_image.hh"
224# include "BKE_main.hh"
225# include "BKE_mesh_runtime.hh"
226# include "BKE_object.hh"
227# include "BKE_paint.hh"
228# include "BKE_preferences.h"
229# include "BKE_screen.hh"
230# include "BKE_sound.h"
231
232# include "DEG_depsgraph.hh"
233
234# include "GPU_capabilities.hh"
235# include "GPU_select.hh"
236# include "GPU_texture.hh"
237
238# include "BLF_api.hh"
239
240# include "BLI_path_utils.hh"
241
242# include "MEM_CacheLimiterC-Api.h"
243# include "MEM_guardedalloc.h"
244
245# include "ED_asset_list.hh"
246# include "ED_screen.hh"
247
248# include "UI_interface.hh"
249
250# include "AS_asset_library.hh"
251
252static void rna_userdef_version_get(PointerRNA *ptr, int *value)
253{
254 UserDef *userdef = (UserDef *)ptr->data;
255 value[0] = userdef->versionfile / 100;
256 value[1] = userdef->versionfile % 100;
257 value[2] = userdef->subversionfile;
258}
259
261# define USERDEF_TAG_DIRTY rna_userdef_is_dirty_update_impl()
262
264{
265 /* We can't use 'ptr->data' because this update function
266 * is used for themes and other nested data. */
267 if (U.runtime.is_dirty == false) {
268 U.runtime.is_dirty = true;
270 }
271}
272
273void rna_userdef_is_dirty_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
274{
275 /* WARNING: never use 'ptr' unless its type is checked. */
277}
278
280static void rna_userdef_ui_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
281{
283}
284
285static void rna_userdef_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
286{
288 USERDEF_TAG_DIRTY;
289}
290
291static void rna_userdef_theme_update(Main *bmain, Scene *scene, PointerRNA *ptr)
292{
293 /* Recreate gizmos when changing themes. */
295
296 rna_userdef_update(bmain, scene, ptr);
297}
298
299static void rna_userdef_theme_text_style_update(Main *bmain, Scene *scene, PointerRNA *ptr)
300{
301 const uiStyle *style = UI_style_get();
303
304 rna_userdef_update(bmain, scene, ptr);
305}
306
307static void rna_userdef_gizmo_update(Main *bmain, Scene *scene, PointerRNA *ptr)
308{
310
311 rna_userdef_update(bmain, scene, ptr);
312}
313
314static void rna_userdef_theme_update_icons(Main *bmain, Scene *scene, PointerRNA *ptr)
315{
316 rna_userdef_theme_update(bmain, scene, ptr);
317}
318
319/* also used by buffer swap switching */
320static void rna_userdef_gpu_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
321{
322 /* font's are stored at each DPI level, without this we can easy load 100's of fonts */
324
325 WM_main_add_notifier(NC_WINDOW, nullptr); /* full redraw */
326 WM_main_add_notifier(NC_SCREEN | NA_EDITED, nullptr); /* refresh region sizes */
327 USERDEF_TAG_DIRTY;
328}
329
330static void rna_userdef_screen_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
331{
333 WM_main_add_notifier(NC_SCREEN | NA_EDITED, nullptr); /* refresh region sizes */
334 USERDEF_TAG_DIRTY;
335}
336
337static void rna_userdef_screen_update_header_default(Main *bmain, Scene *scene, PointerRNA *ptr)
338{
339 if (U.uiflag & USER_HEADER_FROM_PREF) {
340 for (bScreen *screen = static_cast<bScreen *>(bmain->screens.first); screen;
341 screen = static_cast<bScreen *>(screen->id.next))
342 {
344 }
345 rna_userdef_screen_update(bmain, scene, ptr);
346 }
347 USERDEF_TAG_DIRTY;
348}
349
350static void rna_userdef_font_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
351{
355}
356
357static void rna_userdef_language_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
358{
359 BLT_lang_set(nullptr);
360
362 /* If changing language without current userprefs, enable all usage options. */
364 }
365
367 USERDEF_TAG_DIRTY;
368}
369
370static void rna_userdef_translation_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
371{
374 USERDEF_TAG_DIRTY;
375}
376
377static void rna_userdef_asset_library_name_set(PointerRNA *ptr, const char *value)
378{
379 bUserAssetLibrary *library = (bUserAssetLibrary *)ptr->data;
381}
382
383static void rna_userdef_asset_library_path_set(PointerRNA *ptr, const char *value)
384{
385 bUserAssetLibrary *library = (bUserAssetLibrary *)ptr->data;
387}
388
389static void rna_userdef_asset_library_update(bContext *C, PointerRNA *ptr)
390{
392 rna_userdef_update(CTX_data_main(C), CTX_data_scene(C), ptr);
393}
394
400static void rna_userdef_extension_sync_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
401{
404 USERDEF_TAG_DIRTY;
405}
406
407static void rna_userdef_extension_repo_name_set(PointerRNA *ptr, const char *value)
408{
411}
412
413static void rna_userdef_extension_repo_module_set(PointerRNA *ptr, const char *value)
414{
415 Main *bmain = G.main;
420}
421
422static void rna_userdef_extension_repo_custom_directory_set(PointerRNA *ptr, const char *value)
423{
424 Main *bmain = G.main;
429}
430
431static void rna_userdef_extension_repo_directory_get(PointerRNA *ptr, char *value)
432{
433 const bUserExtensionRepo *repo = (bUserExtensionRepo *)ptr->data;
435}
436
437static int rna_userdef_extension_repo_directory_length(PointerRNA *ptr)
438{
439 const bUserExtensionRepo *repo = (bUserExtensionRepo *)ptr->data;
440 char dirpath[FILE_MAX];
441 return BKE_preferences_extension_repo_dirpath_get(repo, dirpath, sizeof(dirpath));
442}
443
444static void rna_userdef_extension_repo_access_token_get(PointerRNA *ptr, char *value)
445{
446 const bUserExtensionRepo *repo = (bUserExtensionRepo *)ptr->data;
447 if (repo->access_token) {
448 strcpy(value, repo->access_token);
449 }
450 else {
451 value[0] = '\0';
452 }
453}
454
455static int rna_userdef_extension_repo_access_token_length(PointerRNA *ptr)
456{
457 const bUserExtensionRepo *repo = (bUserExtensionRepo *)ptr->data;
458 return (repo->access_token) ? strlen(repo->access_token) : 0;
459}
460
461static void rna_userdef_extension_repo_access_token_set(PointerRNA *ptr, const char *value)
462{
464 if (repo->access_token) {
465 MEM_freeN(repo->access_token);
466 }
467 repo->access_token = value[0] ? BLI_strdup(value) : nullptr;
468}
469
470static void rna_userdef_extension_repo_generic_flag_set_impl(PointerRNA *ptr,
471 const bool value,
472 const int flag)
473{
474 Main *bmain = G.main;
477 SET_FLAG_FROM_TEST(repo->flag, value, flag);
479}
480
481static void rna_userdef_extension_repo_enabled_set(PointerRNA *ptr, bool value)
482{
483 rna_userdef_extension_repo_generic_flag_set_impl(ptr, !value, USER_EXTENSION_REPO_FLAG_DISABLED);
484}
485
486static void rna_userdef_extension_repo_use_custom_directory_set(PointerRNA *ptr, bool value)
487{
488 rna_userdef_extension_repo_generic_flag_set_impl(
490}
491
492static void rna_userdef_extension_repo_use_remote_url_set(PointerRNA *ptr, bool value)
493{
494 rna_userdef_extension_repo_generic_flag_set_impl(
496}
497
498static void rna_userdef_extension_repo_source_set(PointerRNA *ptr, int value)
499{
500 Main *bmain = G.main;
503 repo->source = value;
505}
506
507static void rna_userdef_script_autoexec_update(Main * /*bmain*/,
508 Scene * /*scene*/,
510{
511 UserDef *userdef = (UserDef *)ptr->data;
512 if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) {
514 }
515 else {
517 }
518
519 USERDEF_TAG_DIRTY;
520}
521
522static void rna_userdef_use_online_access_set(PointerRNA *ptr, bool value)
523{
524 /* A `set` function is needed to clear the override flags. */
525 UserDef *userdef = (UserDef *)ptr->data;
526
527 if ((G.f & G_FLAG_INTERNET_ALLOW) == 0) {
529 /* The `editable` check should account for this, assert since this is security related. */
531 return;
532 }
533 }
534
535 if (value) {
536 userdef->flag |= USER_INTERNET_ALLOW;
538 }
539 else {
540 userdef->flag &= ~USER_INTERNET_ALLOW;
542 }
543
544 /* Once the user edits this option (even to set it to the value it was)
545 * it's no longer considered overridden. */
547}
548
549static int rna_userdef_use_online_access_editable(const PointerRNA * /*ptr*/, const char **r_info)
550{
551 if ((G.f & G_FLAG_INTERNET_ALLOW) == 0) {
552 /* Return 0 when blender was invoked with `--offline-mode` "forced". */
554 *r_info = N_("Launched with \"--offline-mode\", cannot be changed");
555 return 0;
556 }
557 }
558 return PROP_EDITABLE;
559}
560
561static void rna_userdef_script_directory_name_set(PointerRNA *ptr, const char *value)
562{
563 bUserScriptDirectory *script_dir = static_cast<bUserScriptDirectory *>(ptr->data);
564 bool value_invalid = false;
565
566 if (!value[0]) {
567 value_invalid = true;
568 }
569 if (STREQ(value, "DEFAULT")) {
570 value_invalid = true;
571 }
572
573 if (value_invalid) {
574 value = DATA_("Untitled");
575 }
576
577 STRNCPY_UTF8(script_dir->name, value);
578 BLI_uniquename(&U.script_directories,
579 script_dir,
580 value,
581 '.',
583 sizeof(script_dir->name));
584}
585
586static bUserScriptDirectory *rna_userdef_script_directory_new()
587{
589 BLI_addtail(&U.script_directories, script_dir);
590 USERDEF_TAG_DIRTY;
591 return script_dir;
592}
593
594static void rna_userdef_script_directory_remove(ReportList *reports, PointerRNA *ptr)
595{
596 bUserScriptDirectory *script_dir = static_cast<bUserScriptDirectory *>(ptr->data);
597 if (BLI_findindex(&U.script_directories, script_dir) == -1) {
598 BKE_report(reports, RPT_ERROR, "Script directory not found");
599 return;
600 }
601
602 BLI_freelinkN(&U.script_directories, script_dir);
603 ptr->invalidate();
604 USERDEF_TAG_DIRTY;
605}
606
607static bUserAssetLibrary *rna_userdef_asset_library_new(const bContext *C,
608 const char *name,
609 const char *directory)
610{
612 &U, name ? name : "", directory ? directory : "");
613
615
616 /* Trigger refresh for the Asset Browser. */
618
619 USERDEF_TAG_DIRTY;
620 return new_library;
621}
622
623static void rna_userdef_asset_library_remove(bContext *C, ReportList *reports, PointerRNA *ptr)
624{
625 bUserAssetLibrary *library = static_cast<bUserAssetLibrary *>(ptr->data);
626
627 if (BLI_findindex(&U.asset_libraries, library) == -1) {
628 BKE_report(reports, RPT_ERROR, "Asset Library not found");
629 return;
630 }
631
634
635 /* Update active library index to be in range. */
636 const int count_remaining = BLI_listbase_count(&U.asset_libraries);
637 CLAMP(U.active_asset_library, 0, count_remaining - 1);
638
639 /* Trigger refresh for the Asset Browser. */
641
642 ptr->invalidate();
643 USERDEF_TAG_DIRTY;
644}
645
646static bUserExtensionRepo *rna_userdef_extension_repo_new(const char *name,
647 const char *module,
648 const char *custom_directory,
649 const char *remote_url,
650 const int source)
651{
652 Main *bmain = G.main;
654
656 &U, name ? name : "", module ? module : "", custom_directory ? custom_directory : "");
657
658 if (remote_url) {
659 STRNCPY(repo->remote_url, remote_url);
660 }
661
662 if (repo->remote_url[0]) {
664 }
665 if (repo->custom_dirpath[0]) {
667 }
668
669 repo->source = source;
670
672 USERDEF_TAG_DIRTY;
673 return repo;
674}
675
676static void rna_userdef_extension_repo_remove(ReportList *reports, PointerRNA *ptr)
677{
678 Main *bmain = G.main;
680
681 bUserExtensionRepo *repo = static_cast<bUserExtensionRepo *>(ptr->data);
682 if (BLI_findindex(&U.extension_repos, repo) == -1) {
683 BKE_report(reports, RPT_ERROR, "Extension repository not found");
684 return;
685 }
687 ptr->invalidate();
688
690 USERDEF_TAG_DIRTY;
691}
692
693static void rna_userdef_load_ui_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
694{
695 UserDef *userdef = (UserDef *)ptr->data;
696 if (userdef->flag & USER_FILENOUI) {
697 G.fileflags |= G_FILE_NO_UI;
698 }
699 else {
700 G.fileflags &= ~G_FILE_NO_UI;
701 }
702
703 USERDEF_TAG_DIRTY;
704}
705
706static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr)
707{
709 rna_userdef_update(bmain, scene, ptr);
710}
711
712static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
713{
715 rna_userdef_update(bmain, scene, ptr);
716}
717
718static void rna_userdef_undo_steps_set(PointerRNA *ptr, int value)
719{
720 UserDef *userdef = (UserDef *)ptr->data;
721
722 /* Do not allow 1 undo steps, useless and breaks undo/redo process (see #42531). */
723 userdef->undosteps = (value == 1) ? 2 : value;
724}
725
726static int rna_userdef_autokeymode_get(PointerRNA *ptr)
727{
728 UserDef *userdef = (UserDef *)ptr->data;
729 short retval = userdef->autokey_mode;
730
731 if (!(userdef->autokey_mode & AUTOKEY_ON)) {
732 retval |= AUTOKEY_ON;
733 }
734
735 return retval;
736}
737
738static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
739{
740 UserDef *userdef = (UserDef *)ptr->data;
741
742 if (value == AUTOKEY_MODE_NORMAL) {
743 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
744 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
745 }
746 else if (value == AUTOKEY_MODE_EDITKEYS) {
747 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
748 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
749 }
750}
751
752static void rna_userdef_anim_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
753{
756 USERDEF_TAG_DIRTY;
757}
758
759static void rna_userdef_input_devices(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
760{
762 USERDEF_TAG_DIRTY;
763}
764
765# ifdef WITH_INPUT_NDOF
766static void rna_userdef_ndof_deadzone_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
767{
768 UserDef *userdef = static_cast<UserDef *>(ptr->data);
769 WM_ndof_deadzone_set(userdef->ndof_deadzone);
770 USERDEF_TAG_DIRTY;
771}
772# endif
773
774static void rna_userdef_keyconfig_reload_update(bContext *C,
775 Main * /*bmain*/,
776 Scene * /*scene*/,
777 PointerRNA * /*ptr*/)
778{
780 USERDEF_TAG_DIRTY;
781}
782
783static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
784{
785 UserDef *userdef = (UserDef *)ptr->data;
786 int required_size = userdef->v2d_min_gridsize;
787
788 /* Set the time-code style. */
789 userdef->timecode_style = value;
790
791 /* Adjust the v2d grid-size if needed so that time-codes don't overlap
792 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
793 * things from getting too blown out. */
794 switch (value) {
797 /* 35 is great most of the time, but not that great for full-blown */
798 required_size = 35;
799 break;
801 required_size = 50;
802 break;
804 /* the granddaddy! */
805 required_size = 65;
806 break;
808 required_size = 45;
809 break;
810 }
811
812 if (U.v2d_min_gridsize < required_size) {
813 U.v2d_min_gridsize = required_size;
814 }
815}
816
817static int rna_UserDef_mouse_emulate_3_button_modifier_get(PointerRNA *ptr)
818{
819# if !defined(WIN32)
820 UserDef *userdef = static_cast<UserDef *>(ptr->data);
821 return userdef->mouse_emulate_3_button_modifier;
822# else
825# endif
826}
827
828static const EnumPropertyItem *rna_UseDef_active_section_itemf(bContext * /*C*/,
830 PropertyRNA * /*prop*/,
831 bool *r_free)
832{
833 UserDef *userdef = static_cast<UserDef *>(ptr->data);
834
835 const bool use_developer_ui = (userdef->flag & USER_DEVELOPER_UI) != 0;
836 const bool is_alpha = BKE_blender_version_is_alpha();
837
838 if (use_developer_ui && is_alpha) {
839 *r_free = false;
841 }
842
843 EnumPropertyItem *items = nullptr;
844 int totitem = 0;
845
846 for (const EnumPropertyItem *it = rna_enum_preference_section_items; it->identifier != nullptr;
847 it++)
848 {
849 if (it->value == USER_SECTION_EXPERIMENTAL) {
850 if (is_alpha == false) {
851 continue;
852 }
853 }
854 else if (it->value == USER_SECTION_DEVELOPER_TOOLS) {
855 if (use_developer_ui == false) {
856 continue;
857 }
858 }
859
860 RNA_enum_item_add(&items, &totitem, it);
861 }
862
863 RNA_enum_item_end(&items, &totitem);
864
865 *r_free = true;
866 return items;
867}
868
869static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
870{
871 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesView, ptr->data);
872}
873
874static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
875{
876 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesEdit, ptr->data);
877}
878
879static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
880{
881 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesInput, ptr->data);
882}
883
884static PointerRNA rna_UserDef_keymap_get(PointerRNA *ptr)
885{
886 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesKeymap, ptr->data);
887}
888
889static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
890{
891 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesFilePaths, ptr->data);
892}
893
894static PointerRNA rna_UserDef_extensions_get(PointerRNA *ptr)
895{
896 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesExtensions, ptr->data);
897}
898
899static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
900{
901 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesSystem, ptr->data);
902}
903
904static PointerRNA rna_UserDef_apps_get(PointerRNA *ptr)
905{
906 return RNA_pointer_create_with_parent(*ptr, &RNA_PreferencesApps, ptr->data);
907}
908
909/* Reevaluate objects with a subsurf modifier as the last in their modifiers stacks. */
910static void rna_UserDef_subdivision_update(Main *bmain, Scene *scene, PointerRNA *ptr)
911{
912 Object *ob;
913
914 for (ob = static_cast<Object *>(bmain->objects.first); ob;
915 ob = static_cast<Object *>(ob->id.next))
916 {
917 if (BKE_object_get_last_subsurf_modifier(ob) != nullptr) {
919 }
920 }
921
922 rna_userdef_update(bmain, scene, ptr);
923}
924
925static void rna_UserDef_audio_update(bContext *C, PointerRNA * /*ptr*/)
926{
928 USERDEF_TAG_DIRTY;
929}
930
931static void rna_Userdef_memcache_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
932{
933 const int64_t new_limit = int64_t(U.memcachelimit) * 1024 * 1024;
936 USERDEF_TAG_DIRTY;
937}
938
939static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
940{
941 Object *ob;
942
943 for (ob = static_cast<Object *>(bmain->objects.first); ob;
944 ob = static_cast<Object *>(ob->id.next))
945 {
946 if (ob->mode & OB_MODE_WEIGHT_PAINT) {
948 }
949 }
950
951 rna_userdef_update(bmain, scene, ptr);
952}
953
954static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
955{
956 /* If all lights are off gpu_draw resets them all, see: #27627,
957 * so disallow them all to be disabled. */
958 if (U.light_param[0].flag == 0 && U.light_param[1].flag == 0 && U.light_param[2].flag == 0 &&
959 U.light_param[3].flag == 0)
960 {
961 SolidLight *light = static_cast<SolidLight *>(ptr->data);
962 light->flag |= 1;
963 }
964
966 rna_userdef_update(bmain, scene, ptr);
967}
968
969static bool rna_userdef_is_microsoft_store_install_get(PointerRNA * /*ptr*/)
970{
971# ifdef WIN32
973# endif
974 return false;
975}
976
977static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
978{
979 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
980
981 if (wm) {
983 }
984 rna_userdef_update(bmain, scene, ptr);
985}
986
987# define RNA_USERDEF_EXPERIMENTAL_BOOLEAN_GET(member) \
988 static bool rna_userdef_experimental_##member##_get(PointerRNA *ptr) \
989 { \
990 UserDef *userdef = POINTER_OFFSET(ptr->data, -offsetof(UserDef, experimental)); \
991 return USER_EXPERIMENTAL_TEST(userdef, member); \
992 }
993
994static bAddon *rna_userdef_addon_new()
995{
996 ListBase *addons_list = &U.addons;
997 bAddon *addon = BKE_addon_new();
998 BLI_addtail(addons_list, addon);
999 USERDEF_TAG_DIRTY;
1000 return addon;
1001}
1002
1003static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *addon_ptr)
1004{
1005 ListBase *addons_list = &U.addons;
1006 bAddon *addon = static_cast<bAddon *>(addon_ptr->data);
1007 if (BLI_findindex(addons_list, addon) == -1) {
1008 BKE_report(reports, RPT_ERROR, "Add-on is no longer valid");
1009 return;
1010 }
1011 BLI_remlink(addons_list, addon);
1012 BKE_addon_free(addon);
1013 addon_ptr->invalidate();
1014 USERDEF_TAG_DIRTY;
1015}
1016
1017static bPathCompare *rna_userdef_pathcompare_new()
1018{
1019 bPathCompare *path_cmp = MEM_callocN<bPathCompare>("bPathCompare");
1020 BLI_addtail(&U.autoexec_paths, path_cmp);
1021 USERDEF_TAG_DIRTY;
1022 return path_cmp;
1023}
1024
1025static void rna_userdef_pathcompare_remove(ReportList *reports, PointerRNA *path_cmp_ptr)
1026{
1027 bPathCompare *path_cmp = static_cast<bPathCompare *>(path_cmp_ptr->data);
1028 if (BLI_findindex(&U.autoexec_paths, path_cmp) == -1) {
1029 BKE_report(reports, RPT_ERROR, "Excluded path is no longer valid");
1030 return;
1031 }
1032
1033 BLI_freelinkN(&U.autoexec_paths, path_cmp);
1034 path_cmp_ptr->invalidate();
1035 USERDEF_TAG_DIRTY;
1036}
1037
1038static void rna_userdef_temp_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1039{
1040 BKE_tempdir_init(U.tempdir);
1041 USERDEF_TAG_DIRTY;
1042}
1043
1044static void rna_userdef_text_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1045{
1049 USERDEF_TAG_DIRTY;
1050}
1051
1052static PointerRNA rna_Theme_space_generic_get(PointerRNA *ptr)
1053{
1054 return RNA_pointer_create_with_parent(*ptr, &RNA_ThemeSpaceGeneric, ptr->data);
1055}
1056
1057static PointerRNA rna_Theme_gradient_colors_get(PointerRNA *ptr)
1058{
1059 return RNA_pointer_create_with_parent(*ptr, &RNA_ThemeGradientColors, ptr->data);
1060}
1061
1062static PointerRNA rna_Theme_space_gradient_get(PointerRNA *ptr)
1063{
1064 return RNA_pointer_create_with_parent(*ptr, &RNA_ThemeSpaceGradient, ptr->data);
1065}
1066
1067static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext * /*C*/,
1068 PointerRNA * /*ptr*/,
1069 PropertyRNA * /*prop*/,
1070 bool *r_free)
1071{
1072 int index = 0;
1073 int totitem = 0;
1074 EnumPropertyItem *item = nullptr;
1075
1076 int i;
1077
1078 char **names = BKE_sound_get_device_names();
1079
1080 for (i = 0; names[i]; i++) {
1081 EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]};
1082 RNA_enum_item_add(&item, &totitem, &new_item);
1083 }
1084
1085# if !defined(NDEBUG) || !defined(WITH_AUDASPACE)
1086 if (i == 0) {
1087 EnumPropertyItem new_item = {i, "SOUND_NONE", 0, "No Sound", ""};
1088 RNA_enum_item_add(&item, &totitem, &new_item);
1089 }
1090# endif
1091
1092 /* may be unused */
1094
1095 RNA_enum_item_end(&item, &totitem);
1096 *r_free = true;
1097
1098 return item;
1099}
1100
1101# ifdef WITH_INTERNATIONAL
1102static const EnumPropertyItem *rna_lang_enum_properties_itemf(bContext * /*C*/,
1103 PointerRNA * /*ptr*/,
1104 PropertyRNA * /*prop*/,
1105 bool * /*r_free*/)
1106{
1108 if (items == nullptr) {
1110 }
1111 return items;
1112}
1113# else
1114static int rna_lang_enum_properties_get_no_international(PointerRNA * /*ptr*/)
1115{
1116 /* This simply prevents warnings when accessing language
1117 * (since the actual value wont be in the enum, unless already `DEFAULT`). */
1118 return 0;
1119}
1120# endif
1121
1122static void rna_Theme_name_set(PointerRNA *ptr, const char *value)
1123{
1124 bTheme *btheme = static_cast<bTheme *>(ptr->data);
1125 STRNCPY_UTF8(btheme->name, value);
1126 BLI_uniquename(&U.themes, btheme, "Theme", '.', offsetof(bTheme, name), sizeof(btheme->name));
1127}
1128
1129static void rna_Addon_module_set(PointerRNA *ptr, const char *value)
1130{
1131 bAddon *addon = (bAddon *)ptr->data;
1132
1133 /* The module may be empty (for newly created data), skip the preferences search.
1134 * Note that changing existing add-ons module isn't a common operation.
1135 * Support this to allow for an extension repositories module to change at run-time. */
1136 bAddonPrefType *apt = addon->module[0] ? BKE_addon_pref_type_find(addon->module, true) : nullptr;
1137
1138 size_t module_len = STRNCPY_UTF8_RLEN(addon->module, value);
1139
1140 /* Reserve half of `bAddon::module` for a package component.
1141 * Ensure the trailing component is less than half `sizeof(bAddon::module)`.
1142 * This is needed because the size of the add-on name should never work on not depending on
1143 * the user defined module prefix. Trimming off the trailing characters is a silent failure
1144 * however there isn't a practical way to notify the user an over long name was used.
1145 * In practice this is something only add-on developers should run into,
1146 * so it's more of a paper cut for developers. */
1147 const size_t submodule_len_limit = sizeof(bAddon::module) / 2;
1148 if (UNLIKELY(module_len >= submodule_len_limit)) {
1149 char *submodule_end = addon->module + module_len;
1150 char *submodule_beg = addon->module;
1151 for (size_t i = module_len - 1; i > 0; i--) {
1152 if (addon->module[i] == '.') {
1153 submodule_beg = addon->module + i;
1154 break;
1155 }
1156 }
1157 if ((submodule_end - submodule_beg) > submodule_len_limit) {
1158 submodule_beg[submodule_len_limit] = '\0';
1159 BLI_str_utf8_invalid_strip(submodule_beg, submodule_len_limit);
1160 }
1161 }
1162
1163 if (apt) {
1164 /* Keep the associated preferences. */
1165 STRNCPY(apt->idname, addon->module);
1166 }
1167}
1168
1169static IDProperty **rna_AddonPref_idprops(PointerRNA *ptr)
1170{
1171 return (IDProperty **)&ptr->data;
1172}
1173
1174static PointerRNA rna_Addon_preferences_get(PointerRNA *ptr)
1175{
1176 bAddon *addon = (bAddon *)ptr->data;
1177 bAddonPrefType *apt = BKE_addon_pref_type_find(addon->module, true);
1178 if (apt) {
1179 if (addon->prop == nullptr) {
1180 /* name is unimportant. */
1181 addon->prop =
1183 }
1184 return RNA_pointer_create_with_parent(*ptr, apt->rna_ext.srna, addon->prop);
1185 }
1186 else {
1187 return PointerRNA_NULL;
1188 }
1189}
1190
1191static bool rna_AddonPref_unregister(Main * /*bmain*/, StructRNA *type)
1192{
1193 bAddonPrefType *apt = static_cast<bAddonPrefType *>(RNA_struct_blender_type_get(type));
1194
1195 if (!apt) {
1196 return false;
1197 }
1198
1199 RNA_struct_free_extension(type, &apt->rna_ext);
1201
1203
1204 /* update while blender is running */
1206 return true;
1207}
1208
1209static StructRNA *rna_AddonPref_register(Main *bmain,
1210 ReportList *reports,
1211 void *data,
1212 const char *identifier,
1213 StructValidateFunc validate,
1214 StructCallbackFunc call,
1216{
1217 const char *error_prefix = "Registering add-on preferences class:";
1218 bAddonPrefType *apt, dummy_apt = {{'\0'}};
1219 bAddon dummy_addon = {nullptr};
1220 // bool have_function[1];
1221
1222 /* Setup dummy add-on preference and it's type to store static properties in. */
1223 PointerRNA dummy_addon_ptr = RNA_pointer_create_discrete(
1224 nullptr, &RNA_AddonPreferences, &dummy_addon);
1225
1226 /* validate the python class */
1227 if (validate(&dummy_addon_ptr, data, nullptr /*have_function*/) != 0) {
1228 return nullptr;
1229 }
1230
1231 STRNCPY(dummy_apt.idname, dummy_addon.module);
1232 if (strlen(identifier) >= sizeof(dummy_apt.idname)) {
1233 BKE_reportf(reports,
1234 RPT_ERROR,
1235 "%s '%s' is too long, maximum length is %d",
1236 error_prefix,
1237 identifier,
1238 int(sizeof(dummy_apt.idname)));
1239 return nullptr;
1240 }
1241
1242 /* Check if we have registered this add-on preference type before, and remove it. */
1243 apt = BKE_addon_pref_type_find(dummy_addon.module, true);
1244 if (apt) {
1245 BKE_reportf(reports,
1246 RPT_INFO,
1247 "%s '%s', bl_idname '%s' has been registered before, unregistering previous",
1248 error_prefix,
1249 identifier,
1250 dummy_apt.idname);
1251
1252 StructRNA *srna = apt->rna_ext.srna;
1253 if (!(srna && rna_AddonPref_unregister(bmain, srna))) {
1254 BKE_reportf(reports,
1255 RPT_ERROR,
1256 "%s '%s', bl_idname '%s' %s",
1257 error_prefix,
1258 identifier,
1259 dummy_apt.idname,
1260 srna ? "is built-in" : "could not be unregistered");
1261
1262 return nullptr;
1263 }
1264 }
1265
1266 /* Create a new add-on preference type. */
1267 apt = MEM_mallocN<bAddonPrefType>("addonpreftype");
1268 memcpy(apt, &dummy_apt, sizeof(dummy_apt));
1270
1271 apt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_AddonPreferences);
1272 apt->rna_ext.data = data;
1273 apt->rna_ext.call = call;
1274 apt->rna_ext.free = free;
1275 RNA_struct_blender_type_set(apt->rna_ext.srna, apt);
1276
1277 // apt->draw = (have_function[0]) ? header_draw : nullptr;
1278
1279 /* update while blender is running */
1281
1282 return apt->rna_ext.srna;
1283}
1284
1285/* placeholder, doesn't do anything useful yet */
1286static StructRNA *rna_AddonPref_refine(PointerRNA *ptr)
1287{
1288 return (ptr->type) ? ptr->type : &RNA_AddonPreferences;
1289}
1290
1291static float rna_ThemeUI_roundness_get(PointerRNA *ptr)
1292{
1293 /* Remap from relative radius to 0..1 range. */
1294 uiWidgetColors *tui = (uiWidgetColors *)ptr->data;
1295 return tui->roundness * 2.0f;
1296}
1297
1298static void rna_ThemeUI_roundness_set(PointerRNA *ptr, float value)
1299{
1300 uiWidgetColors *tui = (uiWidgetColors *)ptr->data;
1301 tui->roundness = value * 0.5f;
1302}
1303
1304/* Studio Light */
1305static void rna_UserDef_studiolight_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1306{
1308}
1309
1310static void rna_StudioLights_refresh(UserDef * /*userdef*/)
1311{
1313}
1314
1315static void rna_StudioLights_remove(UserDef * /*userdef*/, StudioLight *studio_light)
1316{
1317 BKE_studiolight_remove(studio_light);
1318}
1319
1320static StudioLight *rna_StudioLights_load(UserDef * /*userdef*/, const char *filepath, int type)
1321{
1322 return BKE_studiolight_load(filepath, type);
1323}
1324
1325/* TODO: Make it accept arguments. */
1326static StudioLight *rna_StudioLights_new(UserDef *userdef, const char *filepath)
1327{
1328 return BKE_studiolight_create(filepath, userdef->light_param, userdef->light_ambient);
1329}
1330
1331/* StudioLight.name */
1332static void rna_UserDef_studiolight_name_get(PointerRNA *ptr, char *value)
1333{
1334 StudioLight *sl = (StudioLight *)ptr->data;
1335 strcpy(value, sl->name);
1336}
1337
1338static int rna_UserDef_studiolight_name_length(PointerRNA *ptr)
1339{
1340 StudioLight *sl = (StudioLight *)ptr->data;
1341 return strlen(sl->name);
1342}
1343
1344/* StudioLight.path */
1345static void rna_UserDef_studiolight_path_get(PointerRNA *ptr, char *value)
1346{
1347 StudioLight *sl = (StudioLight *)ptr->data;
1348 strcpy(value, sl->filepath);
1349}
1350
1351static int rna_UserDef_studiolight_path_length(PointerRNA *ptr)
1352{
1353 StudioLight *sl = (StudioLight *)ptr->data;
1354 return strlen(sl->filepath);
1355}
1356
1357/* StudioLight.index */
1358static int rna_UserDef_studiolight_index_get(PointerRNA *ptr)
1359{
1360 StudioLight *sl = (StudioLight *)ptr->data;
1361 return sl->index;
1362}
1363
1364/* StudioLight.is_user_defined */
1365static bool rna_UserDef_studiolight_is_user_defined_get(PointerRNA *ptr)
1366{
1367 StudioLight *sl = (StudioLight *)ptr->data;
1368 return (sl->flag & STUDIOLIGHT_USER_DEFINED) != 0;
1369}
1370
1371/* StudioLight.is_user_defined */
1372static bool rna_UserDef_studiolight_has_specular_highlight_pass_get(PointerRNA *ptr)
1373{
1374 StudioLight *sl = (StudioLight *)ptr->data;
1375 return sl->flag & STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS;
1376}
1377
1378/* StudioLight.type */
1379
1380static int rna_UserDef_studiolight_type_get(PointerRNA *ptr)
1381{
1382 StudioLight *sl = (StudioLight *)ptr->data;
1383 return sl->flag & STUDIOLIGHT_FLAG_ORIENTATIONS;
1384}
1385
1386/* StudioLight.solid_lights */
1387
1388static void rna_UserDef_studiolight_solid_lights_begin(CollectionPropertyIterator *iter,
1389 PointerRNA *ptr)
1390{
1391 StudioLight *sl = (StudioLight *)ptr->data;
1393 iter, ptr, sl->light, sizeof(*sl->light), ARRAY_SIZE(sl->light), 0, nullptr);
1394}
1395
1396static int rna_UserDef_studiolight_solid_lights_length(PointerRNA * /*ptr*/)
1397{
1398 return ARRAY_SIZE(((StudioLight *)nullptr)->light);
1399}
1400
1401/* StudioLight.light_ambient */
1402
1403static void rna_UserDef_studiolight_light_ambient_get(PointerRNA *ptr, float *values)
1404{
1405 StudioLight *sl = (StudioLight *)ptr->data;
1406 copy_v3_v3(values, sl->light_ambient);
1407}
1408
1409int rna_show_statusbar_vram_editable(const PointerRNA * /*ptr*/, const char ** /*r_info*/)
1410{
1412}
1413
1414static const EnumPropertyItem *rna_preference_gpu_backend_itemf(bContext * /*C*/,
1415 PointerRNA * /*ptr*/,
1416 PropertyRNA * /*prop*/,
1417 bool *r_free)
1418{
1419 int totitem = 0;
1420 EnumPropertyItem *result = nullptr;
1421 for (int i = 0; rna_enum_preference_gpu_backend_items[i].identifier != nullptr; i++) {
1423# ifndef WITH_OPENGL_BACKEND
1424 if (item->value == GPU_BACKEND_OPENGL) {
1425 continue;
1426 }
1427# endif
1428# ifndef WITH_METAL_BACKEND
1429 if (item->value == GPU_BACKEND_METAL) {
1430 continue;
1431 }
1432# endif
1433# ifndef WITH_VULKAN_BACKEND
1434 if (item->value == GPU_BACKEND_VULKAN) {
1435 continue;
1436 }
1437# endif
1438 RNA_enum_item_add(&result, &totitem, item);
1439 }
1440
1441 RNA_enum_item_end(&result, &totitem);
1442 *r_free = true;
1443 return result;
1444}
1445
1446static const EnumPropertyItem *rna_preference_gpu_preferred_device_itemf(bContext * /*C*/,
1447 PointerRNA * /*ptr*/,
1448 PropertyRNA * /*prop*/,
1449 bool *r_free)
1450{
1451 int totitem = 0;
1452 EnumPropertyItem *result = nullptr;
1453
1454 for (int i = 0; rna_enum_preference_gpu_preferred_device_items[i].identifier != nullptr; i++) {
1456 RNA_enum_item_add(&result, &totitem, item);
1457 }
1458 int index = 1;
1459 for (const GPUDevice &gpu_device : GPU_platform_devices_list()) {
1460 EnumPropertyItem item = {};
1461 item.value = index;
1462 item.identifier = gpu_device.identifier.c_str();
1463 item.name = gpu_device.name.c_str();
1464 item.description = gpu_device.name.c_str();
1465 RNA_enum_item_add(&result, &totitem, &item);
1466 index += 1;
1467 }
1468
1469 RNA_enum_item_end(&result, &totitem);
1470 *r_free = true;
1471 return result;
1472}
1473
1474static int rna_preference_gpu_preferred_device_get(PointerRNA *ptr)
1475{
1476 UserDef *preferences = (UserDef *)ptr->data;
1477 int index = 1;
1478 for (const GPUDevice &gpu_device : GPU_platform_devices_list()) {
1479 if (gpu_device.index == preferences->gpu_preferred_index &&
1480 gpu_device.vendor_id == preferences->gpu_preferred_vendor_id &&
1481 gpu_device.device_id == preferences->gpu_preferred_device_id)
1482 {
1483 /* Offset by one as first item in the list is always auto-detection. */
1484 return index;
1485 }
1486 index += 1;
1487 }
1488
1489 return 0;
1490}
1491
1492static void rna_preference_gpu_preferred_device_set(PointerRNA *ptr, int value)
1493{
1494 UserDef *preferences = (UserDef *)ptr->data;
1495 if (value > 0) {
1496 value -= 1;
1498 if (value < devices.size()) {
1499 const GPUDevice &device = devices[value];
1500 preferences->gpu_preferred_index = device.index;
1501 preferences->gpu_preferred_vendor_id = device.vendor_id;
1502 preferences->gpu_preferred_device_id = device.device_id;
1503 return;
1504 }
1505 }
1506 preferences->gpu_preferred_index = 0;
1507 preferences->gpu_preferred_vendor_id = 0u;
1508 preferences->gpu_preferred_device_id = 0u;
1509}
1510
1511static const EnumPropertyItem *rna_preference_asset_libray_import_method_itemf(
1512 bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free)
1513{
1514 EnumPropertyItem *items = nullptr;
1515 int items_num = 0;
1517 item->identifier;
1518 item++)
1519 {
1520 switch (eAssetImportMethod(item->value)) {
1522 if (U.experimental.no_data_block_packing) {
1523 RNA_enum_item_add(&items, &items_num, item);
1524 }
1525 break;
1526 }
1527 case ASSET_IMPORT_PACK: {
1528 if (!U.experimental.no_data_block_packing) {
1529 RNA_enum_item_add(&items, &items_num, item);
1530 }
1531 break;
1532 }
1533 default: {
1534 RNA_enum_item_add(&items, &items_num, item);
1535 break;
1536 }
1537 }
1538 }
1539 RNA_enum_item_end(&items, &items_num);
1540 *r_free = true;
1541 return items;
1542}
1543
1544int rna_preference_asset_libray_import_method_default(PointerRNA * /*ptr*/, PropertyRNA * /*prop*/)
1545{
1546 return U.experimental.no_data_block_packing ? ASSET_IMPORT_APPEND_REUSE : ASSET_IMPORT_PACK;
1547}
1548
1549static void rna_experimental_no_data_block_packing_update(bContext *C, PointerRNA *ptr)
1550{
1551 Main *bmain = CTX_data_main(C);
1552 Scene *scene = CTX_data_scene(C);
1553 rna_userdef_update(bmain, scene, ptr);
1556 rna_userdef_asset_library_update(C, ptr);
1557}
1558
1559#else
1560
1561# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \
1562 RNA_define_fallback_property_update(0, "rna_userdef_is_dirty_update")
1563
1564# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE RNA_define_fallback_property_update(0, nullptr)
1565
1566/* TODO(sergey): This technically belongs to blenlib, but we don't link
1567 * makesrna against it.
1568 */
1569
1570/* Get maximum addressable memory in megabytes, */
1572{
1573 /* Maximum addressable bytes on this platform. */
1574 const size_t limit_bytes = size_t(1) << (sizeof(size_t[8]) - 1);
1575 /* Convert it to megabytes and return. */
1576 return (limit_bytes >> 20);
1577}
1578
1579/* Same as #max_memory_in_megabytes, but clipped to int capacity. */
1581{
1582 const size_t limit_megabytes = max_memory_in_megabytes();
1583 /* NOTE: The result will fit into integer. */
1584 return int(min_zz(limit_megabytes, size_t(INT_MAX)));
1585}
1586
1588{
1589 StructRNA *srna;
1590 PropertyRNA *prop;
1591
1592 srna = RNA_def_struct(brna, "ThemeFontStyle", nullptr);
1593 RNA_def_struct_sdna(srna, "uiFontStyle");
1594 RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
1595
1596 prop = RNA_def_property(srna, "points", PROP_FLOAT, PROP_UNSIGNED);
1597 RNA_def_property_range(prop, 6.0f, 32.0f);
1598 RNA_def_property_ui_range(prop, 8.0f, 20.0f, 10.0f, 1);
1599 RNA_def_property_ui_text(prop, "Points", "Font size in points");
1600 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
1601
1602 prop = RNA_def_property(srna, "character_weight", PROP_INT, PROP_NONE);
1604 RNA_def_property_range(prop, 100.0f, 900.0f);
1605 RNA_def_property_ui_range(prop, 100.0f, 900.0f, 50, 0);
1607 prop, "Character Weight", "Weight of the characters. 100-900, 400 is normal.");
1608 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
1609
1610 prop = RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
1611 RNA_def_property_range(prop, 0, 6);
1612 RNA_def_property_ui_text(prop, "Shadow Size", "Shadow type (0 none, 3, 5 blur, 6 outline)");
1613 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1614
1615 prop = RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_PIXEL);
1616 RNA_def_property_int_sdna(prop, nullptr, "shadx");
1617 RNA_def_property_range(prop, -10, 10);
1618 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
1619 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1620
1621 prop = RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_PIXEL);
1622 RNA_def_property_int_sdna(prop, nullptr, "shady");
1623 RNA_def_property_range(prop, -10, 10);
1624 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
1625 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1626
1627 prop = RNA_def_property(srna, "shadow_alpha", PROP_FLOAT, PROP_FACTOR);
1628 RNA_def_property_float_sdna(prop, nullptr, "shadowalpha");
1629 RNA_def_property_range(prop, 0.0f, 1.0f);
1630 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
1631 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1632
1633 prop = RNA_def_property(srna, "shadow_value", PROP_FLOAT, PROP_FACTOR);
1634 RNA_def_property_float_sdna(prop, nullptr, "shadowcolor");
1635 RNA_def_property_range(prop, 0.0f, 1.0f);
1636 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in gray value");
1637 RNA_def_property_update(prop, 0, "rna_userdef_theme_text_style_update");
1638}
1639
1641{
1642 StructRNA *srna;
1643 PropertyRNA *prop;
1644
1646
1647 srna = RNA_def_struct(brna, "ThemeStyle", nullptr);
1648 RNA_def_struct_sdna(srna, "uiStyle");
1649 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
1650
1651 prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
1653 RNA_def_property_pointer_sdna(prop, nullptr, "paneltitle");
1654 RNA_def_property_struct_type(prop, "ThemeFontStyle");
1655 RNA_def_property_ui_text(prop, "Panel Title Font", "");
1656 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1657
1658 prop = RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
1660 RNA_def_property_pointer_sdna(prop, nullptr, "widget");
1661 RNA_def_property_struct_type(prop, "ThemeFontStyle");
1662 RNA_def_property_ui_text(prop, "Widget Style", "");
1663 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1664
1665 prop = RNA_def_property(srna, "tooltip", PROP_POINTER, PROP_NONE);
1667 RNA_def_property_pointer_sdna(prop, nullptr, "tooltip");
1668 RNA_def_property_struct_type(prop, "ThemeFontStyle");
1669 RNA_def_property_ui_text(prop, "Tooltip Style", "");
1670 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1671}
1672
1674{
1675 StructRNA *srna;
1676 PropertyRNA *prop;
1677
1678 srna = RNA_def_struct(brna, "ThemeWidgetColors", nullptr);
1679 RNA_def_struct_sdna(srna, "uiWidgetColors");
1680 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
1681
1682 prop = RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
1683 RNA_def_property_array(prop, 4);
1684 RNA_def_property_ui_text(prop, "Outline", "");
1685 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1686
1687 prop = RNA_def_property(srna, "outline_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1688 RNA_def_property_array(prop, 4);
1689 RNA_def_property_ui_text(prop, "Outline Selected", "");
1690 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1691
1692 prop = RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
1693 RNA_def_property_array(prop, 4);
1694 RNA_def_property_ui_text(prop, "Inner", "");
1695 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1696
1697 prop = RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1698 RNA_def_property_array(prop, 4);
1699 RNA_def_property_ui_text(prop, "Inner Selected", "");
1700 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1701
1702 prop = RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
1703 RNA_def_property_array(prop, 4);
1704 RNA_def_property_ui_text(prop, "Item", "");
1705 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1706
1707 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
1708 RNA_def_property_array(prop, 3);
1709 RNA_def_property_ui_text(prop, "Text", "");
1710 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1711
1712 prop = RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1713 RNA_def_property_array(prop, 3);
1714 RNA_def_property_ui_text(prop, "Text Selected", "");
1715 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1716
1717 prop = RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
1718 RNA_def_property_boolean_sdna(prop, nullptr, "shaded", 1);
1719 RNA_def_property_ui_text(prop, "Shaded", "");
1720 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1721
1722 prop = RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
1723 RNA_def_property_range(prop, -100, 100);
1724 RNA_def_property_ui_text(prop, "Shade Top", "");
1725 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1726
1727 prop = RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
1728 RNA_def_property_range(prop, -100, 100);
1729 RNA_def_property_ui_text(prop, "Shade Down", "");
1730 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1731
1732 prop = RNA_def_property(srna, "roundness", PROP_FLOAT, PROP_FACTOR);
1734 prop, "rna_ThemeUI_roundness_get", "rna_ThemeUI_roundness_set", nullptr);
1735 RNA_def_property_ui_text(prop, "Roundness", "Amount of edge rounding");
1736 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1737}
1738
1740{
1741 StructRNA *srna;
1742 PropertyRNA *prop;
1743
1744 srna = RNA_def_struct(brna, "ThemeWidgetStateColors", nullptr);
1745 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
1747 srna, "Theme Widget State Color", "Theme settings for widget state colors");
1748
1749 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_COLOR_GAMMA);
1750 RNA_def_property_array(prop, 4);
1751 RNA_def_property_ui_text(prop, "Error", "Color for error items");
1752 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1753
1754 prop = RNA_def_property(srna, "warning", PROP_FLOAT, PROP_COLOR_GAMMA);
1755 RNA_def_property_array(prop, 4);
1756 RNA_def_property_ui_text(prop, "Warning", "Color for warning items");
1757 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1758
1759 prop = RNA_def_property(srna, "info", PROP_FLOAT, PROP_COLOR_GAMMA);
1760 RNA_def_property_array(prop, 4);
1761 RNA_def_property_ui_text(prop, "Info", "Color for informational items");
1762 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1763
1764 prop = RNA_def_property(srna, "success", PROP_FLOAT, PROP_COLOR_GAMMA);
1765 RNA_def_property_array(prop, 4);
1766 RNA_def_property_ui_text(prop, "Success", "Color for successful items");
1767 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1768
1769 prop = RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
1770 RNA_def_property_array(prop, 3);
1771 RNA_def_property_ui_text(prop, "Animated", "");
1772 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1773
1774 prop = RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1775 RNA_def_property_array(prop, 3);
1776 RNA_def_property_ui_text(prop, "Animated Selected", "");
1777 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1778
1779 prop = RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
1780 RNA_def_property_array(prop, 3);
1781 RNA_def_property_ui_text(prop, "Keyframe", "");
1782 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1783
1784 prop = RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1785 RNA_def_property_array(prop, 3);
1786 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
1787 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1788
1789 prop = RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
1790 RNA_def_property_array(prop, 3);
1791 RNA_def_property_ui_text(prop, "Driven", "");
1792 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1793
1794 prop = RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1795 RNA_def_property_array(prop, 3);
1796 RNA_def_property_ui_text(prop, "Driven Selected", "");
1797 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1798
1799 prop = RNA_def_property(srna, "inner_overridden", PROP_FLOAT, PROP_COLOR_GAMMA);
1800 RNA_def_property_array(prop, 3);
1801 RNA_def_property_ui_text(prop, "Overridden", "");
1802 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1803
1804 prop = RNA_def_property(srna, "inner_overridden_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1805 RNA_def_property_array(prop, 3);
1806 RNA_def_property_ui_text(prop, "Overridden Selected", "");
1807 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1808
1809 prop = RNA_def_property(srna, "inner_changed", PROP_FLOAT, PROP_COLOR_GAMMA);
1810 RNA_def_property_array(prop, 3);
1811 RNA_def_property_ui_text(prop, "Changed", "");
1812 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1813
1814 prop = RNA_def_property(srna, "inner_changed_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
1815 RNA_def_property_array(prop, 3);
1816 RNA_def_property_ui_text(prop, "Changed Selected", "");
1817 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1818
1819 prop = RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
1820 RNA_def_property_ui_text(prop, "Blend", "");
1821 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1822}
1823
1826 "SINGLE_COLOR",
1827 0,
1828 "Single Color",
1829 "Use a solid color as viewport background"},
1831 "LINEAR",
1832 0,
1833 "Linear Gradient",
1834 "Use a screen space vertical linear gradient as viewport background"},
1836 "RADIAL",
1837 0,
1838 "Vignette",
1839 "Use a radial gradient as viewport background"},
1840 {0, nullptr, 0, nullptr, nullptr},
1841};
1842
1844{
1845 /* Fake struct, keep this for compatible theme presets. */
1846 StructRNA *srna;
1847 PropertyRNA *prop;
1848
1849 srna = RNA_def_struct(brna, "ThemeGradientColors", nullptr);
1850 RNA_def_struct_sdna(srna, "ThemeSpace");
1852 srna, "Theme Background Color", "Theme settings for background colors and gradient");
1853
1854 prop = RNA_def_property(srna, "background_type", PROP_ENUM, PROP_NONE);
1855 RNA_def_property_enum_sdna(prop, nullptr, "background_type");
1857 RNA_def_property_ui_text(prop, "Background Type", "Type of background in the 3D viewport");
1858 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1859
1860 prop = RNA_def_property(srna, "high_gradient", PROP_FLOAT, PROP_COLOR_GAMMA);
1861 RNA_def_property_float_sdna(prop, nullptr, "back");
1862 RNA_def_property_array(prop, 3);
1863 RNA_def_property_ui_text(prop, "Gradient High/Off", "");
1864 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1865
1866 prop = RNA_def_property(srna, "gradient", PROP_FLOAT, PROP_COLOR_GAMMA);
1867 RNA_def_property_float_sdna(prop, nullptr, "back_grad");
1868 RNA_def_property_array(prop, 3);
1869 RNA_def_property_ui_text(prop, "Gradient Low", "");
1870 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1871}
1872
1874{
1875 StructRNA *srna;
1876 PropertyRNA *prop;
1877
1881
1882 srna = RNA_def_struct(brna, "ThemeUserInterface", nullptr);
1883 RNA_def_struct_sdna(srna, "ThemeUI");
1885 srna, "Theme User Interface", "Theme settings for user interface elements");
1886
1887 prop = RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
1889 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
1890 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1891
1892 prop = RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
1894 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
1895 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1896
1897 prop = RNA_def_property(srna, "wcol_toolbar_item", PROP_POINTER, PROP_NONE);
1899 RNA_def_property_ui_text(prop, "Toolbar Item Widget Colors", "");
1900 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1901
1902 prop = RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
1904 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
1905 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1906
1907 prop = RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
1909 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
1910 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1911
1912 prop = RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
1914 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
1915 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1916
1917 prop = RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
1919 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
1920 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1921
1922 prop = RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
1924 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
1925 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1926
1927 prop = RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
1929 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
1930 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1931
1932 prop = RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
1934 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
1935 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1936
1937 prop = RNA_def_property(srna, "wcol_curve", PROP_POINTER, PROP_NONE);
1939 RNA_def_property_ui_text(prop, "Curve Widget Colors", "");
1940 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1941
1942 prop = RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
1944 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
1945 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1946
1947 prop = RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
1949 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
1950 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1951
1952 prop = RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
1954 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
1955 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1956
1957 prop = RNA_def_property(srna, "wcol_pie_menu", PROP_POINTER, PROP_NONE);
1959 RNA_def_property_ui_text(prop, "Pie Menu Colors", "");
1960 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1961
1962 prop = RNA_def_property(srna, "wcol_tooltip", PROP_POINTER, PROP_NONE);
1964 RNA_def_property_ui_text(prop, "Tooltip Colors", "");
1965 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1966
1967 prop = RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
1969 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
1970 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1971
1972 prop = RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
1974 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
1975 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1976
1977 prop = RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
1979 RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
1980 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1981
1982 prop = RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
1984 RNA_def_property_ui_text(prop, "List Item Colors", "");
1985 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1986
1987 prop = RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
1989 RNA_def_property_ui_text(prop, "State Colors", "");
1990 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1991
1992 prop = RNA_def_property(srna, "wcol_tab", PROP_POINTER, PROP_NONE);
1994 RNA_def_property_ui_text(prop, "Tab Colors", "");
1995 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
1996
1997 prop = RNA_def_property(srna, "menu_shadow_fac", PROP_FLOAT, PROP_FACTOR);
1999 prop, "Panel/Menu Shadow Strength", "Blending factor for panel and menu shadows");
2000 RNA_def_property_range(prop, 0.01f, 1.0f);
2001 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2002
2003 prop = RNA_def_property(srna, "menu_shadow_width", PROP_INT, PROP_PIXEL);
2005 prop, "Panel/Menu Shadow Width", "Width of panel and menu shadows, set to zero to disable");
2006 RNA_def_property_range(prop, 0.0f, 24.0f);
2007 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2008
2009 prop = RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR);
2011 prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast");
2012 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2013
2014 prop = RNA_def_property(srna, "icon_saturation", PROP_FLOAT, PROP_FACTOR);
2015 RNA_def_property_ui_text(prop, "Icon Saturation", "Saturation of icons in the interface");
2016 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2017
2018 prop = RNA_def_property(srna, "widget_emboss", PROP_FLOAT, PROP_COLOR_GAMMA);
2019 RNA_def_property_float_sdna(prop, nullptr, "widget_emboss");
2020 RNA_def_property_array(prop, 4);
2022 prop, "Widget Emboss", "Color of the 1px shadow line underlying widgets");
2023 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2024
2025 prop = RNA_def_property(srna, "editor_border", PROP_FLOAT, PROP_COLOR_GAMMA);
2026 RNA_def_property_float_sdna(prop, nullptr, "editor_border");
2027 RNA_def_property_array(prop, 3);
2028 RNA_def_property_ui_text(prop, "Editor Border", "Color of the border between editors");
2029 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2030
2031 prop = RNA_def_property(srna, "editor_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
2032 RNA_def_property_float_sdna(prop, nullptr, "editor_outline");
2033 RNA_def_property_array(prop, 4);
2035 prop, "Editor Outline", "Color of the outline of each editor, except the active one");
2036 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2037
2038 prop = RNA_def_property(srna, "editor_outline_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2039 RNA_def_property_float_sdna(prop, nullptr, "editor_outline_active");
2040 RNA_def_property_array(prop, 4);
2042 prop, "Active Editor Outline", "Color of the outline of the active editor");
2043 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2044
2045 prop = RNA_def_property(srna, "widget_text_cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
2046 RNA_def_property_float_sdna(prop, nullptr, "widget_text_cursor");
2047 RNA_def_property_array(prop, 3);
2048 RNA_def_property_ui_text(prop, "Text Cursor", "Color of the text insertion cursor (caret)");
2049 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2050
2051 prop = RNA_def_property(srna, "panel_roundness", PROP_FLOAT, PROP_FACTOR);
2053 prop, "Panel Roundness", "Roundness of the corners of panels and sub-panels");
2054 RNA_def_property_range(prop, 0.0f, 1.0f);
2056 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2057
2058 prop = RNA_def_property(srna, "panel_header", PROP_FLOAT, PROP_COLOR_GAMMA);
2059 RNA_def_property_ui_text(prop, "Panel Header", "");
2060 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2061
2062 prop = RNA_def_property(srna, "panel_title", PROP_FLOAT, PROP_COLOR_GAMMA);
2063 RNA_def_property_array(prop, 3);
2064 RNA_def_property_ui_text(prop, "Panel Title", "");
2065 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2066
2067 prop = RNA_def_property(srna, "panel_text", PROP_FLOAT, PROP_COLOR_GAMMA);
2068 RNA_def_property_array(prop, 3);
2069 RNA_def_property_ui_text(prop, "Panel Text", "");
2070 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2071
2072 prop = RNA_def_property(srna, "panel_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2073 RNA_def_property_ui_text(prop, "Panel Background", "");
2074 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2075
2076 prop = RNA_def_property(srna, "panel_sub_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2077 RNA_def_property_ui_text(prop, "Sub-Panel Background", "");
2078 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2079
2080 prop = RNA_def_property(srna, "panel_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
2081 RNA_def_property_ui_text(prop, "Panel Outline", "Color of the outline of top-level panels");
2082 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2083
2084 prop = RNA_def_property(srna, "panel_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2085 RNA_def_property_array(prop, 4);
2087 prop, "Active Panel Outline", "Color of the outline of top-level panels that are active");
2088 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2089
2090 /* Transparent Grid */
2091 prop = RNA_def_property(srna, "transparent_checker_primary", PROP_FLOAT, PROP_COLOR_GAMMA);
2092 RNA_def_property_float_sdna(prop, nullptr, "transparent_checker_primary");
2093 RNA_def_property_array(prop, 3);
2095 prop, "Primary Color", "Primary color of checkerboard pattern indicating transparent areas");
2096 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2097
2098 prop = RNA_def_property(srna, "transparent_checker_secondary", PROP_FLOAT, PROP_COLOR_GAMMA);
2099 RNA_def_property_float_sdna(prop, nullptr, "transparent_checker_secondary");
2100 RNA_def_property_array(prop, 3);
2102 "Secondary Color",
2103 "Secondary color of checkerboard pattern indicating transparent areas");
2104 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2105
2106 prop = RNA_def_property(srna, "transparent_checker_size", PROP_INT, PROP_PIXEL);
2108 prop, "Checkerboard Size", "Size of checkerboard pattern indicating transparent areas");
2109 RNA_def_property_range(prop, 2, 48);
2110 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2111
2112 /* axis */
2113 prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_COLOR_GAMMA);
2114 RNA_def_property_float_sdna(prop, nullptr, "xaxis");
2115 RNA_def_property_array(prop, 3);
2116 RNA_def_property_ui_text(prop, "X Axis", "");
2117 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2118
2119 prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_COLOR_GAMMA);
2120 RNA_def_property_float_sdna(prop, nullptr, "yaxis");
2121 RNA_def_property_array(prop, 3);
2122 RNA_def_property_ui_text(prop, "Y Axis", "");
2123 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2124
2125 prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_COLOR_GAMMA);
2126 RNA_def_property_float_sdna(prop, nullptr, "zaxis");
2127 RNA_def_property_array(prop, 3);
2128 RNA_def_property_ui_text(prop, "Z Axis", "");
2129 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2130
2131 prop = RNA_def_property(srna, "axis_w", PROP_FLOAT, PROP_COLOR_GAMMA);
2132 RNA_def_property_float_sdna(prop, nullptr, "waxis");
2133 RNA_def_property_array(prop, 3);
2134 RNA_def_property_ui_text(prop, "W Axis", "W-axis for quaternion and axis-angle rotations");
2135 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2136
2137 /* Generic gizmo colors. */
2138 prop = RNA_def_property(srna, "gizmo_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
2139 RNA_def_property_float_sdna(prop, nullptr, "gizmo_hi");
2140 RNA_def_property_array(prop, 3);
2141 RNA_def_property_ui_text(prop, "Gizmo Highlight", "");
2142 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2143
2144 prop = RNA_def_property(srna, "gizmo_primary", PROP_FLOAT, PROP_COLOR_GAMMA);
2145 RNA_def_property_float_sdna(prop, nullptr, "gizmo_primary");
2146 RNA_def_property_array(prop, 3);
2147 RNA_def_property_ui_text(prop, "Gizmo Primary", "");
2148 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2149
2150 prop = RNA_def_property(srna, "gizmo_secondary", PROP_FLOAT, PROP_COLOR_GAMMA);
2151 RNA_def_property_float_sdna(prop, nullptr, "gizmo_secondary");
2152 RNA_def_property_array(prop, 3);
2153 RNA_def_property_ui_text(prop, "Gizmo Secondary", "");
2154 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2155
2156 prop = RNA_def_property(srna, "gizmo_view_align", PROP_FLOAT, PROP_COLOR_GAMMA);
2157 RNA_def_property_float_sdna(prop, nullptr, "gizmo_view_align");
2158 RNA_def_property_array(prop, 3);
2159 RNA_def_property_ui_text(prop, "Gizmo View Align", "");
2160 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2161
2162 prop = RNA_def_property(srna, "gizmo_a", PROP_FLOAT, PROP_COLOR_GAMMA);
2163 RNA_def_property_float_sdna(prop, nullptr, "gizmo_a");
2164 RNA_def_property_array(prop, 3);
2165 RNA_def_property_ui_text(prop, "Gizmo A", "");
2166 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2167
2168 prop = RNA_def_property(srna, "gizmo_b", PROP_FLOAT, PROP_COLOR_GAMMA);
2169 RNA_def_property_float_sdna(prop, nullptr, "gizmo_b");
2170 RNA_def_property_array(prop, 3);
2171 RNA_def_property_ui_text(prop, "Gizmo B", "");
2172 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2173
2174 /* Icon colors. */
2175 prop = RNA_def_property(srna, "icon_scene", PROP_FLOAT, PROP_COLOR_GAMMA);
2176 RNA_def_property_float_sdna(prop, nullptr, "icon_scene");
2177 RNA_def_property_array(prop, 4);
2178 RNA_def_property_ui_text(prop, "Scene", "");
2179 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2180
2181 prop = RNA_def_property(srna, "icon_collection", PROP_FLOAT, PROP_COLOR_GAMMA);
2182 RNA_def_property_float_sdna(prop, nullptr, "icon_collection");
2183 RNA_def_property_array(prop, 4);
2184 RNA_def_property_ui_text(prop, "Collection", "");
2185 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2186
2187 prop = RNA_def_property(srna, "icon_object", PROP_FLOAT, PROP_COLOR_GAMMA);
2188 RNA_def_property_float_sdna(prop, nullptr, "icon_object");
2189 RNA_def_property_array(prop, 4);
2190 RNA_def_property_ui_text(prop, "Object", "");
2191 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2192
2193 prop = RNA_def_property(srna, "icon_object_data", PROP_FLOAT, PROP_COLOR_GAMMA);
2194 RNA_def_property_float_sdna(prop, nullptr, "icon_object_data");
2195 RNA_def_property_array(prop, 4);
2196 RNA_def_property_ui_text(prop, "Object Data", "");
2197 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2198
2199 prop = RNA_def_property(srna, "icon_modifier", PROP_FLOAT, PROP_COLOR_GAMMA);
2200 RNA_def_property_float_sdna(prop, nullptr, "icon_modifier");
2201 RNA_def_property_array(prop, 4);
2202 RNA_def_property_ui_text(prop, "Modifier", "");
2203 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2204
2205 prop = RNA_def_property(srna, "icon_shading", PROP_FLOAT, PROP_COLOR_GAMMA);
2206 RNA_def_property_float_sdna(prop, nullptr, "icon_shading");
2207 RNA_def_property_array(prop, 4);
2208 RNA_def_property_ui_text(prop, "Shading", "");
2209 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2210
2211 prop = RNA_def_property(srna, "icon_folder", PROP_FLOAT, PROP_COLOR_GAMMA);
2212 RNA_def_property_float_sdna(prop, nullptr, "icon_folder");
2213 RNA_def_property_array(prop, 4);
2214 RNA_def_property_ui_text(prop, "File Folders", "Color of folders in the file browser");
2215 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2216
2217 prop = RNA_def_property(srna, "icon_autokey", PROP_FLOAT, PROP_COLOR_GAMMA);
2218 RNA_def_property_float_sdna(prop, nullptr, "icon_autokey");
2219 RNA_def_property_array(prop, 4);
2221 prop, "Auto Keying Indicator", "Color of Auto Keying indicator when enabled");
2222 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2223
2224 prop = RNA_def_property(srna, "icon_border_intensity", PROP_FLOAT, PROP_FACTOR);
2225 RNA_def_property_float_sdna(prop, nullptr, "icon_border_intensity");
2227 prop, "Icon Border", "Control the intensity of the border around themes icons");
2228 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
2229 RNA_def_property_update(prop, 0, "rna_userdef_theme_update_icons");
2230}
2231
2232/* Asset Shelf region */
2234{
2235 StructRNA *srna;
2236 PropertyRNA *prop;
2237
2238 srna = RNA_def_struct(brna, "ThemeRegionsAssetShelf", nullptr);
2239 RNA_def_struct_ui_text(srna, "Asset Shelf Region Theme", "Theme settings for asset shelves");
2240
2241 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2242 RNA_def_property_array(prop, 4);
2243 RNA_def_property_ui_text(prop, "Background", "");
2244 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2245
2246 prop = RNA_def_property(srna, "header_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2247 RNA_def_property_array(prop, 4);
2248 RNA_def_property_ui_text(prop, "Header Background", "");
2249 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2250}
2251
2252/* Channels region */
2254{
2255 StructRNA *srna;
2256 PropertyRNA *prop;
2257
2258 srna = RNA_def_struct(brna, "ThemeRegionsChannels", nullptr);
2259 RNA_def_struct_ui_text(srna, "Source List Region Settings", "");
2260
2261 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2262 RNA_def_property_array(prop, 3);
2263 RNA_def_property_ui_text(prop, "Background", "");
2264 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2265
2266 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2267 RNA_def_property_array(prop, 3);
2268 RNA_def_property_ui_text(prop, "Text", "");
2269 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2270
2271 prop = RNA_def_property(srna, "text_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2272 RNA_def_property_array(prop, 3);
2273 RNA_def_property_ui_text(prop, "Selected Text", "");
2274 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2275}
2276
2277/* Scrubbing / Markers region */
2279{
2280 StructRNA *srna;
2281 PropertyRNA *prop;
2282
2283 srna = RNA_def_struct(brna, "ThemeRegionsScrubbing", nullptr);
2284 RNA_def_struct_ui_text(srna, "Scrubbing & Markers Region Settings", "");
2285
2286 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2287 RNA_def_property_array(prop, 4);
2288 RNA_def_property_ui_text(prop, "Background", "");
2289 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2290
2291 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2292 RNA_def_property_array(prop, 3);
2293 RNA_def_property_ui_text(prop, "Timestamp", "");
2294 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2295
2296 /* Marker properties */
2297 prop = RNA_def_property(srna, "time_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
2298 RNA_def_property_array(prop, 4);
2299 RNA_def_property_ui_text(prop, "Marker", "");
2300 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2301
2302 prop = RNA_def_property(srna, "time_marker_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2303 RNA_def_property_array(prop, 4);
2304 RNA_def_property_ui_text(prop, "Marker Selected", "");
2305 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2306}
2307
2308/* Sidebar & Toolbar region */
2310{
2311 StructRNA *srna;
2312 PropertyRNA *prop;
2313
2314 srna = RNA_def_struct(brna, "ThemeRegionsSidebars", nullptr);
2315 RNA_def_struct_ui_text(srna, "Sidebar & Toolbar Region Settings", "");
2316
2317 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2318 RNA_def_property_array(prop, 4);
2319 RNA_def_property_ui_text(prop, "Background", "");
2320 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2321
2322 prop = RNA_def_property(srna, "tab_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2323 RNA_def_property_array(prop, 4);
2324 RNA_def_property_ui_text(prop, "Navigation/Tabs Background", "");
2325 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2326}
2327
2329{
2330 StructRNA *srna;
2331 PropertyRNA *prop;
2332
2337
2338 srna = RNA_def_struct(brna, "ThemeRegions", nullptr);
2340 "Shared Region Properties",
2341 "Theme settings for regions that are common among editors");
2342
2343 prop = RNA_def_property(srna, "asset_shelf", PROP_POINTER, PROP_NONE);
2345 RNA_def_property_ui_text(prop, "Asset Shelf", "");
2346 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2347
2348 prop = RNA_def_property(srna, "channels", PROP_POINTER, PROP_NONE);
2350 RNA_def_property_ui_text(prop, "Channels", "");
2351 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2352
2353 prop = RNA_def_property(srna, "scrubbing", PROP_POINTER, PROP_NONE);
2355 RNA_def_property_ui_text(prop, "Scrubbing / Markers", "");
2356 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2357
2358 prop = RNA_def_property(srna, "sidebars", PROP_POINTER, PROP_NONE);
2360 RNA_def_property_ui_text(prop, "Toolbar / Sidebar", "");
2361 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2362}
2363
2365{
2366 StructRNA *srna;
2367 PropertyRNA *prop;
2368
2369 srna = RNA_def_struct(brna, "ThemeCommonAnim", nullptr);
2370 RNA_def_struct_sdna(srna, "ThemeCommonAnim");
2371 RNA_def_struct_ui_text(srna, "Common Animation Properties", "Shared animation theme properties");
2372
2373 prop = RNA_def_property(srna, "playhead", PROP_FLOAT, PROP_COLOR_GAMMA);
2374 RNA_def_property_float_sdna(prop, nullptr, "playhead");
2375 RNA_def_property_array(prop, 3);
2376 RNA_def_property_ui_text(prop, "Playhead", "");
2377 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2378
2379 prop = RNA_def_property(srna, "preview_range", PROP_FLOAT, PROP_COLOR_GAMMA);
2380 RNA_def_property_float_sdna(prop, nullptr, "preview_range");
2381 RNA_def_property_array(prop, 4);
2382 RNA_def_property_ui_text(prop, "Preview Range", "Color of preview range overlay");
2383 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2384
2385 prop = RNA_def_property(srna, "scene_strip_range", PROP_FLOAT, PROP_COLOR_GAMMA);
2386 RNA_def_property_float_sdna(prop, nullptr, "scene_strip_range");
2387 RNA_def_property_array(prop, 4);
2388 RNA_def_property_ui_text(prop, "Scene Strip Range", "Color of scene strip range overlay");
2389 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2390
2391 /* Channel properties */
2392 prop = RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
2393 RNA_def_property_array(prop, 4);
2394 RNA_def_property_ui_text(prop, "Channels", "");
2395 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2396
2397 prop = RNA_def_property(srna, "channels_sub", PROP_FLOAT, PROP_COLOR_GAMMA);
2398 RNA_def_property_array(prop, 4);
2399 RNA_def_property_ui_text(prop, "Sub-channels", "");
2400 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2401
2402 prop = RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
2403 RNA_def_property_float_sdna(prop, nullptr, "channel_group");
2404 RNA_def_property_array(prop, 4);
2405 RNA_def_property_ui_text(prop, "Channel Group", "");
2406 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2407
2408 prop = RNA_def_property(srna, "channel_group_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2409 RNA_def_property_float_sdna(prop, nullptr, "channel_group_active");
2410 RNA_def_property_array(prop, 4);
2411 RNA_def_property_ui_text(prop, "Active Channel Group", "");
2412 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2413
2414 prop = RNA_def_property(srna, "channel", PROP_FLOAT, PROP_COLOR_GAMMA);
2415 RNA_def_property_array(prop, 4);
2416 RNA_def_property_ui_text(prop, "Channel", "");
2417 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2418
2419 prop = RNA_def_property(srna, "channel_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2420 RNA_def_property_array(prop, 4);
2421 RNA_def_property_ui_text(prop, "Selected Channel", "");
2422 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2423
2424 /* Keyframe properties */
2425 prop = RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
2426 RNA_def_property_array(prop, 3);
2427 RNA_def_property_ui_text(prop, "Keyframe", "Color of regular keyframe");
2428 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2429
2430 prop = RNA_def_property(srna, "keyframe_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2431 RNA_def_property_array(prop, 3);
2432 RNA_def_property_ui_text(prop, "Keyframe Selected", "Color of selected keyframe");
2433 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2434
2435 prop = RNA_def_property(srna, "keyframe_extreme", PROP_FLOAT, PROP_COLOR_GAMMA);
2436 RNA_def_property_array(prop, 3);
2437 RNA_def_property_ui_text(prop, "Extreme Keyframe", "Color of extreme keyframe");
2438 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2439
2440 prop = RNA_def_property(srna, "keyframe_extreme_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2441 RNA_def_property_array(prop, 3);
2443 prop, "Extreme Keyframe Selected", "Color of selected extreme keyframe");
2444 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2445
2446 prop = RNA_def_property(srna, "keyframe_breakdown", PROP_FLOAT, PROP_COLOR_GAMMA);
2447 RNA_def_property_array(prop, 3);
2448 RNA_def_property_ui_text(prop, "Breakdown Keyframe", "Color of breakdown keyframe");
2449 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2450
2451 prop = RNA_def_property(srna, "keyframe_breakdown_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2452 RNA_def_property_array(prop, 3);
2454 prop, "Breakdown Keyframe Selected", "Color of selected breakdown keyframe");
2455 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2456
2457 prop = RNA_def_property(srna, "keyframe_jitter", PROP_FLOAT, PROP_COLOR_GAMMA);
2458 RNA_def_property_array(prop, 3);
2459 RNA_def_property_ui_text(prop, "Jitter Keyframe", "Color of jitter keyframe");
2460 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2461
2462 prop = RNA_def_property(srna, "keyframe_jitter_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2463 RNA_def_property_array(prop, 3);
2464 RNA_def_property_ui_text(prop, "Jitter Keyframe Selected", "Color of selected jitter keyframe");
2465 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2466
2467 prop = RNA_def_property(srna, "keyframe_moving_hold", PROP_FLOAT, PROP_COLOR_GAMMA);
2468 RNA_def_property_array(prop, 3);
2469 RNA_def_property_ui_text(prop, "Moving Hold Keyframe", "Color of moving hold keyframe");
2470 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2471
2472 prop = RNA_def_property(srna, "keyframe_moving_hold_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2473 RNA_def_property_array(prop, 3);
2475 prop, "Moving Hold Keyframe Selected", "Color of selected moving hold keyframe");
2476 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2477
2478 prop = RNA_def_property(srna, "keyframe_generated", PROP_FLOAT, PROP_COLOR_GAMMA);
2479 RNA_def_property_array(prop, 3);
2480 RNA_def_property_ui_text(prop, "Generated Keyframe", "Color of generated keyframe");
2481 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2482
2483 prop = RNA_def_property(srna, "keyframe_generated_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2484 RNA_def_property_array(prop, 3);
2486 prop, "Generated Keyframe Selected", "Color of selected generated keyframe");
2487 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2488
2489 prop = RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
2490 RNA_def_property_array(prop, 4);
2491 RNA_def_property_ui_text(prop, "Long Key", "");
2492 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2493
2494 prop = RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2495 RNA_def_property_array(prop, 4);
2496 RNA_def_property_ui_text(prop, "Long Key Selected", "");
2497 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2498}
2499
2501{
2502 StructRNA *srna;
2503 PropertyRNA *prop;
2504
2505 srna = RNA_def_struct(brna, "ThemeCommonCurves", nullptr);
2506 RNA_def_struct_sdna(srna, "ThemeCommonCurves");
2507 RNA_def_struct_ui_text(srna, "Common Curve Properties", "Shared curve theme properties");
2508
2509 /* Curve handle colors. */
2510 prop = RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
2511 RNA_def_property_float_sdna(prop, nullptr, "handle_free");
2512 RNA_def_property_array(prop, 3);
2513 RNA_def_property_ui_text(prop, "Free Handle", "");
2514 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2515
2516 prop = RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
2517 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_free");
2518 RNA_def_property_array(prop, 3);
2519 RNA_def_property_ui_text(prop, "Free Handle Selected", "");
2520 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2521
2522 prop = RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
2523 RNA_def_property_float_sdna(prop, nullptr, "handle_auto");
2524 RNA_def_property_array(prop, 3);
2525 RNA_def_property_ui_text(prop, "Auto Handle", "");
2526 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2527
2528 prop = RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
2529 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_auto");
2530 RNA_def_property_array(prop, 3);
2531 RNA_def_property_ui_text(prop, "Auto Handle Selected", "");
2532 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2533
2534 prop = RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
2535 RNA_def_property_float_sdna(prop, nullptr, "handle_vect");
2536 RNA_def_property_array(prop, 3);
2537 RNA_def_property_ui_text(prop, "Vector Handle", "");
2538 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2539
2540 prop = RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
2541 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_vect");
2542 RNA_def_property_array(prop, 3);
2543 RNA_def_property_ui_text(prop, "Vector Handle Selected", "");
2544 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2545
2546 prop = RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
2547 RNA_def_property_float_sdna(prop, nullptr, "handle_align");
2548 RNA_def_property_array(prop, 3);
2549 RNA_def_property_ui_text(prop, "Align Handle", "");
2550 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2551
2552 prop = RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
2553 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_align");
2554 RNA_def_property_array(prop, 3);
2555 RNA_def_property_ui_text(prop, "Align Handle Selected", "");
2556 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2557
2558 prop = RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
2559 RNA_def_property_float_sdna(prop, nullptr, "handle_auto_clamped");
2560 RNA_def_property_array(prop, 3);
2561 RNA_def_property_ui_text(prop, "Auto-Clamped Handle", "");
2562 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2563
2564 prop = RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
2565 RNA_def_property_float_sdna(prop, nullptr, "handle_sel_auto_clamped");
2566 RNA_def_property_array(prop, 3);
2567 RNA_def_property_ui_text(prop, "Auto-Clamped Handle Selected", "");
2568 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2569
2570 /* Curve handle point colors & size. */
2571 prop = RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
2572 RNA_def_property_array(prop, 3);
2573 RNA_def_property_ui_text(prop, "Handle Vertex", "");
2574 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2575
2576 prop = RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2577 RNA_def_property_array(prop, 3);
2578 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
2579 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2580
2581 prop = RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_PIXEL);
2582 RNA_def_property_range(prop, 1, 100);
2583 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
2584 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2585}
2586
2588{
2589 StructRNA *srna;
2590 PropertyRNA *prop;
2591
2594
2595 srna = RNA_def_struct(brna, "ThemeCommon", nullptr);
2597 srna, "Common Theme Properties", "Theme properties shared by different editors");
2598
2599 prop = RNA_def_property(srna, "anim", PROP_POINTER, PROP_NONE);
2601 RNA_def_property_ui_text(prop, "Animation", "");
2602 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2603
2604 prop = RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
2606 RNA_def_property_ui_text(prop, "Curves", "");
2607 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2608}
2609
2611{
2612 PropertyRNA *prop;
2613
2614 prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
2615 RNA_def_property_array(prop, 3);
2616 RNA_def_property_ui_text(prop, "Title", "");
2617 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2618
2619 prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
2620 RNA_def_property_array(prop, 3);
2621 RNA_def_property_ui_text(prop, "Text", "");
2622 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2623
2624 prop = RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
2625 RNA_def_property_array(prop, 3);
2626 RNA_def_property_ui_text(prop, "Text Highlight", "");
2627 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2628
2629 /* header */
2630 prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
2631 RNA_def_property_array(prop, 4);
2632 RNA_def_property_ui_text(prop, "Header", "");
2633 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2634
2635 prop = RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
2636 RNA_def_property_array(prop, 3);
2637 RNA_def_property_ui_text(prop, "Header Text", "");
2638 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2639
2640 prop = RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
2641 RNA_def_property_array(prop, 3);
2642 RNA_def_property_ui_text(prop, "Header Text Highlight", "");
2643 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2644}
2645
2647{
2648 StructRNA *srna;
2649 PropertyRNA *prop;
2650
2651 srna = RNA_def_struct(brna, "ThemeSpaceGradient", nullptr);
2652 RNA_def_struct_sdna(srna, "ThemeSpace");
2653 RNA_def_struct_ui_text(srna, "Theme Space Settings", "");
2654
2655 /* gradient/background settings */
2656 prop = RNA_def_property(srna, "gradients", PROP_POINTER, PROP_NONE);
2658 RNA_def_property_struct_type(prop, "ThemeGradientColors");
2659 RNA_def_property_pointer_funcs(prop, "rna_Theme_gradient_colors_get", nullptr, nullptr, nullptr);
2660 RNA_def_property_ui_text(prop, "Gradient Colors", "");
2661 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2662
2664}
2665
2667{
2668 StructRNA *srna;
2669 PropertyRNA *prop;
2670
2671 srna = RNA_def_struct(brna, "ThemeSpaceGeneric", nullptr);
2672 RNA_def_struct_sdna(srna, "ThemeSpace");
2673 RNA_def_struct_ui_text(srna, "Theme Space Settings", "");
2674
2675 prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
2676 RNA_def_property_array(prop, 3);
2677 RNA_def_property_ui_text(prop, "Window Background", "");
2678 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2679
2681}
2682
2684{
2685 PropertyRNA *prop;
2686
2687 prop = RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
2689 RNA_def_property_struct_type(prop, "ThemeSpaceGeneric");
2690 RNA_def_property_pointer_funcs(prop, "rna_Theme_space_generic_get", nullptr, nullptr, nullptr);
2691 RNA_def_property_ui_text(prop, "Theme Space", "Settings for space");
2692}
2693
2695{
2696 PropertyRNA *prop;
2697
2698 prop = RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
2700 RNA_def_property_struct_type(prop, "ThemeSpaceGradient");
2701 RNA_def_property_pointer_funcs(prop, "rna_Theme_space_gradient_get", nullptr, nullptr, nullptr);
2702 RNA_def_property_ui_text(prop, "Theme Space", "Settings for space");
2703}
2704
2705static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna, const bool has_vertex_active)
2706{
2707 PropertyRNA *prop;
2708
2709 prop = RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
2710 RNA_def_property_array(prop, 3);
2711 RNA_def_property_ui_text(prop, "Vertex", "");
2712 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2713
2714 prop = RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2715 RNA_def_property_array(prop, 3);
2716 RNA_def_property_ui_text(prop, "Vertex Select", "");
2717 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2718
2719 if (has_vertex_active) {
2720 prop = RNA_def_property(srna, "vertex_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2721 RNA_def_property_array(prop, 3);
2722 RNA_def_property_ui_text(prop, "Active Vertex", "");
2723 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2724 }
2725
2726 prop = RNA_def_property(srna, "vertex_size", PROP_INT, PROP_PIXEL);
2727 RNA_def_property_range(prop, 1, 32);
2728 RNA_def_property_ui_text(prop, "Vertex Size", "");
2729 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2730}
2731
2733{
2734 PropertyRNA *prop;
2735
2736 prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2737 RNA_def_property_array(prop, 3);
2738 RNA_def_property_ui_text(prop, "Edge Selection", "");
2739 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2740
2741 prop = RNA_def_property(srna, "edge_mode_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2742 RNA_def_property_array(prop, 3);
2743 RNA_def_property_ui_text(prop, "Edge Mode Selection", "");
2744 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2745}
2746
2747static void rna_def_userdef_theme_spaces_face(StructRNA *srna, const bool has_face_orientation)
2748{
2749 PropertyRNA *prop;
2750
2751 prop = RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
2752 RNA_def_property_array(prop, 4);
2753 RNA_def_property_ui_text(prop, "Face", "");
2754 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2755
2756 prop = RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2757 RNA_def_property_array(prop, 4);
2758 RNA_def_property_ui_text(prop, "Face Selection", "");
2759 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2760
2761 prop = RNA_def_property(srna, "face_mode_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2762 RNA_def_property_array(prop, 4);
2763 RNA_def_property_ui_text(prop, "Face Mode Selection", "");
2764 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2765
2766 prop = RNA_def_property(srna, "facedot_size", PROP_INT, PROP_PIXEL);
2767 RNA_def_property_range(prop, 1, 10);
2768 RNA_def_property_ui_text(prop, "Face Dot Size", "");
2769 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2770
2771 if (has_face_orientation) {
2772 prop = RNA_def_property(srna, "face_back", PROP_FLOAT, PROP_COLOR_GAMMA);
2773 RNA_def_property_array(prop, 4);
2774 RNA_def_property_ui_text(prop, "Face Orientation Back", "");
2775 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2776
2777 prop = RNA_def_property(srna, "face_front", PROP_FLOAT, PROP_COLOR_GAMMA);
2778 RNA_def_property_array(prop, 4);
2779 RNA_def_property_ui_text(prop, "Face Orientation Front", "");
2780 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2781 }
2782}
2783
2785{
2786 PropertyRNA *prop;
2787
2788 prop = RNA_def_property(srna, "gp_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
2789 RNA_def_property_array(prop, 3);
2790 RNA_def_property_ui_text(prop, "Grease Pencil Vertex", "");
2791 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2792
2793 prop = RNA_def_property(srna, "gp_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
2794 RNA_def_property_array(prop, 3);
2795 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Select", "");
2796 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2797
2798 prop = RNA_def_property(srna, "gp_vertex_size", PROP_INT, PROP_PIXEL);
2799 RNA_def_property_range(prop, 1, 10);
2800 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Size", "");
2801 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2802}
2803
2805{
2806 StructRNA *srna;
2807 PropertyRNA *prop;
2808
2809 /* space_view3d */
2810
2811 srna = RNA_def_struct(brna, "ThemeView3D", nullptr);
2812 RNA_def_struct_sdna(srna, "ThemeSpace");
2813 RNA_def_struct_ui_text(srna, "Theme 3D Viewport", "Theme settings for the 3D viewport");
2814
2816
2817 /* General Viewport options */
2818
2819 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
2820 RNA_def_property_array(prop, 4);
2821 RNA_def_property_ui_text(prop, "Grid", "");
2822 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2823
2824 prop = RNA_def_property(srna, "clipping_border_3d", PROP_FLOAT, PROP_COLOR_GAMMA);
2825 RNA_def_property_array(prop, 4);
2826 RNA_def_property_ui_text(prop, "Clipping Border", "");
2827 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2828
2829 prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
2830 RNA_def_property_array(prop, 3);
2831 RNA_def_property_ui_text(prop, "Wire", "");
2832 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2833
2834 prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA);
2835 RNA_def_property_array(prop, 3);
2837 prop, "Wire Edit", "Color for wireframe when in edit mode, but edge selection is active");
2838 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2839
2840 prop = RNA_def_property(srna, "edge_width", PROP_INT, PROP_PIXEL);
2841 RNA_def_property_range(prop, 1, 32);
2842 RNA_def_property_ui_text(prop, "Edge Width", "");
2843 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2844
2845 /* Grease Pencil */
2846
2848
2849 prop = RNA_def_property(srna, "text_grease_pencil", PROP_FLOAT, PROP_COLOR_GAMMA);
2850 RNA_def_property_float_sdna(prop, nullptr, "time_gp_keyframe");
2851 RNA_def_property_array(prop, 3);
2853 prop, "Grease Pencil Keyframe", "Color for indicating Grease Pencil keyframes");
2854 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2855
2856 /* Object specific options */
2857
2858 prop = RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2859 RNA_def_property_float_sdna(prop, nullptr, "select");
2860 RNA_def_property_array(prop, 3);
2861 RNA_def_property_ui_text(prop, "Object Selected", "");
2862 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2863
2864 prop = RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2865 RNA_def_property_float_sdna(prop, nullptr, "active");
2866 RNA_def_property_array(prop, 3);
2867 RNA_def_property_ui_text(prop, "Active Object", "");
2868 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2869
2870 /* Object type options */
2871
2872 prop = RNA_def_property(srna, "camera", PROP_FLOAT, PROP_COLOR_GAMMA);
2873 RNA_def_property_array(prop, 3);
2874 RNA_def_property_ui_text(prop, "Camera", "");
2875 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2876
2877 prop = RNA_def_property(srna, "empty", PROP_FLOAT, PROP_COLOR_GAMMA);
2878 RNA_def_property_array(prop, 3);
2879 RNA_def_property_ui_text(prop, "Empty", "");
2881 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2882
2883 prop = RNA_def_property(srna, "light", PROP_FLOAT, PROP_COLOR_GAMMA);
2884 RNA_def_property_float_sdna(prop, nullptr, "lamp");
2885 RNA_def_property_array(prop, 4);
2886 RNA_def_property_ui_text(prop, "Light", "");
2888 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2889
2890 prop = RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
2891 RNA_def_property_array(prop, 3);
2892 RNA_def_property_ui_text(prop, "Speaker", "");
2893 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2894
2895 /* Mesh Object specific */
2896
2900
2901 prop = RNA_def_property(srna, "bevel", PROP_FLOAT, PROP_COLOR_GAMMA);
2902 RNA_def_property_array(prop, 3);
2903 RNA_def_property_ui_text(prop, "Bevel", "");
2904 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2905
2906 prop = RNA_def_property(srna, "seam", PROP_FLOAT, PROP_COLOR_GAMMA);
2907 RNA_def_property_array(prop, 3);
2908 RNA_def_property_ui_text(prop, "Seam", "");
2909 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2910
2911 prop = RNA_def_property(srna, "sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
2912 RNA_def_property_array(prop, 3);
2913 RNA_def_property_ui_text(prop, "Sharp", "");
2914 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2915
2916 prop = RNA_def_property(srna, "crease", PROP_FLOAT, PROP_COLOR_GAMMA);
2917 RNA_def_property_array(prop, 3);
2918 RNA_def_property_ui_text(prop, "Crease", "");
2920 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
2921
2922 prop = RNA_def_property(srna, "freestyle", PROP_FLOAT, PROP_COLOR_GAMMA);
2923 RNA_def_property_array(prop, 4);
2924 RNA_def_property_ui_text(prop, "Freestyle", "");
2925 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2926
2927 prop = RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
2928 RNA_def_property_array(prop, 3);
2929 RNA_def_property_ui_text(prop, "Edge Length Text", "");
2930 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2931
2932 prop = RNA_def_property(srna, "extra_edge_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
2933 RNA_def_property_array(prop, 3);
2934 RNA_def_property_ui_text(prop, "Edge Angle Text", "");
2935 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2936
2937 prop = RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
2938 RNA_def_property_array(prop, 3);
2939 RNA_def_property_ui_text(prop, "Face Angle Text", "");
2940 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2941
2942 prop = RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
2943 RNA_def_property_array(prop, 3);
2944 RNA_def_property_ui_text(prop, "Face Area Text", "");
2945 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2946
2947 prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
2948 RNA_def_property_array(prop, 4);
2949 RNA_def_property_ui_text(prop, "Active Vertex/Edge/Face", "");
2950 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2951
2952 prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
2953 RNA_def_property_array(prop, 3);
2954 RNA_def_property_ui_text(prop, "Face Normal", "");
2955 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2956
2957 prop = RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
2958 RNA_def_property_array(prop, 3);
2959 RNA_def_property_ui_text(prop, "Vertex Normal", "");
2960 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2961
2962 prop = RNA_def_property(srna, "split_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
2963 RNA_def_property_float_sdna(prop, nullptr, "loop_normal");
2964 RNA_def_property_array(prop, 3);
2965 RNA_def_property_ui_text(prop, "Custom Normal", "");
2966 RNA_def_property_update(prop, 0, "rna_userdef_update");
2967
2968 prop = RNA_def_property(srna, "vertex_unreferenced", PROP_FLOAT, PROP_COLOR_GAMMA);
2969 RNA_def_property_array(prop, 3);
2970 RNA_def_property_ui_text(prop, "Vertex Group Unreferenced", "");
2971 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2972
2973 prop = RNA_def_property(srna, "face_retopology", PROP_FLOAT, PROP_COLOR_GAMMA);
2974 RNA_def_property_array(prop, 4);
2975 RNA_def_property_ui_text(prop, "Face Retopology", "");
2976 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2977
2978 /* Curve Object specific */
2979
2980 prop = RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
2981 RNA_def_property_float_sdna(prop, nullptr, "nurb_uline");
2982 RNA_def_property_array(prop, 3);
2983 RNA_def_property_ui_text(prop, "NURBS U Lines", "");
2984 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2985
2986 prop = RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
2987 RNA_def_property_float_sdna(prop, nullptr, "nurb_vline");
2988 RNA_def_property_array(prop, 3);
2989 RNA_def_property_ui_text(prop, "NURBS V Lines", "");
2990 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2991
2992 prop = RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
2993 RNA_def_property_float_sdna(prop, nullptr, "nurb_sel_uline");
2994 RNA_def_property_array(prop, 3);
2995 RNA_def_property_ui_text(prop, "NURBS Active U Lines", "");
2996 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
2997
2998 prop = RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
2999 RNA_def_property_float_sdna(prop, nullptr, "nurb_sel_vline");
3000 RNA_def_property_array(prop, 3);
3001 RNA_def_property_ui_text(prop, "NURBS Active V Lines", "");
3002 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3003
3004 /* Armature Object specific. */
3005
3006 prop = RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
3007 RNA_def_property_array(prop, 3);
3008 RNA_def_property_ui_text(prop, "Bone Pose Selected", "Outline color of selected pose bones");
3009 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3010
3011 prop = RNA_def_property(srna, "bone_pose_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3012 RNA_def_property_array(prop, 3);
3013 RNA_def_property_ui_text(prop, "Bone Pose Active", "Outline color of active pose bones");
3014 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3015
3016 prop = RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
3017 RNA_def_property_array(prop, 3);
3018 RNA_def_property_ui_text(prop, "Bone Solid", "Default color of the solid shapes of bones");
3019 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3020
3021 prop = RNA_def_property(srna, "bone_locked_weight", PROP_FLOAT, PROP_COLOR_GAMMA);
3022 RNA_def_property_array(prop, 4);
3024 prop,
3025 "Bone Locked Weight",
3026 "Shade for bones corresponding to a locked weight group during painting");
3027 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3028
3029 /* Time specific. */
3030 prop = RNA_def_property(srna, "before_current_frame", PROP_FLOAT, PROP_COLOR_GAMMA);
3031 RNA_def_property_array(prop, 3);
3033 prop,
3034 "Before Current Frame",
3035 "The color for things before the current frame (for onion skinning, motion paths, etc.)");
3036 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3037
3038 prop = RNA_def_property(srna, "after_current_frame", PROP_FLOAT, PROP_COLOR_GAMMA);
3039 RNA_def_property_array(prop, 3);
3041 prop,
3042 "After Current Frame",
3043 "The color for things after the current frame (for onion skinning, motion paths, etc.)");
3044 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3045
3046 /* misc */
3047
3048 prop = RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
3049 RNA_def_property_float_sdna(prop, nullptr, "bundle_solid");
3050 RNA_def_property_array(prop, 3);
3051 RNA_def_property_ui_text(prop, "Bundle Solid", "");
3052 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3053
3054 prop = RNA_def_property(srna, "camera_path", PROP_FLOAT, PROP_COLOR_GAMMA);
3055 RNA_def_property_float_sdna(prop, nullptr, "camera_path");
3056 RNA_def_property_array(prop, 3);
3057 RNA_def_property_ui_text(prop, "Camera Path", "");
3058 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3059
3060 prop = RNA_def_property(srna, "camera_passepartout", PROP_FLOAT, PROP_COLOR_GAMMA);
3061 RNA_def_property_array(prop, 3);
3062 RNA_def_property_ui_text(prop, "Camera Passepartout", "");
3063 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3064
3065 prop = RNA_def_property(srna, "skin_root", PROP_FLOAT, PROP_COLOR_GAMMA);
3066 RNA_def_property_array(prop, 3);
3067 RNA_def_property_ui_text(prop, "Skin Root", "");
3068 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3069
3070 prop = RNA_def_property(srna, "view_overlay", PROP_FLOAT, PROP_COLOR_GAMMA);
3071 RNA_def_property_array(prop, 3);
3072 RNA_def_property_ui_text(prop, "View Overlay", "");
3073 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3074
3075 prop = RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
3076 RNA_def_property_array(prop, 3);
3077 RNA_def_property_ui_text(prop, "Transform", "");
3078 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3079
3080 prop = RNA_def_property(srna, "outline_width", PROP_INT, PROP_PIXEL);
3081 RNA_def_property_range(prop, 1, 5);
3082 RNA_def_property_ui_text(prop, "Outline Width", "");
3083 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3084
3085 prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL);
3086 RNA_def_property_int_sdna(prop, nullptr, "obcenter_dia");
3087 RNA_def_property_range(prop, 4, 10);
3089 prop, "Object Origin Size", "Diameter in pixels for object/light origin display");
3090 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3091}
3092
3094{
3095 StructRNA *srna;
3096 PropertyRNA *prop;
3097
3098 /* space_graph */
3099 srna = RNA_def_struct(brna, "ThemeGraphEditor", nullptr);
3100 RNA_def_struct_sdna(srna, "ThemeSpace");
3101 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
3102
3104
3105 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3106 RNA_def_property_array(prop, 3);
3107 RNA_def_property_ui_text(prop, "Grid", "");
3108 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3109
3111}
3112
3114{
3115 StructRNA *srna;
3116 PropertyRNA *prop;
3117
3118 /* space_file */
3119
3120 srna = RNA_def_struct(brna, "ThemeFileBrowser", nullptr);
3121 RNA_def_struct_sdna(srna, "ThemeSpace");
3122 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
3123
3125
3126 prop = RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
3127 RNA_def_property_float_sdna(prop, nullptr, "hilite");
3128 RNA_def_property_array(prop, 3);
3129 RNA_def_property_ui_text(prop, "Selected File", "");
3130 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3131
3132 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
3133 RNA_def_property_array(prop, 4);
3134 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
3135 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3136}
3137
3139{
3140 StructRNA *srna;
3141 PropertyRNA *prop;
3142
3143 /* space_outliner */
3144
3145 srna = RNA_def_struct(brna, "ThemeOutliner", nullptr);
3146 RNA_def_struct_sdna(srna, "ThemeSpace");
3147 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
3148
3150
3151 prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
3152 RNA_def_property_array(prop, 3);
3153 RNA_def_property_ui_text(prop, "Filter Match", "");
3154 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3155
3156 prop = RNA_def_property(srna, "selected_highlight", PROP_FLOAT, PROP_COLOR_GAMMA);
3157 RNA_def_property_array(prop, 3);
3158 RNA_def_property_ui_text(prop, "Selected Highlight", "");
3159 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3160
3161 prop = RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
3162 RNA_def_property_array(prop, 3);
3163 RNA_def_property_ui_text(prop, "Active Highlight", "");
3164 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3165
3166 prop = RNA_def_property(srna, "selected_object", PROP_FLOAT, PROP_COLOR_GAMMA);
3167 RNA_def_property_array(prop, 3);
3168 RNA_def_property_ui_text(prop, "Selected Objects", "");
3169 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3170
3171 prop = RNA_def_property(srna, "active_object", PROP_FLOAT, PROP_COLOR_GAMMA);
3172 RNA_def_property_array(prop, 3);
3173 RNA_def_property_ui_text(prop, "Active Object", "");
3174 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3175
3176 prop = RNA_def_property(srna, "edited_object", PROP_FLOAT, PROP_COLOR_GAMMA);
3177 RNA_def_property_array(prop, 4);
3178 RNA_def_property_ui_text(prop, "Edited Object", "");
3179 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3180
3181 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
3182 RNA_def_property_array(prop, 4);
3183 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
3184 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3185}
3186
3188{
3189 StructRNA *srna;
3190
3191 /* space_userpref */
3192
3193 srna = RNA_def_struct(brna, "ThemePreferences", nullptr);
3194 RNA_def_struct_sdna(srna, "ThemeSpace");
3195 RNA_def_struct_ui_text(srna, "Theme Preferences", "Theme settings for the Blender Preferences");
3196
3198}
3199
3201{
3202 StructRNA *srna;
3203 PropertyRNA *prop;
3204
3205 /* space_console */
3206
3207 srna = RNA_def_struct(brna, "ThemeConsole", nullptr);
3208 RNA_def_struct_sdna(srna, "ThemeSpace");
3209 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
3210
3212
3213 prop = RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
3214 RNA_def_property_float_sdna(prop, nullptr, "console_output");
3215 RNA_def_property_array(prop, 3);
3216 RNA_def_property_ui_text(prop, "Line Output", "");
3217 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3218
3219 prop = RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
3220 RNA_def_property_float_sdna(prop, nullptr, "console_input");
3221 RNA_def_property_array(prop, 3);
3222 RNA_def_property_ui_text(prop, "Line Input", "");
3223 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3224
3225 prop = RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
3226 RNA_def_property_float_sdna(prop, nullptr, "console_info");
3227 RNA_def_property_array(prop, 3);
3228 RNA_def_property_ui_text(prop, "Line Info", "");
3229 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3230
3231 prop = RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
3232 RNA_def_property_float_sdna(prop, nullptr, "console_error");
3233 RNA_def_property_array(prop, 3);
3234 RNA_def_property_ui_text(prop, "Line Error", "");
3235 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3236
3237 prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
3238 RNA_def_property_float_sdna(prop, nullptr, "console_cursor");
3239 RNA_def_property_array(prop, 3);
3240 RNA_def_property_ui_text(prop, "Cursor", "");
3241 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3242
3243 prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
3244 RNA_def_property_float_sdna(prop, nullptr, "console_select");
3245 RNA_def_property_array(prop, 4);
3246 RNA_def_property_ui_text(prop, "Selection", "");
3247 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3248}
3249
3251{
3252 StructRNA *srna;
3253 PropertyRNA *prop;
3254
3255 /* space_info */
3256
3257 srna = RNA_def_struct(brna, "ThemeInfo", nullptr);
3258 RNA_def_struct_sdna(srna, "ThemeSpace");
3259 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
3260
3262
3263 prop = RNA_def_property(srna, "info_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3264 RNA_def_property_array(prop, 3);
3265 RNA_def_property_ui_text(prop, "Selected Line Background", "Background color of selected line");
3266 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3267
3268 prop = RNA_def_property(srna, "info_selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3269 RNA_def_property_array(prop, 3);
3270 RNA_def_property_ui_text(prop, "Selected Line Text Color", "Text color of selected line");
3271 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3272
3273 prop = RNA_def_property(srna, "info_error_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3274 RNA_def_property_array(prop, 3);
3275 RNA_def_property_ui_text(prop, "Error Icon Foreground", "Foreground color of Error icon");
3276 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3277
3278 prop = RNA_def_property(srna, "info_warning_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3279 RNA_def_property_array(prop, 3);
3280 RNA_def_property_ui_text(prop, "Warning Icon Foreground", "Foreground color of Warning icon");
3281 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3282
3283 prop = RNA_def_property(srna, "info_info_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3284 RNA_def_property_array(prop, 3);
3285 RNA_def_property_ui_text(prop, "Info Icon Foreground", "Foreground color of Info icon");
3286 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3287
3288 prop = RNA_def_property(srna, "info_debug", PROP_FLOAT, PROP_COLOR_GAMMA);
3289 RNA_def_property_array(prop, 4);
3290 RNA_def_property_ui_text(prop, "Debug Icon Background", "Background color of Debug icon");
3291 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3292
3293 prop = RNA_def_property(srna, "info_debug_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3294 RNA_def_property_array(prop, 3);
3295 RNA_def_property_ui_text(prop, "Debug Icon Foreground", "Foreground color of Debug icon");
3296 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3297
3298 prop = RNA_def_property(srna, "info_property", PROP_FLOAT, PROP_COLOR_GAMMA);
3299 RNA_def_property_array(prop, 4);
3300 RNA_def_property_ui_text(prop, "Property Icon Background", "Background color of Property icon");
3301 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3302
3303 prop = RNA_def_property(srna, "info_property_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3304 RNA_def_property_array(prop, 3);
3305 RNA_def_property_ui_text(prop, "Property Icon Foreground", "Foreground color of Property icon");
3306 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3307
3308 prop = RNA_def_property(srna, "info_operator", PROP_FLOAT, PROP_COLOR_GAMMA);
3309 RNA_def_property_array(prop, 4);
3310 RNA_def_property_ui_text(prop, "Operator Icon Background", "Background color of Operator icon");
3311 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3312
3313 prop = RNA_def_property(srna, "info_operator_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3314 RNA_def_property_array(prop, 3);
3315 RNA_def_property_ui_text(prop, "Operator Icon Foreground", "Foreground color of Operator icon");
3316 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3317}
3318
3320{
3321 StructRNA *srna;
3322 PropertyRNA *prop;
3323
3324 /* space_text */
3325
3326 srna = RNA_def_struct(brna, "ThemeTextEditor", nullptr);
3327 RNA_def_struct_sdna(srna, "ThemeSpace");
3328 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
3329
3331
3332 prop = RNA_def_property(srna, "line_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
3333 RNA_def_property_float_sdna(prop, nullptr, "line_numbers");
3334 RNA_def_property_array(prop, 3);
3335 RNA_def_property_ui_text(prop, "Line Numbers", "");
3336 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3337
3338 prop = RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
3339 RNA_def_property_float_sdna(prop, nullptr, "grid");
3340 RNA_def_property_array(prop, 3);
3341 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
3342 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3343
3344 /* no longer used */
3345# if 0
3346 prop = RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
3347 RNA_def_property_float_sdna(prop, nullptr, "shade1");
3348 RNA_def_property_array(prop, 3);
3349 RNA_def_property_ui_text(prop, "Scroll Bar", "");
3350 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3351# endif
3352
3353 prop = RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3354 RNA_def_property_float_sdna(prop, nullptr, "shade2");
3355 RNA_def_property_array(prop, 3);
3356 RNA_def_property_ui_text(prop, "Selected Text", "");
3357 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3358
3359 prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
3360 RNA_def_property_float_sdna(prop, nullptr, "hilite");
3361 RNA_def_property_array(prop, 3);
3362 RNA_def_property_ui_text(prop, "Cursor", "");
3363 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3364
3365 prop = RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
3366 RNA_def_property_float_sdna(prop, nullptr, "syntaxb");
3367 RNA_def_property_array(prop, 3);
3368 RNA_def_property_ui_text(prop, "Syntax Built-In", "");
3369 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3370
3371 prop = RNA_def_property(srna, "syntax_symbols", PROP_FLOAT, PROP_COLOR_GAMMA);
3372 RNA_def_property_float_sdna(prop, nullptr, "syntaxs");
3373 RNA_def_property_array(prop, 3);
3374 RNA_def_property_ui_text(prop, "Syntax Symbols", "");
3375 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3376
3377 prop = RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
3378 RNA_def_property_float_sdna(prop, nullptr, "syntaxv");
3379 RNA_def_property_array(prop, 3);
3380 RNA_def_property_ui_text(prop, "Syntax Special", "");
3381 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3382
3383 prop = RNA_def_property(srna, "syntax_preprocessor", PROP_FLOAT, PROP_COLOR_GAMMA);
3384 RNA_def_property_float_sdna(prop, nullptr, "syntaxd");
3385 RNA_def_property_array(prop, 3);
3386 RNA_def_property_ui_text(prop, "Syntax Preprocessor", "");
3387 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3388
3389 prop = RNA_def_property(srna, "syntax_reserved", PROP_FLOAT, PROP_COLOR_GAMMA);
3390 RNA_def_property_float_sdna(prop, nullptr, "syntaxr");
3391 RNA_def_property_array(prop, 3);
3392 RNA_def_property_ui_text(prop, "Syntax Reserved", "");
3393 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3394
3395 prop = RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
3396 RNA_def_property_float_sdna(prop, nullptr, "syntaxc");
3397 RNA_def_property_array(prop, 3);
3398 RNA_def_property_ui_text(prop, "Syntax Comment", "");
3399 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3400
3401 prop = RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
3402 RNA_def_property_float_sdna(prop, nullptr, "syntaxl");
3403 RNA_def_property_array(prop, 3);
3404 RNA_def_property_ui_text(prop, "Syntax String", "");
3405 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3406
3407 prop = RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
3408 RNA_def_property_float_sdna(prop, nullptr, "syntaxn");
3409 RNA_def_property_array(prop, 3);
3410 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
3411 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3412}
3413
3415{
3416 StructRNA *srna;
3417 PropertyRNA *prop;
3418
3419 /* space_node */
3420
3421 srna = RNA_def_struct(brna, "ThemeNodeEditor", nullptr);
3422 RNA_def_struct_sdna(srna, "ThemeSpace");
3423 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
3424
3426
3427 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3428 RNA_def_property_array(prop, 3);
3429 RNA_def_property_ui_text(prop, "Grid", "");
3430 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3431
3432 prop = RNA_def_property(srna, "node_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
3433 RNA_def_property_float_sdna(prop, nullptr, "node_outline");
3434 RNA_def_property_array(prop, 4);
3435 RNA_def_property_ui_text(prop, "Node Outline", "");
3436 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3437
3438 prop = RNA_def_property(srna, "node_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3439 RNA_def_property_float_sdna(prop, nullptr, "select");
3440 RNA_def_property_array(prop, 3);
3441 RNA_def_property_ui_text(prop, "Node Selected", "");
3442 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3443
3444 prop = RNA_def_property(srna, "node_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3445 RNA_def_property_float_sdna(prop, nullptr, "active");
3446 RNA_def_property_array(prop, 3);
3447 RNA_def_property_ui_text(prop, "Active Node", "");
3448 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3449
3450 prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
3451 RNA_def_property_float_sdna(prop, nullptr, "wire");
3452 RNA_def_property_array(prop, 4);
3453 RNA_def_property_ui_text(prop, "Wires", "");
3454 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3455
3456 prop = RNA_def_property(srna, "wire_inner", PROP_FLOAT, PROP_COLOR_GAMMA);
3457 RNA_def_property_float_sdna(prop, nullptr, "syntaxr");
3458 RNA_def_property_array(prop, 3);
3459 RNA_def_property_ui_text(prop, "Wire Color", "");
3460 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3461
3462 prop = RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3463 RNA_def_property_float_sdna(prop, nullptr, "edge_select");
3464 RNA_def_property_array(prop, 4);
3465 RNA_def_property_ui_text(prop, "Wire Select", "");
3466 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3467
3468 prop = RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
3469 RNA_def_property_float_sdna(prop, nullptr, "syntaxl");
3470 RNA_def_property_array(prop, 4);
3471 RNA_def_property_ui_text(prop, "Node Backdrop", "");
3472 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3473
3474 prop = RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3475 RNA_def_property_float_sdna(prop, nullptr, "syntaxv");
3476 RNA_def_property_array(prop, 3);
3477 RNA_def_property_ui_text(prop, "Converter Node", "");
3478 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3479
3480 prop = RNA_def_property(srna, "color_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3481 RNA_def_property_float_sdna(prop, nullptr, "syntaxb");
3482 RNA_def_property_array(prop, 3);
3483 RNA_def_property_ui_text(prop, "Color Node", "");
3484 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3485
3486 prop = RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3487 RNA_def_property_float_sdna(prop, nullptr, "syntaxc");
3488 RNA_def_property_array(prop, 3);
3489 RNA_def_property_ui_text(prop, "Group Node", "");
3490 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3491
3492 prop = RNA_def_property(srna, "group_socket_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3493 RNA_def_property_float_sdna(prop, nullptr, "console_output");
3494 RNA_def_property_array(prop, 3);
3495 RNA_def_property_ui_text(prop, "Group Socket Node", "");
3496 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3497
3498 prop = RNA_def_property(srna, "frame_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3499 RNA_def_property_float_sdna(prop, nullptr, "movie");
3500 RNA_def_property_array(prop, 4);
3501 RNA_def_property_ui_text(prop, "Frame Node", "");
3502 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3503
3504 prop = RNA_def_property(srna, "matte_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3505 RNA_def_property_float_sdna(prop, nullptr, "syntaxs");
3506 RNA_def_property_array(prop, 3);
3507 RNA_def_property_ui_text(prop, "Matte Node", "");
3508 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3509
3510 prop = RNA_def_property(srna, "distor_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3511 RNA_def_property_float_sdna(prop, nullptr, "syntaxd");
3512 RNA_def_property_array(prop, 3);
3513 RNA_def_property_ui_text(prop, "Distort Node", "");
3514 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3515
3516 prop = RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
3517 RNA_def_property_int_sdna(prop, nullptr, "noodle_curving");
3519 RNA_def_property_range(prop, 0, 10);
3520 RNA_def_property_ui_text(prop, "Noodle Curving", "Curving of the noodle");
3521 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3522
3523 prop = RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
3524 RNA_def_property_int_sdna(prop, nullptr, "grid_levels");
3526 RNA_def_property_range(prop, 0, 3);
3528 prop, "Grid Levels", "Number of subdivisions for the dot grid displayed in the background");
3529 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3530
3531 prop = RNA_def_property(srna, "dash_alpha", PROP_FLOAT, PROP_FACTOR);
3532 RNA_def_property_range(prop, 0.0f, 1.0f);
3534 RNA_def_property_ui_text(prop, "Dashed Lines Opacity", "Opacity for the dashed lines in wires");
3535 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3536
3537 prop = RNA_def_property(srna, "input_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3538 RNA_def_property_float_sdna(prop, nullptr, "syntaxn");
3539 RNA_def_property_array(prop, 3);
3540 RNA_def_property_ui_text(prop, "Input Node", "");
3541 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3542
3543 prop = RNA_def_property(srna, "output_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3544 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_output");
3545 RNA_def_property_array(prop, 3);
3546 RNA_def_property_ui_text(prop, "Output Node", "");
3547 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3548
3549 prop = RNA_def_property(srna, "filter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3550 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_filter");
3551 RNA_def_property_array(prop, 3);
3552 RNA_def_property_ui_text(prop, "Filter Node", "");
3553 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3554
3555 prop = RNA_def_property(srna, "vector_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3556 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_vector");
3557 RNA_def_property_array(prop, 3);
3558 RNA_def_property_ui_text(prop, "Vector Node", "");
3559 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3560
3561 prop = RNA_def_property(srna, "texture_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3562 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_texture");
3563 RNA_def_property_array(prop, 3);
3564 RNA_def_property_ui_text(prop, "Texture Node", "");
3565 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3566
3567 prop = RNA_def_property(srna, "shader_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3568 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_shader");
3569 RNA_def_property_array(prop, 3);
3570 RNA_def_property_ui_text(prop, "Shader Node", "");
3571 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3572
3573 prop = RNA_def_property(srna, "script_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3574 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_script");
3575 RNA_def_property_array(prop, 3);
3576 RNA_def_property_ui_text(prop, "Script Node", "");
3577 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3578
3579 prop = RNA_def_property(srna, "geometry_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3580 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_geometry");
3581 RNA_def_property_array(prop, 3);
3582 RNA_def_property_ui_text(prop, "Geometry Node", "");
3583 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3584
3585 prop = RNA_def_property(srna, "attribute_node", PROP_FLOAT, PROP_COLOR_GAMMA);
3586 RNA_def_property_float_sdna(prop, nullptr, "nodeclass_attribute");
3587 RNA_def_property_array(prop, 3);
3588 RNA_def_property_ui_text(prop, "Attribute Node", "");
3589 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3590
3591 prop = RNA_def_property(srna, "simulation_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3592 RNA_def_property_float_sdna(prop, nullptr, "node_zone_simulation");
3593 RNA_def_property_array(prop, 4);
3594 RNA_def_property_ui_text(prop, "Simulation Zone", "");
3595 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3596
3597 prop = RNA_def_property(srna, "repeat_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3598 RNA_def_property_float_sdna(prop, nullptr, "node_zone_repeat");
3599 RNA_def_property_array(prop, 4);
3600 RNA_def_property_ui_text(prop, "Repeat Zone", "");
3601 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3602
3603 prop = RNA_def_property(srna, "foreach_geometry_element_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3604 RNA_def_property_float_sdna(prop, nullptr, "node_zone_foreach_geometry_element");
3605 RNA_def_property_array(prop, 4);
3606 RNA_def_property_ui_text(prop, "For Each Geometry Element Zone", "");
3607 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3608
3609 prop = RNA_def_property(srna, "closure_zone", PROP_FLOAT, PROP_COLOR_GAMMA);
3610 RNA_def_property_float_sdna(prop, nullptr, "node_zone_closure");
3611 RNA_def_property_array(prop, 4);
3612 RNA_def_property_ui_text(prop, "Closure Zone", "");
3613 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3614}
3615
3617{
3618 StructRNA *srna;
3619 PropertyRNA *prop;
3620
3621 /* space_buts */
3622
3623 srna = RNA_def_struct(brna, "ThemeProperties", nullptr);
3624 RNA_def_struct_sdna(srna, "ThemeSpace");
3625 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
3626
3627 prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
3628 RNA_def_property_array(prop, 3);
3629 RNA_def_property_ui_text(prop, "Search Match", "");
3630 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3631
3633}
3634
3636{
3637 StructRNA *srna;
3638 PropertyRNA *prop;
3639
3640 /* space_image */
3641
3642 srna = RNA_def_struct(brna, "ThemeImageEditor", nullptr);
3643 RNA_def_struct_sdna(srna, "ThemeSpace");
3644 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
3645
3647
3648 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3649 RNA_def_property_array(prop, 4);
3650 RNA_def_property_ui_text(prop, "Grid", "");
3651 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3652
3655
3656 prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3657 RNA_def_property_array(prop, 4);
3658 RNA_def_property_ui_text(prop, "Active Vertex/Edge/Face", "");
3659 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3660
3661 prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA);
3662 RNA_def_property_array(prop, 3);
3663 RNA_def_property_ui_text(prop, "Wire Edit", "");
3664 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3665
3666 prop = RNA_def_property(srna, "edge_width", PROP_INT, PROP_PIXEL);
3667 RNA_def_property_range(prop, 1, 32);
3668 RNA_def_property_ui_text(prop, "Edge Width", "");
3669 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3670
3671 prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
3672 RNA_def_property_array(prop, 3);
3673 RNA_def_property_ui_text(prop, "Edge Select", "");
3674 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3675
3676 prop = RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
3677 RNA_def_property_float_sdna(prop, nullptr, "preview_back");
3678 RNA_def_property_array(prop, 4);
3679 RNA_def_property_ui_text(prop, "Scope Region Background", "");
3680 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3681
3682 prop = RNA_def_property(srna, "preview_stitch_face", PROP_FLOAT, PROP_COLOR_GAMMA);
3683 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_face");
3684 RNA_def_property_array(prop, 4);
3685 RNA_def_property_ui_text(prop, "Stitch Preview Face", "");
3686 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3687
3688 prop = RNA_def_property(srna, "preview_stitch_edge", PROP_FLOAT, PROP_COLOR_GAMMA);
3689 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_edge");
3690 RNA_def_property_array(prop, 4);
3691 RNA_def_property_ui_text(prop, "Stitch Preview Edge", "");
3692 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3693
3694 prop = RNA_def_property(srna, "preview_stitch_vert", PROP_FLOAT, PROP_COLOR_GAMMA);
3695 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_vert");
3696 RNA_def_property_array(prop, 4);
3697 RNA_def_property_ui_text(prop, "Stitch Preview Vertex", "");
3698 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3699
3700 prop = RNA_def_property(srna, "preview_stitch_stitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
3701 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_stitchable");
3702 RNA_def_property_array(prop, 4);
3703 RNA_def_property_ui_text(prop, "Stitch Preview Stitchable", "");
3704 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3705
3706 prop = RNA_def_property(srna, "preview_stitch_unstitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
3707 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_unstitchable");
3708 RNA_def_property_array(prop, 4);
3709 RNA_def_property_ui_text(prop, "Stitch Preview Unstitchable", "");
3710 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3711
3712 prop = RNA_def_property(srna, "preview_stitch_active", PROP_FLOAT, PROP_COLOR_GAMMA);
3713 RNA_def_property_float_sdna(prop, nullptr, "preview_stitch_active");
3714 RNA_def_property_array(prop, 4);
3715 RNA_def_property_ui_text(prop, "Stitch Preview Active Island", "");
3716 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3717
3718 prop = RNA_def_property(srna, "uv_shadow", PROP_FLOAT, PROP_COLOR_GAMMA);
3719 RNA_def_property_float_sdna(prop, nullptr, "uv_shadow");
3720 RNA_def_property_array(prop, 4);
3721 RNA_def_property_ui_text(prop, "Texture Paint/Modifier UVs", "");
3722 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3723
3724 prop = RNA_def_property(srna, "metadatabg", PROP_FLOAT, PROP_COLOR_GAMMA);
3725 RNA_def_property_float_sdna(prop, nullptr, "metadatabg");
3726 RNA_def_property_array(prop, 3);
3727 RNA_def_property_ui_text(prop, "Metadata Background", "");
3728 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3729
3730 prop = RNA_def_property(srna, "metadatatext", PROP_FLOAT, PROP_COLOR_GAMMA);
3731 RNA_def_property_float_sdna(prop, nullptr, "metadatatext");
3732 RNA_def_property_array(prop, 3);
3733 RNA_def_property_ui_text(prop, "Metadata Text", "");
3734 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3735}
3736
3738{
3739 StructRNA *srna;
3740 PropertyRNA *prop;
3741
3742 /* space_seq */
3743
3744 srna = RNA_def_struct(brna, "ThemeSequenceEditor", nullptr);
3745 RNA_def_struct_sdna(srna, "ThemeSpace");
3746 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
3747
3749
3750 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3751 RNA_def_property_array(prop, 3);
3752 RNA_def_property_ui_text(prop, "Grid", "");
3753 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3754
3755 prop = RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3756 RNA_def_property_float_sdna(prop, nullptr, "movie");
3757 RNA_def_property_array(prop, 3);
3758 RNA_def_property_ui_text(prop, "Movie Strip", "");
3759 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3760
3761 prop = RNA_def_property(srna, "movieclip_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3762 RNA_def_property_float_sdna(prop, nullptr, "movieclip");
3763 RNA_def_property_array(prop, 3);
3764 RNA_def_property_ui_text(prop, "Clip Strip", "");
3765 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3766
3767 prop = RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3768 RNA_def_property_float_sdna(prop, nullptr, "image");
3769 RNA_def_property_array(prop, 3);
3770 RNA_def_property_ui_text(prop, "Image Strip", "");
3771 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3772
3773 prop = RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3774 RNA_def_property_float_sdna(prop, nullptr, "scene");
3775 RNA_def_property_array(prop, 3);
3776 RNA_def_property_ui_text(prop, "Scene Strip", "");
3777 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3778
3779 prop = RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3780 RNA_def_property_float_sdna(prop, nullptr, "audio");
3781 RNA_def_property_array(prop, 3);
3782 RNA_def_property_ui_text(prop, "Audio Strip", "");
3783 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3784
3785 prop = RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3786 RNA_def_property_float_sdna(prop, nullptr, "effect");
3787 RNA_def_property_array(prop, 3);
3788 RNA_def_property_ui_text(prop, "Effect Strip", "");
3789 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3790
3791 prop = RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3792 RNA_def_property_float_sdna(prop, nullptr, "transition");
3793 RNA_def_property_array(prop, 3);
3794 RNA_def_property_ui_text(prop, "Transition Strip", "");
3795 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3796
3797 prop = RNA_def_property(srna, "color_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3798 RNA_def_property_array(prop, 3);
3799 RNA_def_property_ui_text(prop, "Color Strip", "");
3800 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3801
3802 prop = RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3803 RNA_def_property_float_sdna(prop, nullptr, "meta");
3804 RNA_def_property_array(prop, 3);
3805 RNA_def_property_ui_text(prop, "Meta Strip", "");
3806 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3807
3808 prop = RNA_def_property(srna, "mask_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3809 RNA_def_property_float_sdna(prop, nullptr, "mask");
3810 RNA_def_property_array(prop, 3);
3811 RNA_def_property_ui_text(prop, "Mask Strip", "");
3812 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3813
3814 prop = RNA_def_property(srna, "text_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3815 RNA_def_property_array(prop, 3);
3816 RNA_def_property_ui_text(prop, "Text Strip", "");
3817 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3818
3819 prop = RNA_def_property(srna, "active_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3820 RNA_def_property_array(prop, 3);
3821 RNA_def_property_ui_text(prop, "Active Strip", "");
3822 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3823
3824 prop = RNA_def_property(srna, "selected_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
3825 RNA_def_property_array(prop, 3);
3826 RNA_def_property_ui_text(prop, "Selected Strips", "");
3827 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3828
3829 prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA);
3830 RNA_def_property_float_sdna(prop, nullptr, "keyborder");
3831 RNA_def_property_array(prop, 4);
3832 RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border");
3833 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3834
3835 prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3836 RNA_def_property_float_sdna(prop, nullptr, "keyborder_select");
3837 RNA_def_property_array(prop, 4);
3838 RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border");
3839 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3840
3841 prop = RNA_def_property(srna, "preview_back", PROP_FLOAT, PROP_COLOR_GAMMA);
3842 RNA_def_property_float_sdna(prop, nullptr, "preview_back");
3843 RNA_def_property_array(prop, 3);
3844 RNA_def_property_ui_text(prop, "Preview Background", "");
3845 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3846
3847 prop = RNA_def_property(srna, "metadatabg", PROP_FLOAT, PROP_COLOR_GAMMA);
3848 RNA_def_property_float_sdna(prop, nullptr, "metadatabg");
3849 RNA_def_property_array(prop, 3);
3850 RNA_def_property_ui_text(prop, "Metadata Background", "");
3851 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3852
3853 prop = RNA_def_property(srna, "metadatatext", PROP_FLOAT, PROP_COLOR_GAMMA);
3854 RNA_def_property_float_sdna(prop, nullptr, "metadatatext");
3855 RNA_def_property_array(prop, 3);
3856 RNA_def_property_ui_text(prop, "Metadata Text", "");
3857 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3858
3859 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
3860 RNA_def_property_array(prop, 4);
3861 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
3862 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3863
3864 prop = RNA_def_property(srna, "text_strip_cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
3865 RNA_def_property_float_sdna(prop, nullptr, "text_strip_cursor");
3866 RNA_def_property_array(prop, 4);
3867 RNA_def_property_ui_text(prop, "Text Strip Cursor", "Text strip editing cursor");
3868 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3869
3870 prop = RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
3871 RNA_def_property_float_sdna(prop, nullptr, "selected_text");
3872 RNA_def_property_array(prop, 4);
3873 RNA_def_property_ui_text(prop, "Selected Text", "Text strip editing selection");
3874 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3875}
3876
3878{
3879 StructRNA *srna;
3880 PropertyRNA *prop;
3881
3882 /* space_action */
3883
3884 srna = RNA_def_struct(brna, "ThemeDopeSheet", nullptr);
3885 RNA_def_struct_sdna(srna, "ThemeSpace");
3886 RNA_def_struct_ui_text(srna, "Theme Dope Sheet", "Theme settings for the Dope Sheet");
3887
3889
3890 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3891 RNA_def_property_array(prop, 3);
3892 RNA_def_property_ui_text(prop, "Grid", "");
3893 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3894
3895 prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA);
3896 RNA_def_property_float_sdna(prop, nullptr, "keyborder");
3897 RNA_def_property_array(prop, 4);
3898 RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border");
3899 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3900
3901 prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3902 RNA_def_property_float_sdna(prop, nullptr, "keyborder_select");
3903 RNA_def_property_array(prop, 4);
3904 RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border");
3905 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3906
3907 prop = RNA_def_property(srna, "keyframe_scale_factor", PROP_FLOAT, PROP_NONE);
3908 RNA_def_property_float_sdna(prop, nullptr, "keyframe_scale_fac");
3911 prop, "Keyframe Scale Factor", "Scale factor for adjusting the height of keyframes");
3912 /* NOTE: These limits prevent buttons overlapping (min), and excessive size... (max). */
3913 RNA_def_property_range(prop, 0.8f, 5.0f);
3914 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_userdef_theme_update");
3915
3916 prop = RNA_def_property(srna, "summary", PROP_FLOAT, PROP_COLOR_GAMMA);
3917 RNA_def_property_float_sdna(prop, nullptr, "anim_active");
3918 RNA_def_property_array(prop, 4);
3919 RNA_def_property_ui_text(prop, "Summary", "Color of summary channel");
3920 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3921
3922 prop = RNA_def_property(srna, "interpolation_line", PROP_FLOAT, PROP_COLOR_GAMMA);
3923 RNA_def_property_float_sdna(prop, nullptr, "ds_ipoline");
3924 RNA_def_property_array(prop, 4);
3926 prop, "Interpolation Line", "Color of lines showing non-Bézier interpolation modes");
3927 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3928
3929 prop = RNA_def_property(srna, "simulated_frames", PROP_FLOAT, PROP_COLOR_GAMMA);
3930 RNA_def_property_float_sdna(prop, nullptr, "simulated_frames");
3931 RNA_def_property_array(prop, 4);
3932 RNA_def_property_ui_text(prop, "Simulated Frames", "");
3933 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3934}
3935
3937{
3938 StructRNA *srna;
3939 PropertyRNA *prop;
3940
3941 /* space_nla */
3942 srna = RNA_def_struct(brna, "ThemeNLAEditor", nullptr);
3943 RNA_def_struct_sdna(srna, "ThemeSpace");
3944 RNA_def_struct_ui_text(srna, "Theme Nonlinear Animation", "Theme settings for the NLA Editor");
3945
3947
3948 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
3949 RNA_def_property_array(prop, 3);
3950 RNA_def_property_ui_text(prop, "Grid", "");
3951 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3952
3953 prop = RNA_def_property(srna, "active_action", PROP_FLOAT, PROP_COLOR_GAMMA);
3954 RNA_def_property_float_sdna(prop, nullptr, "anim_active");
3955 RNA_def_property_array(prop, 4);
3956 RNA_def_property_ui_text(prop, "Active Action", "Animation data-block has active action");
3957 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3958
3959 prop = RNA_def_property(srna, "active_action_unset", PROP_FLOAT, PROP_COLOR_GAMMA);
3960 RNA_def_property_float_sdna(prop, nullptr, "anim_non_active");
3961 RNA_def_property_array(prop, 4);
3963 prop, "No Active Action", "Animation data-block does not have active action");
3964 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3965
3966 prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
3967 RNA_def_property_float_sdna(prop, nullptr, "strip");
3968 RNA_def_property_array(prop, 3);
3969 RNA_def_property_ui_text(prop, "Strips", "Unselected Action-Clip Strip");
3970 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3971
3972 prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3973 RNA_def_property_float_sdna(prop, nullptr, "strip_select");
3974 RNA_def_property_array(prop, 3);
3975 RNA_def_property_ui_text(prop, "Strips Selected", "Selected Action-Clip Strip");
3976 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3977
3978 prop = RNA_def_property(srna, "transition_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
3979 RNA_def_property_float_sdna(prop, nullptr, "nla_transition");
3980 RNA_def_property_array(prop, 3);
3981 RNA_def_property_ui_text(prop, "Transitions", "Unselected Transition Strip");
3982 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3983
3984 prop = RNA_def_property(srna, "transition_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3985 RNA_def_property_float_sdna(prop, nullptr, "nla_transition_sel");
3986 RNA_def_property_array(prop, 3);
3987 RNA_def_property_ui_text(prop, "Transitions Selected", "Selected Transition Strip");
3988 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3989
3990 prop = RNA_def_property(srna, "meta_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
3991 RNA_def_property_float_sdna(prop, nullptr, "nla_meta");
3992 RNA_def_property_array(prop, 3);
3994 prop, "Meta Strips", "Unselected Meta Strip (for grouping related strips)");
3995 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
3996
3997 prop = RNA_def_property(srna, "meta_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
3998 RNA_def_property_float_sdna(prop, nullptr, "nla_meta_sel");
3999 RNA_def_property_array(prop, 3);
4001 prop, "Meta Strips Selected", "Selected Meta Strip (for grouping related strips)");
4002 RNA_def_property_update(prop, 0, "rna_userdef_update");
4003
4004 prop = RNA_def_property(srna, "sound_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
4005 RNA_def_property_float_sdna(prop, nullptr, "nla_sound");
4006 RNA_def_property_array(prop, 3);
4008 prop, "Sound Strips", "Unselected Sound Strip (for timing speaker sounds)");
4009 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4010
4011 prop = RNA_def_property(srna, "sound_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4012 RNA_def_property_float_sdna(prop, nullptr, "nla_sound_sel");
4013 RNA_def_property_array(prop, 3);
4015 prop, "Sound Strips Selected", "Selected Sound Strip (for timing speaker sounds)");
4016 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4017
4018 prop = RNA_def_property(srna, "tweak", PROP_FLOAT, PROP_COLOR_GAMMA);
4019 RNA_def_property_float_sdna(prop, nullptr, "nla_tweaking");
4020 RNA_def_property_array(prop, 3);
4021 RNA_def_property_ui_text(prop, "Tweak", "Color for strip/action being \"tweaked\" or edited");
4022 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4023
4024 prop = RNA_def_property(srna, "tweak_duplicate", PROP_FLOAT, PROP_COLOR_GAMMA);
4025 RNA_def_property_float_sdna(prop, nullptr, "nla_tweakdupli");
4026 RNA_def_property_array(prop, 3);
4028 prop,
4029 "Tweak Duplicate Flag",
4030 "Warning/error indicator color for strips referencing the strip being tweaked");
4031 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4032
4033 prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA);
4034 RNA_def_property_float_sdna(prop, nullptr, "keyborder");
4035 RNA_def_property_array(prop, 4);
4036 RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border");
4037 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4038
4039 prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
4040 RNA_def_property_float_sdna(prop, nullptr, "keyborder_select");
4041 RNA_def_property_array(prop, 4);
4042 RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border");
4043 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4044}
4045
4047{
4048 StructRNA *srna;
4049 PropertyRNA *prop;
4050
4051 srna = RNA_def_struct(brna, "ThemeBoneColorSet", nullptr);
4052 RNA_def_struct_sdna(srna, "ThemeWireColor");
4053 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
4054
4055 prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
4056 RNA_def_property_float_sdna(prop, nullptr, "solid");
4057 RNA_def_property_array(prop, 3);
4058 RNA_def_property_ui_text(prop, "Regular", "Color used for the surface of bones");
4059 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4061
4062 prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
4063 RNA_def_property_float_sdna(prop, nullptr, "select");
4064 RNA_def_property_array(prop, 3);
4065 RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
4066 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4068
4069 prop = RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
4070 RNA_def_property_array(prop, 3);
4071 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
4072 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4074
4075 prop = RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
4078 prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
4079 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4080}
4081
4083{
4084 StructRNA *srna;
4085 PropertyRNA *prop;
4086
4087 srna = RNA_def_struct(brna, "ThemeCollectionColor", nullptr);
4088 RNA_def_struct_sdna(srna, "ThemeCollectionColor");
4089 RNA_def_struct_ui_text(srna, "Theme Collection Color", "Theme settings for collection colors");
4090
4091 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
4092 RNA_def_property_float_sdna(prop, nullptr, "color");
4093 RNA_def_property_array(prop, 3);
4094 RNA_def_property_ui_text(prop, "Color", "Collection Color Tag");
4095 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4096}
4097
4099{
4100 StructRNA *srna;
4101 PropertyRNA *prop;
4102
4103 srna = RNA_def_struct(brna, "ThemeStripColor", nullptr);
4104 RNA_def_struct_sdna(srna, "ThemeStripColor");
4105 RNA_def_struct_ui_text(srna, "Theme Strip Color", "Theme settings for strip colors");
4106
4107 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
4108 RNA_def_property_float_sdna(prop, nullptr, "color");
4109 RNA_def_property_array(prop, 3);
4110 RNA_def_property_ui_text(prop, "Color", "Strip Color");
4111 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4112}
4113
4115{
4116 StructRNA *srna;
4117 PropertyRNA *prop;
4118
4119 /* space_clip */
4120
4121 srna = RNA_def_struct(brna, "ThemeClipEditor", nullptr);
4122 RNA_def_struct_sdna(srna, "ThemeSpace");
4123 RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
4124
4126
4127 prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
4128 RNA_def_property_array(prop, 4);
4129 RNA_def_property_ui_text(prop, "Grid", "");
4130 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4131
4132 prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
4133 RNA_def_property_float_sdna(prop, nullptr, "marker_outline");
4134 RNA_def_property_array(prop, 3);
4135 RNA_def_property_ui_text(prop, "Marker Outline", "Color of marker's outline");
4136 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4137
4138 prop = RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4139 RNA_def_property_float_sdna(prop, nullptr, "marker");
4140 RNA_def_property_array(prop, 3);
4141 RNA_def_property_ui_text(prop, "Marker", "Color of marker");
4143 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4144
4145 prop = RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4146 RNA_def_property_float_sdna(prop, nullptr, "act_marker");
4147 RNA_def_property_array(prop, 3);
4148 RNA_def_property_ui_text(prop, "Active Marker", "Color of active marker");
4149 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4150
4151 prop = RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4152 RNA_def_property_float_sdna(prop, nullptr, "sel_marker");
4153 RNA_def_property_array(prop, 3);
4154 RNA_def_property_ui_text(prop, "Selected Marker", "Color of selected marker");
4155 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4156
4157 prop = RNA_def_property(srna, "disabled_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4158 RNA_def_property_float_sdna(prop, nullptr, "dis_marker");
4159 RNA_def_property_array(prop, 3);
4160 RNA_def_property_ui_text(prop, "Disabled Marker", "Color of disabled marker");
4161 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4162
4163 prop = RNA_def_property(srna, "locked_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
4164 RNA_def_property_float_sdna(prop, nullptr, "lock_marker");
4165 RNA_def_property_array(prop, 3);
4166 RNA_def_property_ui_text(prop, "Locked Marker", "Color of locked marker");
4167 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4168
4169 prop = RNA_def_property(srna, "path_before", PROP_FLOAT, PROP_COLOR_GAMMA);
4170 RNA_def_property_float_sdna(prop, nullptr, "path_before");
4171 RNA_def_property_array(prop, 3);
4172 RNA_def_property_ui_text(prop, "Path Before", "Color of path before current frame");
4173 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4174
4175 prop = RNA_def_property(srna, "path_after", PROP_FLOAT, PROP_COLOR_GAMMA);
4176 RNA_def_property_float_sdna(prop, nullptr, "path_after");
4177 RNA_def_property_array(prop, 3);
4178 RNA_def_property_ui_text(prop, "Path After", "Color of path after current frame");
4179 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4180
4181 prop = RNA_def_property(srna, "path_keyframe_before", PROP_FLOAT, PROP_COLOR_GAMMA);
4182 RNA_def_property_array(prop, 3);
4184 prop, "Path Keyframe Before", "Color of keyframes on a path before current frame");
4185 RNA_def_property_update(prop, 0, "rna_userdef_update");
4186
4187 prop = RNA_def_property(srna, "path_keyframe_after", PROP_FLOAT, PROP_COLOR_GAMMA);
4188 RNA_def_property_array(prop, 3);
4190 prop, "Path Keyframe After", "Color of keyframes on a path after current frame");
4191 RNA_def_property_update(prop, 0, "rna_userdef_update");
4192
4193 prop = RNA_def_property(srna, "metadatabg", PROP_FLOAT, PROP_COLOR_GAMMA);
4194 RNA_def_property_float_sdna(prop, nullptr, "metadatabg");
4195 RNA_def_property_array(prop, 3);
4196 RNA_def_property_ui_text(prop, "Metadata Background", "");
4197 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4198
4199 prop = RNA_def_property(srna, "metadatatext", PROP_FLOAT, PROP_COLOR_GAMMA);
4200 RNA_def_property_float_sdna(prop, nullptr, "metadatatext");
4201 RNA_def_property_array(prop, 3);
4202 RNA_def_property_ui_text(prop, "Metadata Text", "");
4203 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4204}
4205
4207{
4208 StructRNA *srna;
4209
4210 /* space_topbar */
4211
4212 srna = RNA_def_struct(brna, "ThemeTopBar", nullptr);
4213 RNA_def_struct_sdna(srna, "ThemeSpace");
4214 RNA_def_struct_ui_text(srna, "Theme Top Bar", "Theme settings for the Top Bar");
4215
4217}
4218
4220{
4221 StructRNA *srna;
4222
4223 /* space_statusbar */
4224
4225 srna = RNA_def_struct(brna, "ThemeStatusBar", nullptr);
4226 RNA_def_struct_sdna(srna, "ThemeSpace");
4227 RNA_def_struct_ui_text(srna, "Theme Status Bar", "Theme settings for the Status Bar");
4228
4230}
4231
4233{
4234 StructRNA *srna;
4235 PropertyRNA *prop;
4236
4237 /* space_spreadsheet */
4238
4239 srna = RNA_def_struct(brna, "ThemeSpreadsheet", nullptr);
4240 RNA_def_struct_sdna(srna, "ThemeSpace");
4241 RNA_def_struct_ui_text(srna, "Theme Spreadsheet", "Theme settings for the Spreadsheet");
4242
4243 prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
4244 RNA_def_property_array(prop, 4);
4245 RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
4246 RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
4247
4249}
4250
4252{
4253 StructRNA *srna;
4254 PropertyRNA *prop;
4255
4256 static const EnumPropertyItem active_theme_area[] = {
4257 {0, "USER_INTERFACE", ICON_WORKSPACE, "User Interface", ""},
4258 {19, "STYLE", ICON_FONTPREVIEW, "Text Style", ""},
4259 {26, "REGIONS", ICON_NONE, "Regions", ""},
4260 {25, "COMMON", ICON_NONE, "Common", ""},
4261 {1, "VIEW_3D", ICON_VIEW3D, "3D Viewport", ""},
4262 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet/Timeline", ""},
4263 {16, "FILE_BROWSER", ICON_FILEBROWSER, "File/Asset Browser", ""},
4264 {3, "GRAPH_EDITOR", ICON_GRAPH, "Graph Editor/Drivers", ""},
4265 {6, "IMAGE_EDITOR", ICON_IMAGE, "Image/UV Editor", ""},
4266 {15, "INFO", ICON_INFO, "Info", ""},
4267 {20, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", ""},
4268 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
4269 {5, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", ""},
4270 {12, "OUTLINER", ICON_OUTLINER, "Outliner", ""},
4271 {14, "PREFERENCES", ICON_PREFERENCES, "Preferences", ""},
4272 {11, "PROPERTIES", ICON_PROPERTIES, "Properties", ""},
4273 {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
4274 {23, "SPREADSHEET", ICON_SPREADSHEET, "Spreadsheet"},
4275 {22, "STATUSBAR", ICON_STATUSBAR, "Status Bar", ""},
4276 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
4277 {21, "TOPBAR", ICON_TOPBAR, "Top Bar", ""},
4278 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", ""},
4279 {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
4280 {0, nullptr, 0, nullptr, nullptr},
4281 };
4282
4283 srna = RNA_def_struct(brna, "Theme", nullptr);
4284 RNA_def_struct_sdna(srna, "bTheme");
4285 RNA_def_struct_ui_text(srna, "Theme", "User interface styling and color settings");
4286
4287 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4288 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
4289 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_Theme_name_set");
4290 RNA_def_struct_name_property(srna, prop);
4291 /* XXX: for now putting this in presets is silly - its just Default */
4293
4294 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
4295 RNA_def_property_string_sdna(prop, nullptr, "filepath");
4297 prop, "File Path", "The path to the preset loaded into this theme (if any)");
4298 /* Don't store in presets. */
4300 RNA_def_property_update(prop, 0, "rna_userdef_update");
4301
4302 prop = RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
4303 RNA_def_property_enum_sdna(prop, nullptr, "active_theme_area");
4305 RNA_def_property_enum_items(prop, active_theme_area);
4306 RNA_def_property_ui_text(prop, "Active Theme Area", "");
4307
4308 prop = RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
4310 RNA_def_property_pointer_sdna(prop, nullptr, "tui");
4311 RNA_def_property_struct_type(prop, "ThemeUserInterface");
4312 RNA_def_property_ui_text(prop, "User Interface", "");
4313
4314 prop = RNA_def_property(srna, "regions", PROP_POINTER, PROP_NONE);
4316 RNA_def_property_struct_type(prop, "ThemeRegions");
4317 RNA_def_property_ui_text(prop, "Regions", "Theme properties for common editor regions");
4318
4319 prop = RNA_def_property(srna, "common", PROP_POINTER, PROP_NONE);
4321 RNA_def_property_struct_type(prop, "ThemeCommon");
4322 RNA_def_property_ui_text(prop, "Common", "Theme properties shared by different editors");
4323
4324 /* Space Types */
4325 prop = RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
4327 RNA_def_property_pointer_sdna(prop, nullptr, "space_view3d");
4328 RNA_def_property_struct_type(prop, "ThemeView3D");
4329 RNA_def_property_ui_text(prop, "3D Viewport", "");
4330
4331 prop = RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
4333 RNA_def_property_pointer_sdna(prop, nullptr, "space_graph");
4334 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
4335 RNA_def_property_ui_text(prop, "Graph Editor", "");
4336
4337 prop = RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
4339 RNA_def_property_pointer_sdna(prop, nullptr, "space_file");
4340 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
4341 RNA_def_property_ui_text(prop, "File Browser", "");
4342
4343 prop = RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
4345 RNA_def_property_pointer_sdna(prop, nullptr, "space_nla");
4346 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
4347 RNA_def_property_ui_text(prop, "Nonlinear Animation", "");
4348
4349 prop = RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
4351 RNA_def_property_pointer_sdna(prop, nullptr, "space_action");
4352 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
4353 RNA_def_property_ui_text(prop, "Dope Sheet", "");
4354
4355 prop = RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
4357 RNA_def_property_pointer_sdna(prop, nullptr, "space_image");
4358 RNA_def_property_struct_type(prop, "ThemeImageEditor");
4359 RNA_def_property_ui_text(prop, "Image Editor", "");
4360
4361 prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
4363 RNA_def_property_pointer_sdna(prop, nullptr, "space_sequencer");
4364 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
4365 RNA_def_property_ui_text(prop, "Sequence Editor", "");
4366
4367 prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
4369 RNA_def_property_pointer_sdna(prop, nullptr, "space_properties");
4370 RNA_def_property_struct_type(prop, "ThemeProperties");
4371 RNA_def_property_ui_text(prop, "Properties", "");
4372
4373 prop = RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
4375 RNA_def_property_pointer_sdna(prop, nullptr, "space_text");
4376 RNA_def_property_struct_type(prop, "ThemeTextEditor");
4377 RNA_def_property_ui_text(prop, "Text Editor", "");
4378
4379 prop = RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
4381 RNA_def_property_pointer_sdna(prop, nullptr, "space_node");
4382 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
4383 RNA_def_property_ui_text(prop, "Node Editor", "");
4384
4385 prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
4387 RNA_def_property_pointer_sdna(prop, nullptr, "space_outliner");
4388 RNA_def_property_struct_type(prop, "ThemeOutliner");
4389 RNA_def_property_ui_text(prop, "Outliner", "");
4390
4391 prop = RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
4393 RNA_def_property_pointer_sdna(prop, nullptr, "space_info");
4394 RNA_def_property_struct_type(prop, "ThemeInfo");
4395 RNA_def_property_ui_text(prop, "Info", "");
4396
4397 prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
4399 RNA_def_property_pointer_sdna(prop, nullptr, "space_preferences");
4400 RNA_def_property_struct_type(prop, "ThemePreferences");
4401 RNA_def_property_ui_text(prop, "Preferences", "");
4402
4403 prop = RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
4405 RNA_def_property_pointer_sdna(prop, nullptr, "space_console");
4406 RNA_def_property_struct_type(prop, "ThemeConsole");
4407 RNA_def_property_ui_text(prop, "Console", "");
4408
4409 prop = RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE);
4411 RNA_def_property_pointer_sdna(prop, nullptr, "space_clip");
4412 RNA_def_property_struct_type(prop, "ThemeClipEditor");
4413 RNA_def_property_ui_text(prop, "Clip Editor", "");
4414
4415 prop = RNA_def_property(srna, "topbar", PROP_POINTER, PROP_NONE);
4417 RNA_def_property_pointer_sdna(prop, nullptr, "space_topbar");
4418 RNA_def_property_struct_type(prop, "ThemeTopBar");
4419 RNA_def_property_ui_text(prop, "Top Bar", "");
4420
4421 prop = RNA_def_property(srna, "statusbar", PROP_POINTER, PROP_NONE);
4423 RNA_def_property_pointer_sdna(prop, nullptr, "space_statusbar");
4424 RNA_def_property_struct_type(prop, "ThemeStatusBar");
4425 RNA_def_property_ui_text(prop, "Status Bar", "");
4426
4427 prop = RNA_def_property(srna, "spreadsheet", PROP_POINTER, PROP_NONE);
4429 RNA_def_property_pointer_sdna(prop, nullptr, "space_spreadsheet");
4430 RNA_def_property_struct_type(prop, "ThemeSpreadsheet");
4431 RNA_def_property_ui_text(prop, "Spreadsheet", "");
4432 /* end space types */
4433
4434 prop = RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
4436 RNA_def_property_collection_sdna(prop, nullptr, "tarm", "");
4437 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
4438 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
4439
4440 prop = RNA_def_property(srna, "collection_color", PROP_COLLECTION, PROP_NONE);
4442 RNA_def_property_collection_sdna(prop, nullptr, "collection_color", "");
4443 RNA_def_property_struct_type(prop, "ThemeCollectionColor");
4444 RNA_def_property_ui_text(prop, "Collection Color", "");
4445
4446 prop = RNA_def_property(srna, "strip_color", PROP_COLLECTION, PROP_NONE);
4448 RNA_def_property_collection_sdna(prop, nullptr, "strip_color", "");
4449 RNA_def_property_struct_type(prop, "ThemeStripColor");
4450 RNA_def_property_ui_text(prop, "Strip Color", "");
4451}
4452
4454{
4455 StructRNA *srna;
4456 PropertyRNA *prop;
4457
4458 srna = RNA_def_struct(brna, "Addon", nullptr);
4459 RNA_def_struct_sdna(srna, "bAddon");
4460 RNA_def_struct_ui_text(srna, "Add-on", "Python add-ons to be loaded automatically");
4461
4462 prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
4463 RNA_def_property_ui_text(prop, "Module", "Module name");
4464 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_Addon_module_set");
4465 RNA_def_struct_name_property(srna, prop);
4466
4467 /* Collection active property */
4468 prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
4469 RNA_def_property_struct_type(prop, "AddonPreferences");
4470 RNA_def_property_pointer_funcs(prop, "rna_Addon_preferences_get", nullptr, nullptr, nullptr);
4471}
4472
4474{
4475 StructRNA *srna;
4476 FunctionRNA *func;
4477 PropertyRNA *parm;
4478
4479 srna = RNA_def_struct(brna, "StudioLights", nullptr);
4480 RNA_def_struct_sdna(srna, "UserDef");
4481 RNA_def_struct_ui_text(srna, "Studio Lights", "Collection of studio lights");
4482
4483 func = RNA_def_function(srna, "load", "rna_StudioLights_load");
4484 RNA_def_function_ui_description(func, "Load studiolight from file");
4485 parm = RNA_def_string(
4486 func, "path", nullptr, 0, "File Path", "File path where the studio light file can be found");
4488 parm = RNA_def_enum(func,
4489 "type",
4492 "Type",
4493 "The type for the new studio light");
4496 parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "Newly created StudioLight");
4497 RNA_def_function_return(func, parm);
4498
4499 func = RNA_def_function(srna, "new", "rna_StudioLights_new");
4500 RNA_def_function_ui_description(func, "Create studiolight from default lighting");
4501 parm = RNA_def_string(
4502 func,
4503 "path",
4504 nullptr,
4505 0,
4506 "Path",
4507 "Path to the file that will contain the lighting info (without extension)");
4509 parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "Newly created StudioLight");
4510 RNA_def_function_return(func, parm);
4511
4512 func = RNA_def_function(srna, "remove", "rna_StudioLights_remove");
4513 RNA_def_function_ui_description(func, "Remove a studio light");
4514 parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "The studio light to remove");
4516
4517 func = RNA_def_function(srna, "refresh", "rna_StudioLights_refresh");
4518 RNA_def_function_ui_description(func, "Refresh Studio Lights from disk");
4519}
4520
4522{
4523 StructRNA *srna;
4524 PropertyRNA *prop;
4525
4527 srna = RNA_def_struct(brna, "StudioLight", nullptr);
4528 RNA_def_struct_ui_text(srna, "Studio Light", "Studio light");
4529
4530 prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
4531 RNA_def_property_int_funcs(prop, "rna_UserDef_studiolight_index_get", nullptr, nullptr);
4533 RNA_def_property_ui_text(prop, "Index", "");
4534
4535 prop = RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
4536 RNA_def_property_boolean_funcs(prop, "rna_UserDef_studiolight_is_user_defined_get", nullptr);
4538 RNA_def_property_ui_text(prop, "User Defined", "");
4539
4540 prop = RNA_def_property(srna, "has_specular_highlight_pass", PROP_BOOLEAN, PROP_NONE);
4542 prop, "rna_UserDef_studiolight_has_specular_highlight_pass_get", nullptr);
4545 prop,
4546 "Has Specular Highlight",
4547 "Studio light image file has separate \"diffuse\" and \"specular\" passes");
4548
4549 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4551 RNA_def_property_enum_funcs(prop, "rna_UserDef_studiolight_type_get", nullptr, nullptr);
4553 RNA_def_property_ui_text(prop, "Type", "");
4555
4556 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4558 prop, "rna_UserDef_studiolight_name_get", "rna_UserDef_studiolight_name_length", nullptr);
4559 RNA_def_property_ui_text(prop, "Name", "");
4561 RNA_def_struct_name_property(srna, prop);
4562
4563 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
4565 prop, "rna_UserDef_studiolight_path_get", "rna_UserDef_studiolight_path_length", nullptr);
4566 RNA_def_property_ui_text(prop, "Path", "");
4568
4569 prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
4570 RNA_def_property_collection_sdna(prop, nullptr, "light_param", "");
4571 RNA_def_property_struct_type(prop, "UserSolidLight");
4573 "rna_UserDef_studiolight_solid_lights_begin",
4574 "rna_iterator_array_next",
4575 "rna_iterator_array_end",
4576 "rna_iterator_array_get",
4577 "rna_UserDef_studiolight_solid_lights_length",
4578 nullptr,
4579 nullptr,
4580 nullptr);
4582 prop, "Solid Lights", "Lights used to display objects in solid draw mode");
4584
4585 prop = RNA_def_property(srna, "light_ambient", PROP_FLOAT, PROP_COLOR);
4586 RNA_def_property_array(prop, 3);
4588 prop, "rna_UserDef_studiolight_light_ambient_get", nullptr, nullptr);
4590 prop, "Ambient Color", "Color of the ambient light that uniformly lit the scene");
4592
4594}
4595
4597{
4598 StructRNA *srna;
4599 PropertyRNA *prop;
4600
4601 srna = RNA_def_struct(brna, "PathCompare", nullptr);
4602 RNA_def_struct_sdna(srna, "bPathCompare");
4603 RNA_def_struct_ui_text(srna, "Path Compare", "Match paths against this value");
4604
4605 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
4606 RNA_def_property_ui_text(prop, "Path", "");
4608 RNA_def_struct_name_property(srna, prop);
4609
4610 prop = RNA_def_property(srna, "use_glob", PROP_BOOLEAN, PROP_NONE);
4611 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_PATHCMP_GLOB);
4612 RNA_def_property_ui_text(prop, "Use Wildcard", "Enable wildcard globbing");
4613}
4614
4616{
4617 StructRNA *srna;
4618 PropertyRNA *prop;
4619
4620 srna = RNA_def_struct(brna, "AddonPreferences", nullptr);
4621 RNA_def_struct_ui_text(srna, "Add-on Preferences", "");
4622 RNA_def_struct_sdna(srna, "bAddon"); /* WARNING: only a bAddon during registration */
4623
4624 RNA_def_struct_refine_func(srna, "rna_AddonPref_refine");
4626 srna, "rna_AddonPref_register", "rna_AddonPref_unregister", nullptr);
4627 RNA_def_struct_system_idprops_func(srna, "rna_AddonPref_idprops");
4629
4631
4632 /* registration */
4634 prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
4635 RNA_def_property_string_sdna(prop, nullptr, "module");
4638
4640}
4641
4676
4678{
4679 StructRNA *srna;
4680 PropertyRNA *prop;
4681 static const float default_dir[3] = {0.0f, 0.0f, 1.0f};
4682 static const float default_col[3] = {0.8f, 0.8f, 0.8f};
4683
4684 srna = RNA_def_struct(brna, "UserSolidLight", nullptr);
4685 RNA_def_struct_sdna(srna, "SolidLight");
4687 srna, "Solid Light", "Light used for Studio lighting in solid shading mode");
4688
4689 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
4690 RNA_def_property_boolean_sdna(prop, nullptr, "flag", 1);
4692 RNA_def_property_ui_text(prop, "Enabled", "Enable this light in solid shading mode");
4693 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
4694
4695 prop = RNA_def_property(srna, "smooth", PROP_FLOAT, PROP_FACTOR);
4696 RNA_def_property_float_sdna(prop, nullptr, "smooth");
4698 RNA_def_property_range(prop, 0.0f, 1.0f);
4699 RNA_def_property_ui_text(prop, "Smooth", "Smooth the lighting from this light");
4701 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
4702
4703 prop = RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
4704 RNA_def_property_float_sdna(prop, nullptr, "vec");
4705 RNA_def_property_array(prop, 3);
4706 RNA_def_property_float_array_default(prop, default_dir);
4707 RNA_def_property_ui_text(prop, "Direction", "Direction that the light is shining");
4708 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
4709
4710 prop = RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
4711 RNA_def_property_float_sdna(prop, nullptr, "spec");
4712 RNA_def_property_array(prop, 3);
4713 RNA_def_property_float_array_default(prop, default_col);
4714 RNA_def_property_ui_text(prop, "Specular Color", "Color of the light's specular highlight");
4715 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
4716
4717 prop = RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
4718 RNA_def_property_float_sdna(prop, nullptr, "col");
4719 RNA_def_property_array(prop, 3);
4720 RNA_def_property_float_array_default(prop, default_col);
4721 RNA_def_property_ui_text(prop, "Diffuse Color", "Color of the light's diffuse highlight");
4722 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
4723}
4724
4726{
4727 StructRNA *srna;
4728 PropertyRNA *prop;
4729
4730 srna = RNA_def_struct(brna, "WalkNavigation", nullptr);
4731 RNA_def_struct_sdna(srna, "WalkNavigation");
4732 RNA_def_struct_ui_text(srna, "Walk Navigation", "Walk navigation settings");
4733
4734 prop = RNA_def_property(srna, "mouse_speed", PROP_FLOAT, PROP_NONE);
4735 RNA_def_property_range(prop, 0.01f, 10.0f);
4737 prop,
4738 "Mouse Sensitivity",
4739 "Speed factor for when looking around, high values mean faster mouse movement");
4740
4741 prop = RNA_def_property(srna, "walk_speed", PROP_FLOAT, PROP_VELOCITY);
4742 RNA_def_property_range(prop, 0.01f, 100.0f);
4743 RNA_def_property_ui_text(prop, "Walk Speed", "Base speed for walking and flying");
4744
4745 prop = RNA_def_property(srna, "walk_speed_factor", PROP_FLOAT, PROP_NONE);
4746 RNA_def_property_range(prop, 0.01f, 10.0f);
4748 prop, "Speed Factor", "Multiplication factor when using the fast or slow modifiers");
4749
4750 prop = RNA_def_property(srna, "view_height", PROP_FLOAT, PROP_UNIT_LENGTH);
4751 RNA_def_property_ui_range(prop, 0.1f, 10.0f, 0.1, 2);
4752 RNA_def_property_range(prop, 0.0f, 1000.0f);
4753 RNA_def_property_ui_text(prop, "View Height", "View distance from the floor when walking");
4754
4755 prop = RNA_def_property(srna, "jump_height", PROP_FLOAT, PROP_UNIT_LENGTH);
4756 RNA_def_property_ui_range(prop, 0.1f, 10.0f, 0.1, 2);
4757 RNA_def_property_range(prop, 0.1f, 100.0f);
4758 RNA_def_property_ui_text(prop, "Jump Height", "Maximum height of a jump");
4759
4760 prop = RNA_def_property(srna, "teleport_time", PROP_FLOAT, PROP_NONE);
4761 RNA_def_property_range(prop, 0.0f, 10.0f);
4763 prop, "Teleport Duration", "Interval of time warp when teleporting in navigation mode");
4764
4765 prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_BOOLEAN);
4766 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_WALK_GRAVITY);
4767 RNA_def_property_ui_text(prop, "Gravity", "Walk with gravity, or free navigate");
4768
4769 prop = RNA_def_property(srna, "use_mouse_reverse", PROP_BOOLEAN, PROP_BOOLEAN);
4771 RNA_def_property_ui_text(prop, "Reverse Mouse", "Reverse the vertical movement of the mouse");
4772}
4773
4775{
4776 StructRNA *srna;
4777 PropertyRNA *prop;
4778
4779 srna = RNA_def_struct(brna, "XrNavigation", nullptr);
4780 RNA_def_struct_sdna(srna, "XrNavigation");
4781 RNA_def_struct_ui_text(srna, "VR Navigation", "VR navigation settings");
4782
4783 prop = RNA_def_property(srna, "vignette_intensity", PROP_FLOAT, PROP_PERCENTAGE);
4784 RNA_def_property_range(prop, 0, 100.0);
4785 RNA_def_property_ui_range(prop, 0, 100.0, 1000, 0);
4787 prop, "Vignette Intensity", "Intensity of vignette that appears when moving");
4788
4789 prop = RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_ANGLE);
4791 RNA_def_property_ui_range(prop, 0, FLT_MAX, 1000, 0);
4792 RNA_def_property_ui_text(prop, "Turn Speed", "Turn speed in degrees per second");
4793
4794 prop = RNA_def_property(srna, "turn_amount", PROP_FLOAT, PROP_ANGLE);
4795 RNA_def_property_range(prop, 0, DEG2RAD(360));
4796 RNA_def_property_ui_range(prop, 0, DEG2RAD(360), 1000, 0);
4797 RNA_def_property_ui_text(prop, "Turn Amount", "Amount in degrees per turn when using snap turn");
4798
4799 prop = RNA_def_property(srna, "snap_turn", PROP_BOOLEAN, PROP_NONE);
4802 prop,
4803 "Snap Turn",
4804 "Instantly rotates the camera by a fixed angle instead of smoothly turning");
4805
4806 prop = RNA_def_property(srna, "invert_rotation", PROP_BOOLEAN, PROP_NONE);
4808 RNA_def_property_ui_text(prop, "Invert Rotation", "Reverses the direction of rotation input");
4809}
4810
4812{
4813 static const EnumPropertyItem timecode_styles[] = {
4815 "MINIMAL",
4816 0,
4817 "Minimal Info",
4818 "Most compact representation, uses '+' as separator for sub-second frame numbers, "
4819 "with left and right truncation of the timecode as necessary"},
4821 "SMPTE",
4822 0,
4823 "SMPTE (Full)",
4824 "Full SMPTE timecode (format is HH:MM:SS:FF)"},
4826 "SMPTE_COMPACT",
4827 0,
4828 "SMPTE (Compact)",
4829 "SMPTE timecode showing minutes, seconds, and frames only - "
4830 "hours are also shown if necessary, but not by default"},
4832 "MILLISECONDS",
4833 0,
4834 "Compact with Decimals",
4835 "Similar to SMPTE (Compact), except that the decimal part of the second is shown instead "
4836 "of frames"},
4838 "SECONDS_ONLY",
4839 0,
4840 "Only Seconds",
4841 "Direct conversion of frame numbers to seconds"},
4842 {0, nullptr, 0, nullptr, nullptr},
4843 };
4844
4845 static const EnumPropertyItem color_picker_types[] = {
4847 "CIRCLE_HSV",
4848 0,
4849 "Circle (HSV)",
4850 "A circular Hue/Saturation color wheel, with "
4851 "Value slider"},
4853 "CIRCLE_HSL",
4854 0,
4855 "Circle (HSL)",
4856 "A circular Hue/Saturation color wheel, with "
4857 "Lightness slider"},
4859 "SQUARE_SV",
4860 0,
4861 "Square (SV + H)",
4862 "A square showing Saturation/Value, with Hue slider"},
4864 "SQUARE_HS",
4865 0,
4866 "Square (HS + V)",
4867 "A square showing Hue/Saturation, with Value slider"},
4869 "SQUARE_HV",
4870 0,
4871 "Square (HV + S)",
4872 "A square showing Hue/Value, with Saturation slider"},
4873 {0, nullptr, 0, nullptr, nullptr},
4874 };
4875
4876 static const EnumPropertyItem zoom_frame_modes[] = {
4877 {ZOOM_FRAME_MODE_KEEP_RANGE, "KEEP_RANGE", 0, "Keep Range", ""},
4878 {ZOOM_FRAME_MODE_SECONDS, "SECONDS", 0, "Seconds", ""},
4879 {ZOOM_FRAME_MODE_KEYFRAMES, "KEYFRAMES", 0, "Keyframes", ""},
4880 {0, nullptr, 0, nullptr, nullptr},
4881 };
4882
4883 static const EnumPropertyItem line_width[] = {
4884 {-1, "THIN", 0, "Thin", "Thinner lines than the default"},
4885 {0, "AUTO", 0, "Default", "Automatic line width based on UI scale"},
4886 {1, "THICK", 0, "Thick", "Thicker lines than the default"},
4887 {0, nullptr, 0, nullptr, nullptr},
4888 };
4889
4890 static const EnumPropertyItem render_display_types[] = {
4892 "NONE",
4893 0,
4894 "Keep User Interface",
4895 "Images are rendered without changing the user interface"},
4897 "SCREEN",
4898 0,
4899 "Maximized Area",
4900 "Images are rendered in a maximized Image Editor"},
4902 "AREA",
4903 0,
4904 "Image Editor",
4905 "Images are rendered in an Image Editor"},
4907 "WINDOW",
4908 0,
4909 "New Window",
4910 "Images are rendered in a new window"},
4911 {0, nullptr, 0, nullptr, nullptr},
4912 };
4913 static const EnumPropertyItem temp_space_display_types[] = {
4915 "SCREEN", /* Could be FULLSCREEN, but keeping it consistent with render_display_types */
4916 0,
4917 "Maximized Area",
4918 "Open the temporary editor in a maximized screen"},
4920 "WINDOW",
4921 0,
4922 "New Window",
4923 "Open the temporary editor in a new window"},
4924 {0, nullptr, 0, nullptr, nullptr},
4925 };
4926
4927 PropertyRNA *prop;
4928 StructRNA *srna;
4929
4930 srna = RNA_def_struct(brna, "PreferencesView", nullptr);
4931 RNA_def_struct_sdna(srna, "UserDef");
4932 RNA_def_struct_nested(brna, srna, "Preferences");
4933 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
4934
4935 /* View. */
4936 prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_NONE);
4938 prop, "UI Scale", "Changes the size of the fonts and widgets in the interface");
4939 RNA_def_property_range(prop, 0.5f, 6.0f);
4940 RNA_def_property_ui_range(prop, 0.5f, 3.0f, 1, 2);
4941 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4942
4943 prop = RNA_def_property(srna, "border_width", PROP_INT, PROP_NONE);
4944 RNA_def_property_ui_text(prop, "Border Width", "Size of the padding around each editor.");
4945 RNA_def_property_range(prop, 1.0f, 10.0f);
4946 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4947
4948 prop = RNA_def_property(srna, "ui_line_width", PROP_ENUM, PROP_NONE);
4949 RNA_def_property_enum_items(prop, line_width);
4951 prop,
4952 "UI Line Width",
4953 "Changes the thickness of widget outlines, lines and dots in the interface");
4954 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4955
4956 /* display */
4957 prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
4958 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_TOOLTIPS);
4960 prop, "Tooltips", "Display tooltips (when disabled, hold Alt then hover to force display)");
4961
4962 prop = RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
4964 RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips");
4965
4966 prop = RNA_def_property(srna, "show_developer_ui", PROP_BOOLEAN, PROP_NONE);
4967 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_DEVELOPER_UI);
4969 prop, "Developer Extras", "Display advanced settings and tools for developers");
4970 RNA_def_property_update(prop, 0, "rna_userdef_update");
4971
4972 prop = RNA_def_property(srna, "show_area_handle", PROP_BOOLEAN, PROP_NONE);
4974 RNA_def_property_ui_text(prop, "Corner Handles", "Show visible area maintenance corner handles");
4975 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
4976
4977 prop = RNA_def_property(srna, "show_number_arrows", PROP_BOOLEAN, PROP_NONE);
4980 prop,
4981 "Show Numeric Input Arrows",
4982 "Display arrows in numeric input fields for increasing or decreasing values");
4983 RNA_def_property_update(prop, 0, "rna_userdef_update");
4984
4985 prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
4986 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DRAWVIEWINFO);
4988 "Display Object Info",
4989 "Include the name of the active object and the current frame number in "
4990 "the text info overlay");
4991 RNA_def_property_update(prop, 0, "rna_userdef_update");
4992
4993 prop = RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
4994 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_SHOW_VIEWPORTNAME);
4996 "Display View Name",
4997 "Include the name of the view orientation in the text info overlay");
4998 RNA_def_property_update(prop, 0, "rna_userdef_update");
4999
5000 prop = RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
5002 RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
5003
5004 prop = RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
5005 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_SHOW_FPS);
5007 "Display Playback Frame Rate (FPS)",
5008 "Include the number of frames displayed per second in the text info "
5009 "overlay while animation is played back");
5010 RNA_def_property_update(prop, 0, "rna_userdef_update");
5011
5012 prop = RNA_def_property(srna, "playback_fps_samples", PROP_INT, PROP_NONE);
5013 RNA_def_property_int_sdna(prop, nullptr, "playback_fps_samples");
5014 /* NOTE(@ideasman42): this maximum is arbitrary, 5000 samples averages over the last 10 seconds
5015 * for an animation playing back at 500fps, which seems like more than enough. */
5016 RNA_def_property_range(prop, 0, 5000);
5017 RNA_def_property_ui_range(prop, 0, 500, 1, 3);
5019 prop,
5020 "FPS Average Samples",
5021 "The number of frames to use for calculating FPS average. "
5022 "Zero to calculate this automatically, where the number of samples matches the target FPS.");
5023 RNA_def_property_update(prop, 0, "rna_userdef_update");
5024
5025 prop = RNA_def_property(srna, "use_fresnel_edit", PROP_BOOLEAN, PROP_NONE);
5028 "Edit Mode",
5029 "Enable a fresnel effect on edit mesh overlays.\n"
5030 "It improves shape readability of very dense meshes, "
5031 "but increases eye fatigue when modeling lower poly");
5032 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
5033
5035 prop = RNA_def_property(srna, "show_addons_enabled_only", PROP_BOOLEAN, PROP_NONE);
5037 prop, nullptr, "space_data.flag", USER_SPACEDATA_ADDONS_SHOW_ONLY_ENABLED);
5039 "Enabled Add-ons Only",
5040 "Only show enabled add-ons. Un-check to see all installed add-ons.");
5042
5043 static const EnumPropertyItem factor_display_items[] = {
5044 {USER_FACTOR_AS_FACTOR, "FACTOR", 0, "Factor", "Display factors as values between 0 and 1"},
5045 {USER_FACTOR_AS_PERCENTAGE, "PERCENTAGE", 0, "Percentage", "Display factors as percentages"},
5046 {0, nullptr, 0, nullptr, nullptr},
5047 };
5048
5049 prop = RNA_def_property(srna, "factor_display_type", PROP_ENUM, PROP_NONE);
5050 RNA_def_property_enum_items(prop, factor_display_items);
5051 RNA_def_property_ui_text(prop, "Factor Display Type", "How factor values are displayed");
5052 RNA_def_property_update(prop, 0, "rna_userdef_update");
5053
5054 /* Weight Paint */
5055
5056 prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
5057 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_CUSTOM_RANGE);
5059 prop,
5060 "Use Weight Color Range",
5061 "Enable color range used for weight visualization in weight painting mode");
5062 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
5063
5064 prop = RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
5066 RNA_def_property_pointer_sdna(prop, nullptr, "coba_weight");
5067 RNA_def_property_struct_type(prop, "ColorRamp");
5069 "Weight Color Range",
5070 "Color range used for weight visualization in weight painting mode");
5071 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
5072
5073 prop = RNA_def_property(srna, "show_navigate_ui", PROP_BOOLEAN, PROP_NONE);
5076 prop,
5077 "Navigation Controls",
5078 "Show navigation controls in 2D and 3D views which do not have scroll bars");
5079 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5080
5081 /* menus */
5082 prop = RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
5083 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_MENUOPENAUTO);
5085 prop,
5086 "Open on Mouse Over",
5087 "Open menu buttons and pull-downs automatically when the mouse is hovering");
5088
5089 prop = RNA_def_property(srna, "menu_close_leave", PROP_BOOLEAN, PROP_NONE);
5092 prop, "Close Menu on Leave", "Close menus when the mouse is moved out of the region.");
5093
5094 prop = RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
5095 RNA_def_property_int_sdna(prop, nullptr, "menuthreshold1");
5096 RNA_def_property_range(prop, 1, 40);
5098 prop,
5099 "Top Level Menu Open Delay",
5100 "Time delay in 1/10 seconds before automatically opening top level menus");
5101
5102 prop = RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
5103 RNA_def_property_int_sdna(prop, nullptr, "menuthreshold2");
5104 RNA_def_property_range(prop, 1, 40);
5106 prop,
5107 "Sub Level Menu Open Delay",
5108 "Time delay in 1/10 seconds before automatically opening sub level menus");
5109
5110 prop = RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
5111 RNA_def_property_enum_items(prop, color_picker_types);
5112 RNA_def_property_enum_sdna(prop, nullptr, "color_picker_type");
5114 prop, "Color Picker Type", "Different styles of displaying the color picker widget");
5115 RNA_def_property_update(prop, 0, "rna_userdef_update");
5116
5117 /* pie menus */
5118 prop = RNA_def_property(srna, "pie_initial_timeout", PROP_INT, PROP_NONE);
5119 RNA_def_property_range(prop, 0, 1000);
5121 prop,
5122 "Recenter Timeout",
5123 "Pie menus will use the initial mouse position as center for this amount of time "
5124 "(in 1/100ths of sec)");
5125
5126 prop = RNA_def_property(srna, "pie_tap_timeout", PROP_INT, PROP_NONE);
5127 RNA_def_property_range(prop, 0, 1000);
5129 "Tap Key Timeout",
5130 "Pie menu button held longer than this will dismiss menu on release "
5131 "(in 1/100ths of sec)");
5132
5133 prop = RNA_def_property(srna, "pie_animation_timeout", PROP_INT, PROP_NONE);
5134 RNA_def_property_range(prop, 0, 1000);
5136 prop,
5137 "Animation Timeout",
5138 "Time needed to fully animate the pie to unfolded state (in 1/100ths of sec)");
5139
5140 prop = RNA_def_property(srna, "pie_menu_radius", PROP_INT, PROP_PIXEL);
5141 RNA_def_property_range(prop, 0, 1000);
5142 RNA_def_property_ui_text(prop, "Radius", "Pie menu size in pixels");
5143
5144 prop = RNA_def_property(srna, "pie_menu_threshold", PROP_INT, PROP_PIXEL);
5145 RNA_def_property_range(prop, 0, 1000);
5147 prop, "Threshold", "Distance from center needed before a selection can be made");
5148
5149 prop = RNA_def_property(srna, "pie_menu_confirm", PROP_INT, PROP_PIXEL);
5150 RNA_def_property_range(prop, 0, 1000);
5152 "Confirm Threshold",
5153 "Distance threshold after which selection is made (zero to disable)");
5154
5155 prop = RNA_def_property(srna, "use_save_prompt", PROP_BOOLEAN, PROP_NONE);
5156 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_SAVE_PROMPT);
5158 prop, "Save Prompt", "Ask for confirmation when quitting with unsaved changes");
5159
5160 prop = RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
5161 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_PLAINMENUS);
5162 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
5163
5164 prop = RNA_def_property(srna, "use_filter_brushes_by_tool", PROP_BOOLEAN, PROP_NONE);
5167 "Filter Brushes by Tool",
5168 "Only show brushes applicable for the currently active tool in the "
5169 "asset shelf. Stored in the Preferences, which may have to be saved "
5170 "manually if Auto-Save Preferences is disabled");
5171 RNA_def_property_update(prop, 0, "rna_userdef_update");
5172
5173 static const EnumPropertyItem header_align_items[] = {
5174 {0, "NONE", 0, "Keep Existing", "Keep existing header alignment"},
5175 {USER_HEADER_FROM_PREF, "TOP", 0, "Top", "Top aligned on load"},
5177 "BOTTOM",
5178 0,
5179 "Bottom",
5180 "Bottom align on load (except for property editors)"},
5181 {0, nullptr, 0, nullptr, nullptr},
5182 };
5183 prop = RNA_def_property(srna, "header_align", PROP_ENUM, PROP_NONE);
5184 RNA_def_property_enum_items(prop, header_align_items);
5185 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "uiflag");
5187 RNA_def_property_ui_text(prop, "Header Position", "Default header position for new space-types");
5188 RNA_def_property_update(prop, 0, "rna_userdef_screen_update_header_default");
5189
5190 prop = RNA_def_property(srna, "render_display_type", PROP_ENUM, PROP_NONE);
5191 RNA_def_property_enum_items(prop, render_display_types);
5193 prop, "Render Display Type", "Default location where rendered images will be displayed in");
5194
5195 prop = RNA_def_property(srna, "filebrowser_display_type", PROP_ENUM, PROP_NONE);
5196 RNA_def_property_enum_items(prop, temp_space_display_types);
5198 "File Browser Display Type",
5199 "Default location where the File Editor will be displayed in");
5200
5201 prop = RNA_def_property(srna, "preferences_display_type", PROP_ENUM, PROP_NONE);
5202 RNA_def_property_enum_items(prop, temp_space_display_types);
5204 "Preferences Display Type",
5205 "Default location where the Preferences will be displayed in");
5206
5207 static const EnumPropertyItem text_hinting_items[] = {
5208 {0, "AUTO", 0, "Auto", ""},
5209 {USER_TEXT_HINTING_NONE, "NONE", 0, "None", ""},
5210 {USER_TEXT_HINTING_SLIGHT, "SLIGHT", 0, "Slight", ""},
5211 {USER_TEXT_HINTING_FULL, "FULL", 0, "Full", ""},
5212 {0, nullptr, 0, nullptr, nullptr},
5213 };
5214
5215 /* mini axis */
5216 static const EnumPropertyItem mini_axis_type_items[] = {
5217 {USER_MINI_AXIS_TYPE_NONE, "NONE", 0, "Off", ""},
5218 {USER_MINI_AXIS_TYPE_MINIMAL, "MINIMAL", 0, "Simple Axes", ""},
5219 {USER_MINI_AXIS_TYPE_GIZMO, "GIZMO", 0, "Interactive Navigation", ""},
5220 {0, nullptr, 0, nullptr, nullptr},
5221 };
5222
5223 prop = RNA_def_property(srna, "mini_axis_type", PROP_ENUM, PROP_NONE);
5224 RNA_def_property_enum_items(prop, mini_axis_type_items);
5226 prop,
5227 "Mini Axes Type",
5228 "Show small rotating 3D axes in the top right corner of the 3D viewport");
5229 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5230
5231 prop = RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_PIXEL);
5232 RNA_def_property_int_sdna(prop, nullptr, "rvisize");
5233 RNA_def_property_range(prop, 10, 64);
5234 RNA_def_property_ui_text(prop, "Mini Axes Size", "The axes icon's size");
5235 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5236
5237 prop = RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
5238 RNA_def_property_int_sdna(prop, nullptr, "rvibright");
5239 RNA_def_property_range(prop, 0, 10);
5240 RNA_def_property_ui_text(prop, "Mini Axes Brightness", "Brightness of the icon");
5241 RNA_def_property_update(prop, 0, "rna_userdef_update");
5242
5243 prop = RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
5244 RNA_def_property_int_sdna(prop, nullptr, "smooth_viewtx");
5245 RNA_def_property_range(prop, 0, 1000);
5247 prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable");
5248
5249 prop = RNA_def_property(srna, "rotation_angle", PROP_FLOAT, PROP_NONE);
5250 RNA_def_property_float_sdna(prop, nullptr, "pad_rot_angle");
5251 RNA_def_property_range(prop, 0, 90);
5253 prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)");
5254
5255 /* 3D transform widget */
5256 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5257 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_flag", USER_GIZMO_DRAW);
5258 RNA_def_property_ui_text(prop, "Gizmos", "Use transform gizmos by default");
5259 RNA_def_property_update(prop, 0, "rna_userdef_update");
5260
5261 prop = RNA_def_property(srna, "gizmo_size", PROP_INT, PROP_PIXEL);
5262 RNA_def_property_int_sdna(prop, nullptr, "gizmo_size");
5263 RNA_def_property_range(prop, 10, 200);
5264 RNA_def_property_ui_text(prop, "Gizmo Size", "Diameter of the gizmo");
5265 RNA_def_property_update(prop, 0, "rna_userdef_update");
5266
5267 prop = RNA_def_property(srna, "gizmo_size_navigate_v3d", PROP_INT, PROP_PIXEL);
5268 RNA_def_property_range(prop, 30, 200);
5269 RNA_def_property_ui_text(prop, "Navigate Gizmo Size", "The Navigate Gizmo size");
5270 RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
5271
5272 /* Lookdev */
5273 prop = RNA_def_property(srna, "lookdev_sphere_size", PROP_INT, PROP_PIXEL);
5274 RNA_def_property_int_sdna(prop, nullptr, "lookdev_sphere_size");
5275 RNA_def_property_range(prop, 50, 400);
5277 prop, "Reference Sphere Size", "Diameter of the HDRI reference spheres");
5278 RNA_def_property_update(prop, 0, "rna_userdef_update");
5279
5280 /* View2D Grid Displays */
5281 prop = RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_PIXEL);
5282 RNA_def_property_int_sdna(prop, nullptr, "v2d_min_gridsize");
5284 prop, 1, 500); /* XXX: perhaps the lower range should only go down to 5? */
5286 "2D View Minimum Grid Spacing",
5287 "Minimum number of pixels between each gridline in 2D Viewports");
5288 RNA_def_property_update(prop, 0, "rna_userdef_update");
5289
5290 /* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
5291 prop = RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
5292 RNA_def_property_enum_items(prop, timecode_styles);
5293 RNA_def_property_enum_sdna(prop, nullptr, "timecode_style");
5294 RNA_def_property_enum_funcs(prop, nullptr, "rna_userdef_timecode_style_set", nullptr);
5296 prop,
5297 "Timecode Style",
5298 "Format of timecode displayed when not displaying timing in terms of frames");
5299 RNA_def_property_update(prop, 0, "rna_userdef_update");
5300
5301 prop = RNA_def_property(srna, "view_frame_type", PROP_ENUM, PROP_NONE);
5302 RNA_def_property_enum_items(prop, zoom_frame_modes);
5303 RNA_def_property_enum_sdna(prop, nullptr, "view_frame_type");
5305 prop, "Zoom to Frame Type", "How zooming to frame focuses around current frame");
5306
5307 prop = RNA_def_property(srna, "view_frame_keyframes", PROP_INT, PROP_NONE);
5308 RNA_def_property_range(prop, 1, 500);
5309 RNA_def_property_ui_text(prop, "Zoom Keyframes", "Keyframes around cursor that we zoom around");
5310
5311 prop = RNA_def_property(srna, "view_frame_seconds", PROP_FLOAT, PROP_TIME);
5312 RNA_def_property_range(prop, 0.0, 10000.0);
5313 RNA_def_property_ui_text(prop, "Zoom Seconds", "Seconds around cursor that we zoom around");
5314
5315 /* Text. */
5316
5317 prop = RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
5318 RNA_def_property_boolean_negative_sdna(prop, nullptr, "text_render", USER_TEXT_DISABLE_AA);
5320 prop, "Text Anti-Aliasing", "Smooth jagged edges of user interface text");
5321 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
5322
5323 prop = RNA_def_property(srna, "use_text_render_subpixelaa", PROP_BOOLEAN, PROP_NONE);
5324 RNA_def_property_boolean_sdna(prop, nullptr, "text_render", USER_TEXT_RENDER_SUBPIXELAA);
5326 prop, "Text Subpixel Anti-Aliasing", "Render text for optimal horizontal placement");
5327 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
5328
5329 prop = RNA_def_property(srna, "text_hinting", PROP_ENUM, PROP_NONE);
5330 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "text_render");
5331 RNA_def_property_enum_items(prop, text_hinting_items);
5333 prop, "Text Hinting", "Method for making user interface text render sharp");
5334 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
5335
5336 prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH);
5337 RNA_def_property_string_sdna(prop, nullptr, "font_path_ui");
5338 RNA_def_property_ui_text(prop, "Interface Font", "Path to interface font");
5339 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
5340
5341 prop = RNA_def_property(srna, "font_path_ui_mono", PROP_STRING, PROP_FILEPATH);
5342 RNA_def_property_string_sdna(prop, nullptr, "font_path_ui_mono");
5343 RNA_def_property_ui_text(prop, "Monospaced Font", "Path to interface monospaced Font");
5344 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
5345
5346 /* Language. */
5347
5348 prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
5349 /* Set this flag so scripts can access language information at run-time via `enum_items`. */
5352# ifdef WITH_INTERNATIONAL
5353 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_lang_enum_properties_itemf");
5354# else
5356 prop, "rna_lang_enum_properties_get_no_international", nullptr, nullptr);
5357# endif
5358 RNA_def_property_ui_text(prop, "Language", "Language used for translation");
5359 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
5360
5361 prop = RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
5362 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_TOOLTIPS);
5364 "Translate Tooltips",
5365 "Translate the descriptions when hovering UI elements (recommended)");
5366 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5367
5368 prop = RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
5369 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_IFACE);
5371 prop,
5372 "Translate Interface",
5373 "Translate all labels in menus, buttons and panels "
5374 "(note that this might make it hard to follow tutorials or the manual)");
5375 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5376
5377 prop = RNA_def_property(srna, "use_translate_reports", PROP_BOOLEAN, PROP_NONE);
5378 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_REPORTS);
5380 prop, "Translate Reports", "Translate additional information, such as error messages");
5381 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5382
5383 prop = RNA_def_property(srna, "use_translate_new_dataname", PROP_BOOLEAN, PROP_NONE);
5384 RNA_def_property_boolean_sdna(prop, nullptr, "transopts", USER_TR_NEWDATANAME);
5386 "Translate New Names",
5387 "Translate the names of new data-blocks (objects, materials...)");
5388 RNA_def_property_update(prop, 0, "rna_userdef_translation_update");
5389
5390 /* Status-bar. */
5391
5392 prop = RNA_def_property(srna, "show_statusbar_memory", PROP_BOOLEAN, PROP_NONE);
5393 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_MEMORY);
5394 RNA_def_property_ui_text(prop, "Show Memory", "Show Blender memory usage");
5395 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5396
5397 prop = RNA_def_property(srna, "show_statusbar_vram", PROP_BOOLEAN, PROP_NONE);
5398 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_VRAM);
5399 RNA_def_property_ui_text(prop, "Show VRAM", "Show GPU video memory usage");
5400 RNA_def_property_editable_func(prop, "rna_show_statusbar_vram_editable");
5401 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5402
5403 prop = RNA_def_property(srna, "show_statusbar_version", PROP_BOOLEAN, PROP_NONE);
5404 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_VERSION);
5405 RNA_def_property_ui_text(prop, "Show Version", "Show Blender version string");
5406 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5407
5408 prop = RNA_def_property(srna, "show_statusbar_stats", PROP_BOOLEAN, PROP_NONE);
5409 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_STATS);
5410 RNA_def_property_ui_text(prop, "Show Statistics", "Show scene statistics");
5411 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5412
5413 prop = RNA_def_property(srna, "show_statusbar_scene_duration", PROP_BOOLEAN, PROP_NONE);
5414 RNA_def_property_boolean_sdna(prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_SCENE_DURATION);
5415 RNA_def_property_ui_text(prop, "Show Scene Duration", "Show scene duration");
5416 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5417
5418 prop = RNA_def_property(srna, "show_extensions_updates", PROP_BOOLEAN, PROP_NONE);
5420 prop, nullptr, "statusbar_flag", STATUSBAR_SHOW_EXTENSIONS_UPDATES);
5421 RNA_def_property_ui_text(prop, "Extensions Updates", "Show Extensions Update Count");
5422 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
5423
5424 /* Accessibility. */
5425 prop = RNA_def_property(srna, "use_reduce_motion", PROP_BOOLEAN, PROP_NONE);
5426 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_REDUCE_MOTION);
5428 prop, "Reduce Motion", "Avoid animations and other motion effects in the interface");
5429 RNA_def_property_update(prop, 0, "rna_userdef_update");
5430}
5431
5433{
5434 PropertyRNA *prop;
5435 StructRNA *srna;
5436
5437 static const EnumPropertyItem auto_key_modes[] = {
5438 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
5439 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
5440 {0, nullptr, 0, nullptr, nullptr},
5441 };
5442
5443 static const EnumPropertyItem material_link_items[] = {
5444 {0,
5445 "OBDATA",
5446 0,
5447 "Object Data",
5448 "Toggle whether the material is linked to object data or the object block"},
5450 "OBJECT",
5451 0,
5452 "Object",
5453 "Toggle whether the material is linked to object data or the object block"},
5454 {0, nullptr, 0, nullptr, nullptr},
5455 };
5456
5457 static const EnumPropertyItem object_align_items[] = {
5458 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
5460 "VIEW",
5461 0,
5462 "View",
5463 "Align newly added objects to the active 3D view orientation"},
5465 "CURSOR",
5466 0,
5467 "3D Cursor",
5468 "Align newly added objects to the 3D Cursor's rotation"},
5469 {0, nullptr, 0, nullptr, nullptr},
5470 };
5471
5472 srna = RNA_def_struct(brna, "PreferencesEdit", nullptr);
5473 RNA_def_struct_sdna(srna, "UserDef");
5474 RNA_def_struct_nested(brna, srna, "Preferences");
5475 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
5476
5477 /* Edit Methods */
5478
5479 prop = RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
5480 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
5481 RNA_def_property_enum_items(prop, material_link_items);
5483 prop,
5484 "Material Link To",
5485 "Toggle whether the material is linked to object data or the object block");
5486
5487 prop = RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
5488 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
5489 RNA_def_property_enum_items(prop, object_align_items);
5491 prop, "Align Object To", "The default alignment for objects added from a 3D viewport menu");
5492
5493 prop = RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
5494 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_ADD_EDITMODE);
5496 prop, "Enter Edit Mode", "Enter edit mode automatically after adding a new object");
5497
5498 prop = RNA_def_property(srna, "collection_instance_empty_size", PROP_FLOAT, PROP_NONE);
5499 RNA_def_property_range(prop, 0.001f, FLT_MAX);
5501 "Collection Instance Empty Size",
5502 "Display size of the empty when new collection instances are created");
5503
5504 /* Text Editor */
5505
5506 prop = RNA_def_property(srna, "use_text_edit_auto_close", PROP_BOOLEAN, PROP_NONE);
5507 RNA_def_property_boolean_sdna(prop, nullptr, "text_flag", USER_TEXT_EDIT_AUTO_CLOSE);
5509 prop,
5510 "Auto Close Character Pairs",
5511 "Automatically close relevant character pairs when typing in the text editor");
5513
5514 /* Undo */
5515
5516 prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
5517 RNA_def_property_int_sdna(prop, nullptr, "undosteps");
5518 RNA_def_property_range(prop, 0, 256);
5519 RNA_def_property_int_funcs(prop, nullptr, "rna_userdef_undo_steps_set", nullptr);
5521 prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
5522
5523 prop = RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
5524 RNA_def_property_int_sdna(prop, nullptr, "undomemory");
5527 prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
5528
5529 prop = RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
5530 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_GLOBALUNDO);
5532 prop,
5533 "Global Undo",
5534 "Global undo works by keeping a full copy of the file itself in memory, "
5535 "so takes extra memory");
5536
5537 /* auto keyframing */
5538 prop = RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
5539 RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
5541 "Auto Keying Enable",
5542 "Automatic keyframe insertion for Objects and Bones "
5543 "(default setting used for new Scenes)");
5544
5545 prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
5546 RNA_def_property_enum_items(prop, auto_key_modes);
5548 prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", nullptr);
5550 "Auto Keying Mode",
5551 "Mode of automatic keyframe insertion for Objects and Bones "
5552 "(default setting used for new Scenes)");
5553
5554 prop = RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
5555 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_INSERTAVAILABLE);
5557 "Auto Keyframe Insert Available",
5558 "Insert Keyframes only for properties that are already animated");
5559
5560 prop = RNA_def_property(srna, "use_auto_keying_warning", PROP_BOOLEAN, PROP_NONE);
5563 prop,
5564 "Show Auto Keying Warning",
5565 "Show warning indicators when transforming objects and bones if auto keying is enabled");
5566
5567 /* keyframing settings */
5568 prop = RNA_def_property(srna, "key_insert_channels", PROP_ENUM, PROP_NONE);
5570 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "key_insert_channels");
5573 "Default Key Channels",
5574 "Which channels to insert keys at when no keying set is active");
5579
5580 prop = RNA_def_property(srna, "use_auto_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
5581 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_INSERTNEEDED);
5583 "Autokey Insert Needed",
5584 "Auto-Keying will skip inserting keys that don't affect the animation");
5585
5586 prop = RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
5587 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", MANUALKEY_FLAG_INSERTNEEDED);
5589 prop,
5590 "Keyframe Insert Needed",
5591 "When keying manually, skip inserting keys that don't affect the animation");
5592
5593 prop = RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
5594 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_VISUALKEY);
5596 prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
5597
5598 prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
5599 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_XYZ2RGB);
5601 prop,
5602 "New F-Curve Colors - XYZ to RGB",
5603 "Color for newly added transformation F-Curves (Location, Rotation, Scale) "
5604 "and also Color is based on the transform axis");
5605
5606 prop = RNA_def_property(srna, "use_anim_channel_group_colors", PROP_BOOLEAN, PROP_NONE);
5608 prop, nullptr, "animation_flag", USER_ANIM_SHOW_CHANNEL_GROUP_COLORS);
5610 prop,
5611 "Channel Group Colors",
5612 "Use animation channel group colors; generally this is used to show bone group colors");
5613 RNA_def_property_update(prop, 0, "rna_userdef_anim_update");
5614
5615 prop = RNA_def_property(srna, "fcurve_new_auto_smoothing", PROP_ENUM, PROP_NONE);
5617 RNA_def_property_enum_sdna(prop, nullptr, "auto_smoothing_new");
5619 "New Curve Smoothing Mode",
5620 "Auto Handle Smoothing mode used for newly added F-Curves");
5621
5622 prop = RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
5624 RNA_def_property_enum_sdna(prop, nullptr, "ipo_new");
5626 "New Interpolation Type",
5627 "Interpolation mode used for first keyframe on newly added F-Curves "
5628 "(subsequent keyframes take interpolation from preceding keyframe)");
5630
5631 prop = RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
5633 RNA_def_property_enum_sdna(prop, nullptr, "keyhandles_new");
5634 RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes");
5635
5636 /* frame numbers */
5637 prop = RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
5640 "Allow Negative Frames",
5641 "Current frame number can be manually set to a negative value");
5642
5643 /* fcurve opacity */
5644 prop = RNA_def_property(srna, "fcurve_unselected_alpha", PROP_FLOAT, PROP_FACTOR);
5645 RNA_def_property_float_sdna(prop, nullptr, "fcu_inactive_alpha");
5646 RNA_def_property_range(prop, 0.001f, 1.0f);
5648 "Unselected F-Curve Opacity",
5649 "The opacity of unselected F-Curves against the "
5650 "background of the Graph Editor");
5651 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_userdef_update");
5652
5653 /* FCurve keyframe visibility. */
5654 prop = RNA_def_property(srna, "show_only_selected_curve_keyframes", PROP_BOOLEAN, PROP_NONE);
5656 prop, nullptr, "animation_flag", USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS);
5658 "Only Show Selected F-Curve Keyframes",
5659 "Only keyframes of selected F-Curves are visible and editable");
5660 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_userdef_update");
5661
5662 /* Graph Editor line drawing quality. */
5663 prop = RNA_def_property(srna, "use_fcurve_high_quality_drawing", PROP_BOOLEAN, PROP_NONE);
5664 RNA_def_property_boolean_sdna(prop, nullptr, "animation_flag", USER_ANIM_HIGH_QUALITY_DRAWING);
5666 "F-Curve High Quality Drawing",
5667 "Draw F-Curves using Anti-Aliasing (disable for better performance)");
5668 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, "rna_userdef_update");
5669
5670 /* grease pencil */
5671 prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_PIXEL);
5672 RNA_def_property_int_sdna(prop, nullptr, "gp_manhattandist");
5673 RNA_def_property_range(prop, 0, 100);
5675 "Grease Pencil Manhattan Distance",
5676 "Pixels moved by mouse per axis when drawing stroke");
5677
5678 prop = RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_PIXEL);
5679 RNA_def_property_int_sdna(prop, nullptr, "gp_euclideandist");
5680 RNA_def_property_range(prop, 0, 100);
5682 "Grease Pencil Euclidean Distance",
5683 "Distance moved by mouse when drawing stroke to include");
5684
5685 prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_PIXEL);
5686 RNA_def_property_int_sdna(prop, nullptr, "gp_eraser");
5687 RNA_def_property_range(prop, 1, 500);
5688 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
5689
5690 prop = RNA_def_property(srna, "grease_pencil_default_color", PROP_FLOAT, PROP_COLOR_GAMMA);
5691 RNA_def_property_float_sdna(prop, nullptr, "gpencil_new_layer_col");
5692 RNA_def_property_array(prop, 4);
5693 RNA_def_property_ui_text(prop, "Annotation Default Color", "Color of new annotation layers");
5694
5695 /* sculpt and paint */
5696
5697 prop = RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
5698 RNA_def_property_float_sdna(prop, nullptr, "sculpt_paint_overlay_col");
5699 RNA_def_property_array(prop, 3);
5700 RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
5701
5702 /* VSE */
5703 prop = RNA_def_property(srna, "connect_strips_by_default", PROP_BOOLEAN, PROP_NONE);
5705 prop, nullptr, "sequencer_editor_flag", USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT);
5707 prop,
5708 "Connect Movie Strips by Default",
5709 "Connect newly added movie strips by default if they have multiple channels");
5710
5711 /* duplication linking */
5712 prop = RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
5713 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_MESH);
5715 prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
5716
5717 prop = RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
5718 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_SURF);
5720 prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
5721
5722 prop = RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
5723 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_CURVE);
5725 prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
5726
5727 prop = RNA_def_property(srna, "use_duplicate_lattice", PROP_BOOLEAN, PROP_NONE);
5728 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_LATTICE);
5730 prop, "Duplicate Lattice", "Causes lattice data to be duplicated with the object");
5731
5732 prop = RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
5733 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_FONT);
5735 prop, "Duplicate Text", "Causes text data to be duplicated with the object");
5736
5737 prop = RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
5738 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_MBALL);
5740 prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
5741
5742 prop = RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
5743 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_ARM);
5745 prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
5746
5747 prop = RNA_def_property(srna, "use_duplicate_camera", PROP_BOOLEAN, PROP_NONE);
5748 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_CAMERA);
5750 prop, "Duplicate Camera", "Causes camera data to be duplicated with the object");
5751
5752 prop = RNA_def_property(srna, "use_duplicate_speaker", PROP_BOOLEAN, PROP_NONE);
5753 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_SPEAKER);
5755 prop, "Duplicate Speaker", "Causes speaker data to be duplicated with the object");
5756
5757 prop = RNA_def_property(srna, "use_duplicate_light", PROP_BOOLEAN, PROP_NONE);
5758 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_LAMP);
5760 prop, "Duplicate Light", "Causes light data to be duplicated with the object");
5761
5762 prop = RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
5763 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_MAT);
5765 prop, "Duplicate Material", "Causes material data to be duplicated with the object");
5766
5767 /* Not implemented, keep because this is useful functionality. */
5768# if 0
5769 prop = RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
5770 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_TEX);
5772 prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
5773
5774 prop = RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
5775 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_FCURVE);
5777 prop, "Duplicate F-Curve", "Causes F-Curve data to be duplicated with the object");
5778# endif
5779
5780 prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
5781 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_ACT);
5783 prop, "Duplicate Action", "Causes actions to be duplicated with the data-blocks");
5784
5785 prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
5786 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_PSYS);
5788 prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
5789
5790 prop = RNA_def_property(srna, "use_duplicate_lightprobe", PROP_BOOLEAN, PROP_NONE);
5791 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_LIGHTPROBE);
5793 prop, "Duplicate Light Probe", "Causes light probe data to be duplicated with the object");
5794
5795 prop = RNA_def_property(srna, "use_duplicate_grease_pencil", PROP_BOOLEAN, PROP_NONE);
5796 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_GPENCIL);
5798 "Duplicate Grease Pencil",
5799 "Causes Grease Pencil data to be duplicated with the object");
5800
5801 prop = RNA_def_property(srna, "use_duplicate_curves", PROP_BOOLEAN, PROP_NONE);
5802 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_CURVES);
5804 prop, "Duplicate Curves", "Causes curves data to be duplicated with the object");
5805
5806 prop = RNA_def_property(srna, "use_duplicate_pointcloud", PROP_BOOLEAN, PROP_NONE);
5807 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_POINTCLOUD);
5809 prop, "Duplicate Point Cloud", "Causes point cloud data to be duplicated with the object");
5810
5811 prop = RNA_def_property(srna, "use_duplicate_volume", PROP_BOOLEAN, PROP_NONE);
5812 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_VOLUME);
5814 prop, "Duplicate Volume", "Causes volume data to be duplicated with the object");
5815
5816 prop = RNA_def_property(srna, "use_duplicate_node_tree", PROP_BOOLEAN, PROP_NONE);
5817 RNA_def_property_boolean_sdna(prop, nullptr, "dupflag", USER_DUP_NTREE);
5819 "Duplicate Node Tree",
5820 "Make copies of node groups when duplicating nodes in the node editor");
5821
5822 prop = RNA_def_property(srna, "node_use_insert_offset", PROP_BOOLEAN, PROP_NONE);
5823 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_NODE_AUTO_OFFSET);
5825 "Auto-offset",
5826 "Automatically offset the following or previous nodes in a "
5827 "chain when inserting a new node");
5828
5829 /* Currently only used for insert offset (aka auto-offset),
5830 * maybe also be useful for later stuff though. */
5831 prop = RNA_def_property(srna, "node_margin", PROP_INT, PROP_PIXEL);
5832 RNA_def_property_int_sdna(prop, nullptr, "node_margin");
5834 prop, "Auto-offset Margin", "Minimum distance between nodes for Auto-offsetting nodes");
5835 RNA_def_property_update(prop, 0, "rna_userdef_update");
5836
5837 prop = RNA_def_property(srna, "node_preview_resolution", PROP_INT, PROP_PIXEL);
5838 RNA_def_property_int_sdna(prop, nullptr, "node_preview_res");
5839 RNA_def_property_range(prop, 50, 250);
5841 "Node Preview Resolution",
5842 "Resolution used for Shader node previews (should be changed for "
5843 "performance convenience)");
5844 RNA_def_property_update(prop, 0, "rna_userdef_update");
5845
5846 /* cursor */
5847 prop = RNA_def_property(srna, "use_cursor_lock_adjust", PROP_BOOLEAN, PROP_NONE);
5850 prop,
5851 "Cursor Lock Adjust",
5852 "Place the cursor without 'jumping' to the new location (when lock-to-cursor is used)");
5853
5854 prop = RNA_def_property(srna, "use_mouse_depth_cursor", PROP_BOOLEAN, PROP_NONE);
5855 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DEPTH_CURSOR);
5857 prop, "Cursor Surface Project", "Use the surface depth for cursor placement");
5858}
5859
5861{
5862 PropertyRNA *prop;
5863 StructRNA *srna;
5864
5865 static const EnumPropertyItem gl_texture_clamp_items[] = {
5866 {0, "CLAMP_OFF", 0, "Off", ""},
5867 {8192, "CLAMP_8192", 0, "8192", ""},
5868 {4096, "CLAMP_4096", 0, "4096", ""},
5869 {2048, "CLAMP_2048", 0, "2048", ""},
5870 {1024, "CLAMP_1024", 0, "1024", ""},
5871 {512, "CLAMP_512", 0, "512", ""},
5872 {256, "CLAMP_256", 0, "256", ""},
5873 {128, "CLAMP_128", 0, "128", ""},
5874 {0, nullptr, 0, nullptr, nullptr},
5875 };
5876
5877 static const EnumPropertyItem anisotropic_items[] = {
5878 {1, "FILTER_0", 0, "Off", ""},
5879 {2, "FILTER_2", 0, "2" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
5880 {4, "FILTER_4", 0, "4" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
5881 {8, "FILTER_8", 0, "8" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
5882 {16, "FILTER_16", 0, "16" BLI_STR_UTF8_MULTIPLICATION_SIGN, ""},
5883 {0, nullptr, 0, nullptr, nullptr},
5884 };
5885
5886 static const EnumPropertyItem audio_mixing_samples_items[] = {
5887 {256, "SAMPLES_256", 0, "256 Samples", "Set audio mixing buffer size to 256 samples"},
5888 {512, "SAMPLES_512", 0, "512 Samples", "Set audio mixing buffer size to 512 samples"},
5889 {1024, "SAMPLES_1024", 0, "1024 Samples", "Set audio mixing buffer size to 1024 samples"},
5890 {2048, "SAMPLES_2048", 0, "2048 Samples", "Set audio mixing buffer size to 2048 samples"},
5891 {4096, "SAMPLES_4096", 0, "4096 Samples", "Set audio mixing buffer size to 4096 samples"},
5892 {8192, "SAMPLES_8192", 0, "8192 Samples", "Set audio mixing buffer size to 8192 samples"},
5893 {16384,
5894 "SAMPLES_16384",
5895 0,
5896 "16384 Samples",
5897 "Set audio mixing buffer size to 16384 samples"},
5898 {32768,
5899 "SAMPLES_32768",
5900 0,
5901 "32768 Samples",
5902 "Set audio mixing buffer size to 32768 samples"},
5903 {0, nullptr, 0, nullptr, nullptr},
5904 };
5905
5906 static const EnumPropertyItem audio_rate_items[] = {
5907# if 0
5908 {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
5909 {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
5910 {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
5911 {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
5912 {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
5913# endif
5914 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
5915 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
5916# if 0
5917 {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
5918# endif
5919 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
5920 {192000,
5921 "RATE_192000",
5922 0,
5923 "192 kHz",
5924 "Set audio sampling rate to 192000 samples per second"},
5925 {0, nullptr, 0, nullptr, nullptr},
5926 };
5927
5928 static const EnumPropertyItem audio_format_items[] = {
5929 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8-bit unsigned integer"},
5930 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16-bit signed integer"},
5931 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24-bit signed integer"},
5932 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32-bit signed integer"},
5933 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32-bit float"},
5934 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64-bit float"},
5935 {0, nullptr, 0, nullptr, nullptr},
5936 };
5937
5938 static const EnumPropertyItem audio_channel_items[] = {
5939 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
5940 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
5941 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
5942 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
5943 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
5944 {0, nullptr, 0, nullptr, nullptr},
5945 };
5946
5947 static const EnumPropertyItem image_draw_methods[] = {
5949 "AUTO",
5950 0,
5951 "Automatic",
5952 "Automatically choose method based on GPU and image"},
5954 "2DTEXTURE",
5955 0,
5956 "2D Texture",
5957 "Use CPU for display transform and display image with 2D texture"},
5959 "GLSL",
5960 0,
5961 "GLSL",
5962 "Use GLSL shaders for display transform and display image with 2D texture"},
5963 {0, nullptr, 0, nullptr, nullptr},
5964 };
5965
5966 static const EnumPropertyItem seq_proxy_setup_options[] = {
5967 {USER_SEQ_PROXY_SETUP_MANUAL, "MANUAL", 0, "Manual", "Set up proxies manually"},
5969 "AUTOMATIC",
5970 0,
5971 "Automatic",
5972 "Build proxies for added movie and image strips in each preview size"},
5973 {0, nullptr, 0, nullptr, nullptr},
5974 };
5975
5976 srna = RNA_def_struct(brna, "PreferencesSystem", nullptr);
5977 RNA_def_struct_sdna(srna, "UserDef");
5978 RNA_def_struct_nested(brna, srna, "Preferences");
5979 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
5980
5981 /* UI settings. */
5982
5983 prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_NONE);
5985 RNA_def_property_float_sdna(prop, nullptr, "scale_factor");
5987 prop,
5988 "UI Scale",
5989 "Size multiplier to use when displaying custom user interface elements, so that "
5990 "they are scaled correctly on screens with different DPI. This value is based "
5991 "on operating system DPI settings and Blender display scale.");
5992
5993 prop = RNA_def_property(srna, "ui_line_width", PROP_FLOAT, PROP_NONE);
5995 RNA_def_property_float_sdna(prop, nullptr, "pixelsize");
5997 prop,
5998 "UI Line Width",
5999 "Suggested line thickness and point size in pixels, for add-ons displaying custom "
6000 "user interface elements, based on operating system settings and Blender UI scale");
6001
6002 prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
6004
6005 prop = RNA_def_property(srna, "pixel_size", PROP_FLOAT, PROP_NONE);
6007 RNA_def_property_float_sdna(prop, nullptr, "pixelsize");
6008
6009 /* Memory */
6010
6011 prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
6012 RNA_def_property_int_sdna(prop, nullptr, "memcachelimit");
6014 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit (in megabytes)");
6015 RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
6016
6017 /* Sequencer proxy setup */
6018
6019 prop = RNA_def_property(srna, "sequencer_proxy_setup", PROP_ENUM, PROP_NONE);
6020 RNA_def_property_enum_items(prop, seq_proxy_setup_options);
6021 RNA_def_property_enum_sdna(prop, nullptr, "sequencer_proxy_setup");
6022 RNA_def_property_ui_text(prop, "Proxy Setup", "When and how proxies are created");
6023
6024 prop = RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
6025 RNA_def_property_int_sdna(prop, nullptr, "scrollback");
6026 RNA_def_property_range(prop, 32, 32768);
6028 prop, "Scrollback", "Maximum number of lines to store for the console buffer");
6029
6030 /* OpenGL */
6031
6032 /* Viewport anti-aliasing */
6033 prop = RNA_def_property(srna, "use_overlay_smooth_wire", PROP_BOOLEAN, PROP_NONE);
6036 prop, "Overlay Smooth Wires", "Enable overlay smooth wires, reducing aliasing");
6037 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6038
6039 prop = RNA_def_property(srna, "use_edit_mode_smooth_wire", PROP_BOOLEAN, PROP_NONE);
6041 prop, nullptr, "gpu_flag", USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE);
6043 prop,
6044 "Edit Mode Smooth Wires",
6045 "Enable edit mode edge smoothing, reducing aliasing (requires restart)");
6046 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6047
6048 prop = RNA_def_property(srna, "use_region_overlap", PROP_BOOLEAN, PROP_NONE);
6049 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag2", USER_REGION_OVERLAP);
6051 prop, "Region Overlap", "Display tool/property regions over the main region");
6052 RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
6053
6054 prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
6057 prop, "Viewport Anti-Aliasing", "Method of anti-aliasing in 3d viewport");
6059 RNA_def_property_update(prop, 0, "rna_userdef_update");
6060
6061 prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
6062 RNA_def_property_collection_sdna(prop, nullptr, "light_param", "");
6063 RNA_def_property_struct_type(prop, "UserSolidLight");
6065 prop, "Solid Lights", "Lights used to display objects in solid shading mode");
6066
6067 prop = RNA_def_property(srna, "light_ambient", PROP_FLOAT, PROP_COLOR);
6068 RNA_def_property_float_sdna(prop, nullptr, "light_ambient");
6069 RNA_def_property_array(prop, 3);
6071 prop, "Ambient Color", "Color of the ambient light that uniformly lit the scene");
6072 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
6073
6074 prop = RNA_def_property(srna, "use_studio_light_edit", PROP_BOOLEAN, PROP_NONE);
6075 RNA_def_property_boolean_sdna(prop, nullptr, "edit_studio_light", 1);
6077 prop, "Edit Studio Light", "View the result of the studio light editor in the viewport");
6078 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
6079
6080 prop = RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_FACTOR);
6081 RNA_def_property_float_sdna(prop, nullptr, "glalphaclip");
6082 RNA_def_property_range(prop, 0.0f, 1.0f);
6084 prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
6085 RNA_def_property_update(prop, 0, "rna_userdef_update");
6086
6087 /* Textures */
6088
6089 prop = RNA_def_property(srna, "image_draw_method", PROP_ENUM, PROP_NONE);
6090 RNA_def_property_enum_items(prop, image_draw_methods);
6091 RNA_def_property_enum_sdna(prop, nullptr, "image_draw_method");
6093 prop, "Image Display Method", "Method used for displaying images on the screen");
6094 RNA_def_property_update(prop, 0, "rna_userdef_update");
6095
6096 prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
6097 RNA_def_property_enum_sdna(prop, nullptr, "anisotropic_filter");
6098 RNA_def_property_enum_items(prop, anisotropic_items);
6099 RNA_def_property_ui_text(prop, "Anisotropic Filtering", "Quality of anisotropic filtering");
6100 RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
6101
6102 prop = RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
6103 RNA_def_property_enum_sdna(prop, nullptr, "glreslimit");
6104 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
6106 prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
6107 RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
6108
6109 prop = RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
6110 RNA_def_property_int_sdna(prop, nullptr, "textimeout");
6111 RNA_def_property_range(prop, 0, 3600);
6113 prop,
6114 "Texture Time Out",
6115 "Time since last access of a GL texture in seconds after which it is freed "
6116 "(set to 0 to keep textures allocated)");
6117
6118 prop = RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
6119 RNA_def_property_int_sdna(prop, nullptr, "texcollectrate");
6120 RNA_def_property_range(prop, 1, 3600);
6122 prop,
6123 "Texture Collection Rate",
6124 "Number of seconds between each run of the GL texture garbage collector");
6125
6126 prop = RNA_def_property(srna, "vbo_time_out", PROP_INT, PROP_NONE);
6127 RNA_def_property_int_sdna(prop, nullptr, "vbotimeout");
6128 RNA_def_property_range(prop, 0, 3600);
6130 prop,
6131 "VBO Time Out",
6132 "Time since last access of a GL vertex buffer object in seconds after which it is freed "
6133 "(set to 0 to keep VBO allocated)");
6134
6135 prop = RNA_def_property(srna, "vbo_collection_rate", PROP_INT, PROP_NONE);
6136 RNA_def_property_int_sdna(prop, nullptr, "vbocollectrate");
6137 RNA_def_property_range(prop, 1, 3600);
6139 prop,
6140 "VBO Collection Rate",
6141 "Number of seconds between each run of the GL vertex buffer object garbage collector");
6142
6143 /* GPU subdivision evaluation. */
6144
6145 prop = RNA_def_property(srna, "use_gpu_subdivision", PROP_BOOLEAN, PROP_NONE);
6148 "GPU Subdivision",
6149 "Enable GPU acceleration for evaluating the last subdivision surface "
6150 "modifiers in the stack");
6151 RNA_def_property_update(prop, 0, "rna_UserDef_subdivision_update");
6152
6153 /* GPU backend selection */
6154 prop = RNA_def_property(srna, "gpu_backend", PROP_ENUM, PROP_NONE);
6155 RNA_def_property_enum_sdna(prop, nullptr, "gpu_backend");
6157 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_preference_gpu_backend_itemf");
6159 prop,
6160 "GPU Backend",
6161 "GPU backend to use (requires restarting Blender for changes to take effect)");
6162
6163 prop = RNA_def_property(srna, "gpu_preferred_device", PROP_ENUM, PROP_NONE);
6166 "rna_preference_gpu_preferred_device_get",
6167 "rna_preference_gpu_preferred_device_set",
6168 "rna_preference_gpu_preferred_device_itemf");
6171 "Device",
6172 "Preferred device to select during detection (requires restarting "
6173 "Blender for changes to take effect)");
6174
6175 prop = RNA_def_property(srna, "gpu_shader_workers", PROP_INT, PROP_NONE);
6176 RNA_def_property_range(prop, 0, 32);
6178 "Shader Compilation Workers",
6179 "Number of shader compilation threads or subprocesses, "
6180 "clamped at the max threads supported by the CPU "
6181 "(requires restarting Blender for changes to take effect). "
6182 "A higher number increases the RAM usage while reducing "
6183 "compilation time. A value of 0 will use automatic configuration. "
6184 "(OpenGL only)");
6185
6186 static const EnumPropertyItem shader_compilation_method_items[] = {
6187 {USER_SHADER_COMPILE_THREAD, "THREAD", 0, "Thread", "Use threads for compiling shaders"},
6189 "SUBPROCESS",
6190 0,
6191 "Subprocess",
6192 "Use subprocesses for compiling shaders"},
6193 {0, nullptr, 0, nullptr, nullptr},
6194 };
6195
6196 prop = RNA_def_property(srna, "shader_compilation_method", PROP_ENUM, PROP_NONE);
6197 RNA_def_property_enum_items(prop, shader_compilation_method_items);
6199 "Shader Compilation Method",
6200 "Compilation method used for compiling shaders in parallel. "
6201 "Subprocess requires a lot more RAM for each worker "
6202 "but might compile shaders faster on some systems. "
6203 "Requires restarting Blender for changes to take effect. "
6204 "(OpenGL only)");
6205
6206 /* Network. */
6207
6208 prop = RNA_def_property(srna, "use_online_access", PROP_BOOLEAN, PROP_NONE);
6209 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_INTERNET_ALLOW);
6210 RNA_def_property_boolean_funcs(prop, nullptr, "rna_userdef_use_online_access_set");
6212 "Allow Online Access",
6213 "Allow Blender to access the internet. Add-ons that follow this "
6214 "setting will only connect to the internet if enabled. However, "
6215 "Blender cannot prevent third-party add-ons from violating this rule.");
6216 RNA_def_property_editable_func(prop, "rna_userdef_use_online_access_editable");
6217 RNA_def_property_update(prop, 0, "rna_userdef_update");
6218
6219 prop = RNA_def_property(srna, "network_timeout", PROP_INT, PROP_UNSIGNED);
6220 RNA_def_property_int_sdna(prop, nullptr, "network_timeout");
6222 prop,
6223 "Network Timeout",
6224 "The time in seconds to wait for online operations before a connection may "
6225 "fail with a time-out error. Zero uses the systems default.");
6226
6227 prop = RNA_def_property(srna, "network_connection_limit", PROP_INT, PROP_UNSIGNED);
6228 RNA_def_property_int_sdna(prop, nullptr, "network_connection_limit");
6230 prop,
6231 "Network Connection Limit",
6232 "Limit the number of simultaneous internet connections online operations may make at once. "
6233 "Zero disables the limit.");
6234
6235 /* Audio */
6236
6237 prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
6238 RNA_def_property_enum_sdna(prop, nullptr, "mixbufsize");
6239 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
6241 prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer");
6243 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6244
6245 prop = RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
6246 RNA_def_property_enum_sdna(prop, nullptr, "audiodevice");
6248 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_userdef_audio_device_itemf");
6249 RNA_def_property_ui_text(prop, "Audio Device", "Audio output device");
6251 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6252
6253 prop = RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
6254 RNA_def_property_enum_sdna(prop, nullptr, "audiorate");
6255 RNA_def_property_enum_items(prop, audio_rate_items);
6256 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Audio sample rate");
6258 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6259
6260 prop = RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
6261 RNA_def_property_enum_sdna(prop, nullptr, "audioformat");
6262 RNA_def_property_enum_items(prop, audio_format_items);
6263 RNA_def_property_ui_text(prop, "Audio Sample Format", "Audio sample format");
6265 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6266
6267 prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
6268 RNA_def_property_enum_sdna(prop, nullptr, "audiochannels");
6269 RNA_def_property_enum_items(prop, audio_channel_items);
6270 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
6272 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
6273
6274# ifdef WITH_CYCLES
6275 prop = RNA_def_property(srna, "legacy_compute_device_type", PROP_INT, PROP_NONE);
6276 RNA_def_property_int_sdna(prop, nullptr, "compute_device_type");
6279 RNA_def_property_ui_text(prop, "Legacy Compute Device Type", "For backwards compatibility only");
6280# endif
6281
6282 /* Registration and Unregistration */
6283
6284 prop = RNA_def_property(srna, "register_all_users", PROP_BOOLEAN, PROP_NONE);
6287 prop,
6288 "Register for All Users",
6289 "Make this Blender version open blend files for all users. Requires elevated privileges.");
6290
6291 prop = RNA_def_boolean(
6292 srna,
6293 "is_microsoft_store_install",
6294 false,
6295 "Is Microsoft Store Install",
6296 "Whether this blender installation is a sandboxed Microsoft Store version");
6297 RNA_def_property_boolean_funcs(prop, "rna_userdef_is_microsoft_store_install_get", nullptr);
6299}
6300
6302{
6303 PropertyRNA *prop;
6304 StructRNA *srna;
6305
6306 static const EnumPropertyItem view_rotation_items[] = {
6307 {0, "TURNTABLE", 0, "Turntable", "Turntable keeps the Z-axis upright while orbiting"},
6309 "TRACKBALL",
6310 0,
6311 "Trackball",
6312 "Trackball allows you to tumble your view at any angle"},
6313 {0, nullptr, 0, nullptr, nullptr},
6314 };
6315
6316# ifdef WITH_INPUT_NDOF
6317 static const EnumPropertyItem ndof_view_navigation_items[] = {
6319 "OBJECT",
6320 0,
6321 "Object",
6322 "This mode is like reaching into the screen and holding the model in your hand. "
6323 "Push the 3D Mouse cap left, and the model moves left. Push right and the model "
6324 "moves right"},
6326 "FLY",
6327 0,
6328 "Fly",
6329 "Enables using the 3D Mouse as if it is a camera. "
6330 "Push into the scene and the camera moves forward into the scene. "
6331 "You are entering the scene as if flying around in it. "
6332 "This also inverts pan & zoom for 2D views"},
6333 {0, nullptr, 0, nullptr, nullptr},
6334 };
6335
6336 static const EnumPropertyItem ndof_zoom_direction_items[] = {
6337 {0,
6338 "NDOF_ZOOM_FORWARD",
6339 0,
6340 "Forward/Backward",
6341 "Zoom by pulling the 3D Mouse cap upwards or pushing the cap downwards"},
6343 "NDOF_ZOOM_UP",
6344 0,
6345 "Up/Down",
6346 "Zoom by pulling the 3D Mouse cap upwards or pushing the cap downwards"},
6347 {0, nullptr, 0, nullptr, nullptr},
6348 };
6349# endif /* WITH_INPUT_NDOF */
6350
6351 static const EnumPropertyItem tablet_api[] = {
6353 "AUTOMATIC",
6354 0,
6355 "Automatic",
6356 "Automatically choose Wintab or Windows Ink depending on the device"},
6358 "WINDOWS_INK",
6359 0,
6360 "Windows Ink",
6361 "Use native Windows Ink API, for modern tablet and pen devices. Requires Windows 8 or "
6362 "newer."},
6364 "WINTAB",
6365 0,
6366 "Wintab",
6367 "Use Wintab driver for older tablets and Windows versions"},
6368 {0, nullptr, 0, nullptr, nullptr},
6369 };
6370
6371 static const EnumPropertyItem view_zoom_styles[] = {
6373 "CONTINUE",
6374 0,
6375 "Continue",
6376 "Continuous zooming. The zoom direction and speed depends on how far along the set Zoom "
6377 "Axis the mouse has moved."},
6379 "DOLLY",
6380 0,
6381 "Dolly",
6382 "Zoom in and out based on mouse movement along the set Zoom Axis"},
6384 "SCALE",
6385 0,
6386 "Scale",
6387 "Zoom in and out as if you are scaling the view, mouse movements relative to center"},
6388 {0, nullptr, 0, nullptr, nullptr},
6389 };
6390
6391 static const EnumPropertyItem view_zoom_axes[] = {
6392 {0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"},
6394 "HORIZONTAL",
6395 0,
6396 "Horizontal",
6397 "Zoom in and out based on horizontal mouse movement"},
6398 {0, nullptr, 0, nullptr, nullptr},
6399 };
6400
6401 srna = RNA_def_struct(brna, "PreferencesInput", nullptr);
6402 RNA_def_struct_sdna(srna, "UserDef");
6403 RNA_def_struct_nested(brna, srna, "Preferences");
6404 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
6405
6406 prop = RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
6407 RNA_def_property_enum_sdna(prop, nullptr, "viewzoom");
6408 RNA_def_property_enum_items(prop, view_zoom_styles);
6409 RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
6410
6411 prop = RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
6412 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "uiflag");
6413 RNA_def_property_enum_items(prop, view_zoom_axes);
6414 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
6415
6416 prop = RNA_def_property(srna, "use_multitouch_gestures", PROP_BOOLEAN, PROP_NONE);
6419 prop,
6420 "Multi-touch Gestures",
6421 "Use multi-touch gestures for navigation with touchpad, instead of scroll wheel emulation");
6422 RNA_def_property_update(prop, 0, "rna_userdef_input_devices");
6423
6424 prop = RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
6425 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_ZOOM_INVERT);
6427 prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
6428
6429 prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE);
6430 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DEPTH_NAVIGATE);
6432 prop,
6433 "Auto Depth",
6434 "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
6435
6436 /* view zoom */
6437 prop = RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
6438 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_ZOOM_TO_MOUSEPOS);
6440 "Zoom to Mouse Position",
6441 "Zoom in towards the mouse pointer's position in the 3D view, "
6442 "rather than the 2D window center");
6443
6444 /* view rotation */
6445 prop = RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
6446 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_AUTOPERSP);
6448 prop,
6449 "Auto Perspective",
6450 "Automatically switch between orthographic and perspective when changing "
6451 "from top/front/side views");
6452
6453 prop = RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
6454 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_ORBIT_SELECTION);
6455 RNA_def_property_ui_text(prop, "Orbit Around Selection", "Use selection as the pivot point");
6456
6457 prop = RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
6458 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6459 RNA_def_property_enum_items(prop, view_rotation_items);
6460 RNA_def_property_ui_text(prop, "Orbit Method", "Orbit method in the viewport");
6461
6462 prop = RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
6463 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_CONTINUOUS_MOUSE);
6465 prop,
6466 "Continuous Grab",
6467 "Let the mouse wrap around the view boundaries so mouse movements are not limited by the "
6468 "screen size (used by transform, dragging of UI controls, etc.)");
6469
6470 prop = RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
6471 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_RELEASECONFIRM);
6473 "Release Confirms",
6474 "Moving things with a mouse drag confirms when releasing the button");
6475
6476 prop = RNA_def_property(srna, "use_numeric_input_advanced", PROP_BOOLEAN, PROP_NONE);
6479 "Default to Advanced Numeric Input",
6480 "When entering numbers while transforming, "
6481 "default to advanced mode for full math expression evaluation");
6482
6483 /* View Navigation */
6484 prop = RNA_def_property(srna, "navigation_mode", PROP_ENUM, PROP_NONE);
6485 RNA_def_property_enum_sdna(prop, nullptr, "navigation_mode");
6487 RNA_def_property_ui_text(prop, "View Navigation", "Which method to use for viewport navigation");
6488
6489 prop = RNA_def_property(srna, "walk_navigation", PROP_POINTER, PROP_NONE);
6490 RNA_def_property_pointer_sdna(prop, nullptr, "walk_navigation");
6492 RNA_def_property_struct_type(prop, "WalkNavigation");
6493 RNA_def_property_ui_text(prop, "Walk Navigation", "Settings for walk navigation mode");
6494
6495 prop = RNA_def_property(srna, "view_rotate_sensitivity_turntable", PROP_FLOAT, PROP_ANGLE);
6496 RNA_def_property_range(prop, DEG2RADF(0.001f), DEG2RADF(15.0f));
6497 RNA_def_property_ui_range(prop, DEG2RADF(0.001f), DEG2RADF(15.0f), 1.0f, 2);
6499 "Orbit Sensitivity",
6500 "Rotation amount per pixel to control how fast the viewport orbits");
6501
6502 prop = RNA_def_property(srna, "view_rotate_sensitivity_trackball", PROP_FLOAT, PROP_FACTOR);
6503 RNA_def_property_range(prop, 0.1f, 10.0f);
6504 RNA_def_property_ui_range(prop, 0.1f, 2.0f, 0.01f, 2);
6505 RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Scale trackball orbit sensitivity");
6506
6507 /* Click-drag threshold for tablet & mouse. */
6508 prop = RNA_def_property(srna, "drag_threshold_mouse", PROP_INT, PROP_PIXEL);
6509 RNA_def_property_range(prop, 1, 255);
6511 "Mouse Drag Threshold",
6512 "Number of pixels to drag before a drag event is triggered "
6513 "for mouse/trackpad input "
6514 "(otherwise click events are detected)");
6515
6516 prop = RNA_def_property(srna, "drag_threshold_tablet", PROP_INT, PROP_PIXEL);
6517 RNA_def_property_range(prop, 1, 255);
6519 "Tablet Drag Threshold",
6520 "Number of pixels to drag before a drag event is triggered "
6521 "for tablet input "
6522 "(otherwise click events are detected)");
6523
6524 prop = RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_PIXEL);
6525 RNA_def_property_range(prop, 1, 255);
6527 "Drag Threshold",
6528 "Number of pixels to drag before a drag event is triggered "
6529 "for keyboard and other non mouse/tablet input "
6530 "(otherwise click events are detected)");
6531
6532 prop = RNA_def_property(srna, "move_threshold", PROP_INT, PROP_PIXEL);
6533 RNA_def_property_range(prop, 0, 255);
6534 RNA_def_property_ui_range(prop, 0, 10, 1, -1);
6536 "Motion Threshold",
6537 "Number of pixels to before the cursor is considered to have moved "
6538 "(used for cycling selected items on successive clicks)");
6539
6540 /* tablet pressure curve */
6541 prop = RNA_def_property(srna, "pressure_threshold_max", PROP_FLOAT, PROP_FACTOR);
6542 RNA_def_property_range(prop, 0.0f, 1.0f);
6543 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 3);
6545 prop, "Max Threshold", "Raw input pressure value that is interpreted as 100% by Blender");
6546
6547 prop = RNA_def_property(srna, "pressure_softness", PROP_FLOAT, PROP_FACTOR);
6549 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1f, 2);
6551 prop, "Softness", "Adjusts softness of the low pressure response onset using a gamma curve");
6552
6553 prop = RNA_def_property(srna, "tablet_api", PROP_ENUM, PROP_NONE);
6554 RNA_def_property_enum_items(prop, tablet_api);
6556 "Tablet API",
6557 "Select the tablet API to use for pressure sensitivity (may require "
6558 "restarting Blender for changes to take effect)");
6559 RNA_def_property_update(prop, 0, "rna_userdef_input_devices");
6560
6561 prop = RNA_def_property(srna, "xr_navigation", PROP_POINTER, PROP_NONE);
6562 RNA_def_property_pointer_sdna(prop, nullptr, "xr_navigation");
6564 RNA_def_property_struct_type(prop, "XrNavigation");
6565 RNA_def_property_ui_text(prop, "XR Navigation", "Settings for navigation in XR");
6566
6567# ifdef WITH_INPUT_NDOF
6568 /* 3D mouse settings */
6569 /* global options */
6570 prop = RNA_def_property(srna, "ndof_translation_sensitivity", PROP_FLOAT, PROP_NONE);
6571 RNA_def_property_range(prop, 0.01f, 40.0f);
6573 prop, "Pan Sensitivity", "Overall sensitivity of the 3D Mouse for translation");
6574
6575 prop = RNA_def_property(srna, "ndof_rotation_sensitivity", PROP_FLOAT, PROP_NONE);
6576 RNA_def_property_range(prop, 0.01f, 40.0f);
6578 prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for rotation");
6579
6580 prop = RNA_def_property(srna, "ndof_deadzone", PROP_FLOAT, PROP_FACTOR);
6581 RNA_def_property_range(prop, 0.0f, 1.0f);
6583 prop, "Deadzone", "Threshold of initial movement needed from the device's rest position");
6584 RNA_def_property_update(prop, 0, "rna_userdef_ndof_deadzone_update");
6585
6586 prop = RNA_def_property(srna, "ndof_zoom_direction", PROP_ENUM, PROP_NONE);
6587 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ndof_flag");
6588 RNA_def_property_enum_items(prop, ndof_zoom_direction_items);
6590 prop, "Zoom direction", "Which axis of the 3D Mouse cap zooms the view");
6591
6592 /* 3D view */
6593 prop = RNA_def_property(srna, "ndof_show_guide_orbit_axis", PROP_BOOLEAN, PROP_NONE);
6594 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_SHOW_GUIDE_ORBIT_AXIS);
6595
6596 /* TODO: update description when fly-mode visuals are in place
6597 * ("projected position in fly mode"). */
6599 prop, "Show Orbit Axis Guide", "Display the center and axis during rotation");
6600
6601 prop = RNA_def_property(srna, "ndof_show_guide_orbit_center", PROP_BOOLEAN, PROP_NONE);
6604 prop, "Show Orbit Center Guide", "Display the orbit center during rotation");
6605
6606 /* 3D view */
6607 prop = RNA_def_property(srna, "ndof_navigation_mode", PROP_ENUM, PROP_NONE);
6608 RNA_def_property_enum_items(prop, ndof_view_navigation_items);
6609 RNA_def_property_ui_text(prop, "NDOF View Navigate", "3D Mouse Navigation Mode");
6610
6611 prop = RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
6612 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_LOCK_HORIZON);
6614 prop,
6615 "NDOF Lock Horizon",
6616 "Lock Horizon forces the horizon to be kept leveled as it currently is");
6617
6618 prop = RNA_def_property(srna, "ndof_fly_speed_auto", PROP_BOOLEAN, PROP_NONE);
6619 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_FLY_SPEED_AUTO);
6621 "Auto Fly Speed",
6622 "Automatically adjusts fly navigation speed "
6623 "based on the distance of objects near the center of the viewport, "
6624 "making it easier to navigate complex scenes. "
6625 "Speed is recalculated each time movement starts.");
6626
6627 prop = RNA_def_property(srna, "ndof_orbit_center_auto", PROP_BOOLEAN, PROP_NONE);
6628 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ORBIT_CENTER_AUTO);
6630 "Auto",
6631 "Auto sets the orbit center dynamically. "
6632 "When the complete model is in view, the center of "
6633 "volume of the whole model is used as the rotation point. "
6634 "When you move closer, the orbit center will be set "
6635 "on an object close to your center of the view.");
6636
6637 prop = RNA_def_property(srna, "ndof_orbit_center_selected", PROP_BOOLEAN, PROP_NONE);
6638 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ORBIT_CENTER_SELECTED);
6640 "Selected Items",
6641 "Selected Item forces the orbit center "
6642 "to only take the currently selected objects into account.");
6643
6644 /* 3D view: yaw */
6645 prop = RNA_def_property(srna, "ndof_rotx_invert_axis", PROP_BOOLEAN, PROP_NONE);
6646 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ROTX_INVERT_AXIS);
6647 RNA_def_property_ui_text(prop, "Invert Pitch (X) Axis", "");
6648
6649 /* 3D view: pitch */
6650 prop = RNA_def_property(srna, "ndof_roty_invert_axis", PROP_BOOLEAN, PROP_NONE);
6651 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ROTY_INVERT_AXIS);
6652 RNA_def_property_ui_text(prop, "Invert Yaw (Y) Axis", "");
6653
6654 /* 3D view: roll */
6655 prop = RNA_def_property(srna, "ndof_rotz_invert_axis", PROP_BOOLEAN, PROP_NONE);
6656 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_ROTZ_INVERT_AXIS);
6657 RNA_def_property_ui_text(prop, "Invert Roll (Z) Axis", "");
6658
6659 /* 3D view: pan x */
6660 prop = RNA_def_property(srna, "ndof_panx_invert_axis", PROP_BOOLEAN, PROP_NONE);
6661 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_PANX_INVERT_AXIS);
6662 RNA_def_property_ui_text(prop, "Invert X Axis", "");
6663
6664 /* 3D view: pan y */
6665 prop = RNA_def_property(srna, "ndof_pany_invert_axis", PROP_BOOLEAN, PROP_NONE);
6666 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_PANY_INVERT_AXIS);
6667 RNA_def_property_ui_text(prop, "Invert Y Axis", "");
6668
6669 /* 3D view: pan z */
6670 prop = RNA_def_property(srna, "ndof_panz_invert_axis", PROP_BOOLEAN, PROP_NONE);
6671 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_PANZ_INVERT_AXIS);
6672 RNA_def_property_ui_text(prop, "Invert Z Axis", "");
6673
6674 /* 3D view: fly */
6675 prop = RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
6676 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_FLY_HELICOPTER);
6678 "Helicopter Mode",
6679 "Device up/down directly controls the Z position of the 3D viewport");
6680
6681 prop = RNA_def_property(srna, "ndof_lock_camera_pan_zoom", PROP_BOOLEAN, PROP_NONE);
6682 RNA_def_property_boolean_sdna(prop, nullptr, "ndof_flag", NDOF_CAMERA_PAN_ZOOM);
6684 prop,
6685 "Pan / Zoom Camera View",
6686 "Pan/zoom the camera view instead of leaving the camera view when orbiting");
6687# endif /* WITH_INPUT_NDOF */
6688
6689 prop = RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
6690 RNA_def_property_int_sdna(prop, nullptr, "dbl_click_time");
6691 RNA_def_property_range(prop, 1, 1000);
6692 RNA_def_property_ui_text(prop, "Double Click Timeout", "Time/delay (in ms) for a double click");
6693
6694 prop = RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
6695 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_TWOBUTTONMOUSE);
6697 prop, "Emulate 3 Button Mouse", "Emulate Middle Mouse with Alt+Left Mouse");
6699 RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
6700
6701 static const EnumPropertyItem mouse_emulate_3_button_modifier[] = {
6702 {USER_EMU_MMB_MOD_ALT, "ALT", 0, "Alt", ""},
6703 {USER_EMU_MMB_MOD_OSKEY, "OSKEY", 0, "OS-Key", ""},
6704 {0, nullptr, 0, nullptr, nullptr},
6705 };
6706
6707 prop = RNA_def_property(srna, "mouse_emulate_3_button_modifier", PROP_ENUM, PROP_NONE);
6708 /* Only needed because of WIN32 inability to support the option. */
6710 prop, "rna_UserDef_mouse_emulate_3_button_modifier_get", nullptr, nullptr);
6711 RNA_def_property_enum_items(prop, mouse_emulate_3_button_modifier);
6713 prop, "Emulate 3 Button Modifier", "Hold this modifier to emulate the middle mouse button");
6715 RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
6716
6717 prop = RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
6718 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_NONUMPAD);
6720 prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)");
6721
6722 prop = RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
6723 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_WHEELZOOMDIR);
6724 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
6725
6726 static const EnumPropertyItem touchpad_scroll_direction_items[] = {
6728 "TRADITIONAL",
6729 0,
6730 "Traditional",
6731 "Traditional scroll direction"},
6732 {USER_TRACKPAD_SCROLL_DIR_NATURAL, "NATURAL", 0, "Natural", "Natural scroll direction"},
6733 {0, nullptr, 0, nullptr, nullptr},
6734 };
6735 prop = RNA_def_property(srna, "touchpad_scroll_direction", PROP_ENUM, PROP_NONE);
6736 RNA_def_property_enum_sdna(prop, nullptr, "trackpad_scroll_direction");
6737 RNA_def_property_enum_items(prop, touchpad_scroll_direction_items);
6738 RNA_def_property_ui_text(prop, "Touchpad Scroll Direction", "Scroll direction (Wayland only)");
6739}
6740
6742{
6743 PropertyRNA *prop;
6744
6745 StructRNA *srna = RNA_def_struct(brna, "PreferencesKeymap", nullptr);
6746 RNA_def_struct_sdna(srna, "UserDef");
6747 RNA_def_struct_nested(brna, srna, "Preferences");
6748 RNA_def_struct_ui_text(srna, "Keymap", "Shortcut setup for keyboards and other input devices");
6749
6750 prop = RNA_def_property(srna, "show_ui_keyconfig", PROP_BOOLEAN, PROP_NONE);
6752 prop, nullptr, "space_data.flag", USER_SPACEDATA_INPUT_HIDE_UI_KEYCONFIG);
6753 RNA_def_property_ui_text(prop, "Show UI Key-Config", "");
6754
6755 prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
6756 RNA_def_property_string_sdna(prop, nullptr, "keyconfigstr");
6757 RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
6758}
6759
6761{
6762 StructRNA *srna;
6763 PropertyRNA *prop;
6764
6765 srna = RNA_def_struct(brna, "UserAssetLibrary", nullptr);
6766 RNA_def_struct_sdna(srna, "bUserAssetLibrary");
6768 srna, "Asset Library", "Settings to define a reusable library for Asset Browsers to use");
6769
6770 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6772 prop, "Name", "Identifier (not necessarily unique) for the asset library");
6773 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_asset_library_name_set");
6774 RNA_def_struct_name_property(srna, prop);
6775 RNA_def_property_update(prop, 0, "rna_userdef_update");
6776
6777 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH);
6778 RNA_def_property_string_sdna(prop, nullptr, "dirpath");
6780 prop, "Path", "Path to a directory with .blend files to use as an asset library");
6782 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_asset_library_path_set");
6784 RNA_def_property_update(prop, 0, "rna_userdef_asset_library_update");
6785
6786 prop = RNA_def_property(srna, "import_method", PROP_ENUM, PROP_NONE);
6789 prop, nullptr, nullptr, "rna_preference_asset_libray_import_method_itemf");
6790 RNA_def_property_enum_default_func(prop, "rna_preference_asset_libray_import_method_default");
6792 prop,
6793 "Default Import Method",
6794 "Determine how the asset will be imported, unless overridden by the Asset Browser");
6796 RNA_def_property_update(prop, 0, "rna_userdef_asset_library_update");
6797
6798 prop = RNA_def_property(srna, "use_relative_path", PROP_BOOLEAN, PROP_NONE);
6801 prop, "Relative Path", "Use relative path when linking assets from this asset library");
6802}
6803
6805{
6806 StructRNA *srna;
6807 PropertyRNA *prop;
6808
6809 srna = RNA_def_struct(brna, "UserExtensionRepo", nullptr);
6810 RNA_def_struct_sdna(srna, "bUserExtensionRepo");
6812 srna, "Extension Repository", "Settings to define an extension repository");
6813
6814 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6815 RNA_def_property_ui_text(prop, "Name", "Unique repository name");
6816 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_extension_repo_name_set");
6817 RNA_def_struct_name_property(srna, prop);
6818 RNA_def_property_update(prop, 0, "rna_userdef_update");
6819
6820 prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
6821 RNA_def_property_ui_text(prop, "Module", "Unique module identifier");
6822 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_extension_repo_module_set");
6823 RNA_def_property_update(prop, 0, "rna_userdef_update");
6824
6825 prop = RNA_def_property(srna, "custom_directory", PROP_STRING, PROP_DIRPATH);
6826 RNA_def_property_string_sdna(prop, nullptr, "custom_dirpath");
6827 RNA_def_property_ui_text(prop, "Custom Directory", "The local directory containing extensions");
6830 prop, nullptr, nullptr, "rna_userdef_extension_repo_custom_directory_set");
6831 RNA_def_property_update(prop, 0, "rna_userdef_update");
6832
6833 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
6834 RNA_def_property_ui_text(prop, "Directory", "The local directory containing extensions");
6838 "rna_userdef_extension_repo_directory_get",
6839 "rna_userdef_extension_repo_directory_length",
6840 nullptr);
6841
6842 prop = RNA_def_property(srna, "remote_url", PROP_STRING, PROP_NONE);
6843 RNA_def_property_string_sdna(prop, nullptr, "remote_url");
6845 prop,
6846 "URL",
6847 "Remote URL to the extension repository, "
6848 "the file-system may be referenced using the file URI scheme: \"file://\"");
6850 RNA_def_property_update(prop, 0, "rna_userdef_extension_sync_update");
6851
6852 prop = RNA_def_property(srna, "access_token", PROP_STRING, PROP_PASSWORD);
6854 prop, "Secret", "Personal access token, may be required by some repositories");
6856 "rna_userdef_extension_repo_access_token_get",
6857 "rna_userdef_extension_repo_access_token_length",
6858 "rna_userdef_extension_repo_access_token_set");
6859 RNA_def_property_update(prop, 0, "rna_userdef_extension_sync_update");
6860
6861 prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
6863 RNA_def_property_enum_funcs(prop, nullptr, "rna_userdef_extension_repo_source_set", nullptr);
6865 prop,
6866 "Source",
6867 "Select if the repository is in a user managed or system provided directory");
6868
6869 /* NOTE(@ideasman42): this is intended to be used by a package manger component
6870 * which is not yet integrated. */
6871 prop = RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
6874 "Clean Files After Install",
6875 "Downloaded package files are deleted after installation");
6876 RNA_def_property_update(prop, 0, "rna_userdef_update");
6877
6878 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
6880 RNA_def_property_ui_text(prop, "Enabled", "Enable the repository");
6881 RNA_def_property_boolean_funcs(prop, nullptr, "rna_userdef_extension_repo_enabled_set");
6882 RNA_def_property_update(prop, 0, "rna_userdef_update");
6883
6884 prop = RNA_def_property(srna, "use_sync_on_startup", PROP_BOOLEAN, PROP_NONE);
6887 prop, "Check for Updates on Startup", "Allow Blender to check for updates upon launch");
6888 RNA_def_property_update(prop, 0, "rna_userdef_update");
6889
6890 prop = RNA_def_property(srna, "use_access_token", PROP_BOOLEAN, PROP_NONE);
6892 RNA_def_property_ui_text(prop, "Requires Access Token", "Repository requires an access token");
6893 RNA_def_property_update(prop, 0, "rna_userdef_extension_sync_update");
6894
6895 prop = RNA_def_property(srna, "use_custom_directory", PROP_BOOLEAN, PROP_NONE);
6897 prop, nullptr, "flag", USER_EXTENSION_REPO_FLAG_USE_CUSTOM_DIRECTORY);
6899 "Custom Directory",
6900 "Manually set the path for extensions to be stored. "
6901 "When disabled a user's extensions directory is created.");
6903 prop, nullptr, "rna_userdef_extension_repo_use_custom_directory_set");
6904 RNA_def_property_update(prop, 0, "rna_userdef_update");
6905
6906 prop = RNA_def_property(srna, "use_remote_url", PROP_BOOLEAN, PROP_NONE);
6908 RNA_def_property_ui_text(prop, "Use Remote", "Synchronize the repository with a remote URL");
6909 RNA_def_property_boolean_funcs(prop, nullptr, "rna_userdef_extension_repo_use_remote_url_set");
6910 RNA_def_property_update(prop, 0, "rna_userdef_update");
6911}
6912
6914{
6915 StructRNA *srna = RNA_def_struct(brna, "ScriptDirectory", nullptr);
6916 RNA_def_struct_sdna(srna, "bUserScriptDirectory");
6917 RNA_def_struct_ui_text(srna, "Python Scripts Directory", "");
6918
6919 PropertyRNA *prop;
6920
6921 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6922 RNA_def_property_ui_text(prop, "Name", "Identifier for the Python scripts directory");
6923 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_userdef_script_directory_name_set");
6924 RNA_def_struct_name_property(srna, prop);
6925 RNA_def_property_update(prop, 0, "rna_userdef_update");
6926
6927 /* NOTE(@ideasman42): Ideally, changing scripts directory would behave as if
6928 * Blender were launched with different script directories (instead of requiring a restart).
6929 * Editing could re-initialize Python's `sys.path`, however this isn't enough.
6930 *
6931 * - For adding new directories this would work for the most-part, duplicate modules between
6932 * directories might cause Python's state on restart to differ however that could
6933 * be considered a corner case as duplicate modules might cause bad/unexpected behavior anyway.
6934 * - Support for removing/changing directories is more involved as there might be modules
6935 * loaded into memory which are no longer accessible.
6936 *
6937 * Properly supporting this would likely require unloading all Blender/Python modules,
6938 * then re-initializing Python's state. This is already supported with `SCRIPT_OT_reload`,
6939 * even then, there are cases that don't work well (especially if any Python operators are
6940 * running at the time this runs). So accept the limitation having to restart
6941 * before changes to script directories are taken into account. */
6942
6943 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
6944 RNA_def_property_string_sdna(prop, nullptr, "dir_path");
6946 prop,
6947 "Python Scripts Directory",
6948 "Alternate script path, matching the default layout with sub-directories: startup, add-ons, "
6949 "modules, and presets (requires restart)");
6950}
6951
6953{
6954 StructRNA *srna;
6955 FunctionRNA *func;
6956 PropertyRNA *parm;
6957
6958 RNA_def_property_srna(cprop, "ScriptDirectoryCollection");
6959 srna = RNA_def_struct(brna, "ScriptDirectoryCollection", nullptr);
6960 RNA_def_struct_ui_text(srna, "Python Scripts Directories", "");
6961
6962 func = RNA_def_function(srna, "new", "rna_userdef_script_directory_new");
6964 RNA_def_function_ui_description(func, "Add a new Python script directory");
6965 /* return type */
6966 parm = RNA_def_pointer(func, "script_directory", "ScriptDirectory", "", "");
6967 RNA_def_function_return(func, parm);
6968
6969 func = RNA_def_function(srna, "remove", "rna_userdef_script_directory_remove");
6971 RNA_def_function_ui_description(func, "Remove a Python script directory");
6972 parm = RNA_def_pointer(func, "script_directory", "ScriptDirectory", "", "");
6975}
6976
6978{
6979 StructRNA *srna;
6980 FunctionRNA *func;
6981 PropertyRNA *parm;
6982
6983 RNA_def_property_srna(cprop, "AssetLibraryCollection");
6984 srna = RNA_def_struct(brna, "AssetLibraryCollection", nullptr);
6985 RNA_def_struct_ui_text(srna, "User Asset Libraries", "Collection of user asset libraries");
6986
6987 func = RNA_def_function(srna, "new", "rna_userdef_asset_library_new");
6989 RNA_def_function_ui_description(func, "Add a new Asset Library");
6990 RNA_def_string(func, "name", nullptr, sizeof(bUserAssetLibrary::name), "Name", "");
6991 RNA_def_string(func, "directory", nullptr, sizeof(bUserAssetLibrary::dirpath), "Directory", "");
6992 /* return type */
6993 parm = RNA_def_pointer(func, "library", "UserAssetLibrary", "", "Newly added asset library");
6994 RNA_def_function_return(func, parm);
6995
6996 func = RNA_def_function(srna, "remove", "rna_userdef_asset_library_remove");
6998 RNA_def_function_ui_description(func, "Remove an Asset Library");
6999 parm = RNA_def_pointer(func, "library", "UserAssetLibrary", "", "");
7002}
7003
7005{
7006 StructRNA *srna;
7007 FunctionRNA *func;
7008 PropertyRNA *parm;
7009
7010 RNA_def_property_srna(cprop, "UserExtensionRepoCollection");
7011 srna = RNA_def_struct(brna, "UserExtensionRepoCollection", nullptr);
7013 srna, "User Extension Repositories", "Collection of user extension repositories");
7014
7015 func = RNA_def_function(srna, "new", "rna_userdef_extension_repo_new");
7017 RNA_def_function_ui_description(func, "Add a new repository");
7018
7019 RNA_def_string(func, "name", nullptr, sizeof(bUserExtensionRepo::name), "Name", "");
7020 RNA_def_string(func, "module", nullptr, sizeof(bUserExtensionRepo::module), "Module", "");
7021 RNA_def_string(func,
7022 "custom_directory",
7023 nullptr,
7025 "Custom Directory",
7026 "");
7028 func, "remote_url", nullptr, sizeof(bUserExtensionRepo::remote_url), "Remote URL", "");
7029 RNA_def_enum(func,
7030 "source",
7033 "Source",
7034 "How the repository is managed");
7035
7036 /* return type */
7037 parm = RNA_def_pointer(func, "repo", "UserExtensionRepo", "", "Newly added repository");
7038 RNA_def_function_return(func, parm);
7039
7040 func = RNA_def_function(srna, "remove", "rna_userdef_extension_repo_remove");
7042 RNA_def_function_ui_description(func, "Remove repos");
7043 parm = RNA_def_pointer(func, "repo", "UserExtensionRepo", "", "Repository to remove");
7046}
7047
7049{
7050 PropertyRNA *prop;
7051 StructRNA *srna;
7052
7053 static const EnumPropertyItem anim_player_presets[] = {
7054 {0, "INTERNAL", 0, "Internal", "Built-in animation player"},
7055 {2, "DJV", 0, "DJV", "Open source frame player"},
7056 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
7057 {4, "RV", 0, "RV", "Frame player from Tweak Software"},
7058 {5, "MPLAYER", 0, "MPlayer", "Media player for video and PNG/JPEG/SGI image sequences"},
7059 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
7060 {0, nullptr, 0, nullptr, nullptr},
7061 };
7062
7063 static const EnumPropertyItem preview_type_items[] = {
7064 {USER_FILE_PREVIEW_NONE, "NONE", 0, "None", "Do not create blend previews"},
7065 {USER_FILE_PREVIEW_AUTO, "AUTO", 0, "Auto", "Automatically select best preview type"},
7066 {USER_FILE_PREVIEW_SCREENSHOT, "SCREENSHOT", 0, "Screenshot", "Capture the entire window"},
7067 {USER_FILE_PREVIEW_CAMERA, "CAMERA", 0, "Camera View", "Workbench render of scene"},
7068 {0, nullptr, 0, nullptr, nullptr},
7069 };
7070
7071 srna = RNA_def_struct(brna, "PreferencesFilePaths", nullptr);
7072 RNA_def_struct_sdna(srna, "UserDef");
7073 RNA_def_struct_nested(brna, srna, "Preferences");
7074 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
7075
7076 prop = RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
7077 RNA_def_property_boolean_negative_sdna(prop, nullptr, "uiflag", USER_HIDE_DOT);
7079 "Show Hidden Files/Data-Blocks",
7080 "Show files and data-blocks that are normally hidden");
7081
7082 prop = RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
7083 RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_FILTERFILEEXTS);
7084 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files in the File Browser");
7085
7086 prop = RNA_def_property(srna, "show_recent_locations", PROP_BOOLEAN, PROP_NONE);
7089 prop, "Show Recent Locations", "Show Recent locations list in the File Browser");
7090
7091 prop = RNA_def_property(srna, "show_system_bookmarks", PROP_BOOLEAN, PROP_NONE);
7094 prop, "Show System Locations", "Show System locations list in the File Browser");
7095
7096 prop = RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
7097 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_RELPATHS);
7099 prop,
7100 "Relative Paths",
7101 "Default relative path option for the file selector, when no path is defined yet");
7102
7103 prop = RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
7104 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_FILECOMPRESS);
7106 prop, "Compress File", "Enable file compression when saving .blend files");
7107
7108 prop = RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
7110 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
7111 RNA_def_property_update(prop, 0, "rna_userdef_load_ui_update");
7112
7113 prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
7116 "Auto Run Python Scripts",
7117 "Allow any .blend file to run scripts automatically "
7118 "(unsafe with blend files from an untrusted source)");
7119 RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
7120
7121 prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
7124 prop,
7125 "Tabs as Spaces",
7126 "Automatically convert all new tabs into spaces for new and loaded text files");
7127
7128 prop = RNA_def_property(srna, "use_extension_online_access_handled", PROP_BOOLEAN, PROP_NONE);
7130 prop, nullptr, "extension_flag", USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED);
7132 prop,
7133 "Online Access",
7134 "The user has been shown the \"Online Access\" prompt and made a choice");
7135
7136 /* Directories. */
7137
7138 prop = RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
7139 RNA_def_property_string_sdna(prop, nullptr, "fontdir");
7142 prop, "Fonts Directory", "The default directory to search for loading fonts");
7143
7144 prop = RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
7145 RNA_def_property_string_sdna(prop, nullptr, "textudir");
7148 prop, "Textures Directory", "The default directory to search for textures");
7149
7150 prop = RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
7151 RNA_def_property_string_sdna(prop, nullptr, "renderdir");
7154 "Render Output Directory",
7155 "The default directory for rendering output, for new scenes");
7156
7158
7159 prop = RNA_def_property(srna, "script_directories", PROP_COLLECTION, PROP_NONE);
7160 RNA_def_property_struct_type(prop, "ScriptDirectory");
7161 RNA_def_property_ui_text(prop, "Python Scripts Directory", "");
7163
7164 prop = RNA_def_property(srna, "i18n_branches_directory", PROP_STRING, PROP_DIRPATH);
7165 RNA_def_property_string_sdna(prop, nullptr, "i18ndir");
7167 prop,
7168 "Translation Branches Directory",
7169 "The path to the '/branches' directory of your local svn-translation copy, "
7170 "to allow translating from the UI");
7171
7172 prop = RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
7173 RNA_def_property_string_sdna(prop, nullptr, "sounddir");
7174 RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
7176
7177 prop = RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
7178 RNA_def_property_string_sdna(prop, nullptr, "tempdir");
7180 "Temporary Directory",
7181 "The directory for storing temporary save files. "
7182 "The path must reference an existing directory or it will be ignored");
7183 RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
7184
7185 prop = RNA_def_property(srna, "render_cache_directory", PROP_STRING, PROP_DIRPATH);
7186 RNA_def_property_string_sdna(prop, nullptr, "render_cachedir");
7187 RNA_def_property_ui_text(prop, "Render Cache Path", "Where to cache raw render results");
7189
7190 prop = RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
7191 RNA_def_property_string_sdna(prop, nullptr, "image_editor");
7192 RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
7193
7194 prop = RNA_def_property(srna, "text_editor", PROP_STRING, PROP_FILEPATH);
7195 RNA_def_property_string_sdna(prop, nullptr, "text_editor");
7197 "Text Editor",
7198 "Command to launch the text editor, "
7199 "either a full path or a command in $PATH.\n"
7200 "Use the internal editor when left blank");
7201
7202 prop = RNA_def_property(srna, "text_editor_args", PROP_STRING, PROP_NONE);
7203 RNA_def_property_string_sdna(prop, nullptr, "text_editor_args");
7205 prop,
7206 "Text Editor Args",
7207 "Defines the specific format of the arguments with which the text editor opens files. "
7208 "The supported expansions are as follows:\n"
7209 "\n"
7210 "$filepath The absolute path of the file.\n"
7211 "$line The line to open at (Optional).\n"
7212 "$column The column to open from the beginning of the line (Optional).\n"
7213 "$line0 & column0 start at zero."
7214 "\n"
7215 "Example: -f $filepath -l $line -c $column");
7216
7217 prop = RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
7218 RNA_def_property_string_sdna(prop, nullptr, "anim_player");
7220 prop, "Animation Player", "Path to a custom animation/frame sequence player");
7221
7222 prop = RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
7223 RNA_def_property_enum_sdna(prop, nullptr, "anim_player_preset");
7224 RNA_def_property_enum_items(prop, anim_player_presets);
7226 prop, "Animation Player Preset", "Preset configs for external animation players");
7227
7228 /* Auto-save. */
7229
7230 prop = RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
7231 RNA_def_property_int_sdna(prop, nullptr, "versions");
7232 RNA_def_property_range(prop, 0, 32);
7234 prop,
7235 "Save Versions",
7236 "The number of old versions to maintain in the current directory, when manually saving");
7237
7238 prop = RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
7239 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_AUTOSAVE);
7241 "Auto Save Temporary Files",
7242 "Automatic saving of temporary files in temp directory, "
7243 "uses process ID.\n"
7244 "Warning: Sculpt and edit mode data won't be saved");
7245 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
7246
7247 prop = RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
7248 RNA_def_property_int_sdna(prop, nullptr, "savetime");
7249 RNA_def_property_range(prop, 1, 60);
7251 prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
7252 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
7253
7254 prop = RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
7255 RNA_def_property_range(prop, 0, 1000);
7257 prop, "Recent Files", "Maximum number of recently opened files to remember");
7258
7259 prop = RNA_def_property(srna, "file_preview_type", PROP_ENUM, PROP_NONE);
7260 RNA_def_property_enum_items(prop, preview_type_items);
7261 RNA_def_property_ui_text(prop, "File Preview Type", "What type of blend preview to create");
7262
7264
7265 prop = RNA_def_property(srna, "asset_libraries", PROP_COLLECTION, PROP_NONE);
7266 RNA_def_property_struct_type(prop, "UserAssetLibrary");
7267 RNA_def_property_ui_text(prop, "Asset Libraries", "");
7269
7270 prop = RNA_def_property(srna, "active_asset_library", PROP_INT, PROP_NONE);
7272 "Active Asset Library",
7273 "Index of the asset library being edited in the Preferences UI");
7274}
7275
7277{
7278 PropertyRNA *prop;
7279 StructRNA *srna;
7280
7281 srna = RNA_def_struct(brna, "PreferencesExtensions", nullptr);
7282 RNA_def_struct_sdna(srna, "UserDef");
7283 RNA_def_struct_nested(brna, srna, "Preferences");
7284 RNA_def_struct_ui_text(srna, "Extensions", "Settings for extensions");
7285
7286 prop = RNA_def_property(srna, "use_online_access_handled", PROP_BOOLEAN, PROP_NONE);
7288 prop, nullptr, "extension_flag", USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED);
7290 prop,
7291 "Online Access",
7292 "The user has been shown the \"Online Access\" prompt and made a choice");
7293
7295
7296 prop = RNA_def_property(srna, "repos", PROP_COLLECTION, PROP_NONE);
7297 RNA_def_property_collection_sdna(prop, nullptr, "extension_repos", nullptr);
7298 RNA_def_property_struct_type(prop, "UserExtensionRepo");
7299 RNA_def_property_ui_text(prop, "Extension Repositories", "");
7301
7302 prop = RNA_def_property(srna, "active_repo", PROP_INT, PROP_NONE);
7303 RNA_def_property_int_sdna(prop, nullptr, "active_extension_repo");
7305 prop,
7306 "Active Extension Repository",
7307 "Index of the extensions repository being edited in the Preferences UI");
7308
7309 /* Tag for UI-only update, meaning preferences will not be tagged as changed. */
7310 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7311}
7312
7314{
7315 PropertyRNA *prop;
7316 StructRNA *srna;
7317
7318 srna = RNA_def_struct(brna, "PreferencesApps", nullptr);
7319 RNA_def_struct_sdna(srna, "UserDef");
7320 RNA_def_struct_nested(brna, srna, "Preferences");
7321 RNA_def_struct_ui_text(srna, "Apps", "Preferences that work only for apps");
7322
7323 prop = RNA_def_property(srna, "show_corner_split", PROP_BOOLEAN, PROP_NONE);
7326 prop, "Corner Splitting", "Split and join editors by dragging from corners");
7327 RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
7328
7329 prop = RNA_def_property(srna, "show_edge_resize", PROP_BOOLEAN, PROP_NONE);
7331 RNA_def_property_ui_text(prop, "Edge Resize", "Resize editors by dragging from the edges");
7332 RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
7333
7334 prop = RNA_def_property(srna, "show_regions_visibility_toggle", PROP_BOOLEAN, PROP_NONE);
7337 prop, "Regions Visibility Toggle", "Header and side bars visibility toggles");
7338 RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
7339}
7340
7342{
7343 StructRNA *srna;
7344 PropertyRNA *prop;
7345
7346 srna = RNA_def_struct(brna, "PreferencesExperimental", nullptr);
7347 RNA_def_struct_sdna(srna, "UserDef_Experimental");
7348 RNA_def_struct_nested(brna, srna, "Preferences");
7349 RNA_def_struct_ui_text(srna, "Experimental", "Experimental features");
7350
7351 prop = RNA_def_property(srna, "use_undo_legacy", PROP_BOOLEAN, PROP_NONE);
7352 RNA_def_property_boolean_sdna(prop, nullptr, "use_undo_legacy", 1);
7354 prop,
7355 "Undo Legacy",
7356 "Use legacy undo (slower than the new default one, but may be more stable in some cases)");
7357
7358 prop = RNA_def_property(srna, "override_auto_resync", PROP_BOOLEAN, PROP_NONE);
7359 RNA_def_property_boolean_sdna(prop, nullptr, "no_override_auto_resync", 1);
7361 "No Override Auto Resync",
7362 "Disable library overrides automatic resync detection and process on "
7363 "file load (can be useful to help fixing broken files). Also see the "
7364 "\"--disable-liboverride-auto-resync\" command line option");
7365
7366 prop = RNA_def_property(srna, "use_new_curves_tools", PROP_BOOLEAN, PROP_NONE);
7367 RNA_def_property_boolean_sdna(prop, nullptr, "use_new_curves_tools", 1);
7369 prop, "New Curves Tools", "Enable additional features for the new curves data block");
7370
7371 prop = RNA_def_property(srna, "use_cycles_debug", PROP_BOOLEAN, PROP_NONE);
7372 RNA_def_property_boolean_sdna(prop, nullptr, "use_cycles_debug", 1);
7373 RNA_def_property_ui_text(prop, "Cycles Debug", "Enable Cycles debugging options for developers");
7374 RNA_def_property_update(prop, 0, "rna_userdef_update");
7375
7376 prop = RNA_def_property(srna, "use_eevee_debug", PROP_BOOLEAN, PROP_NONE);
7377 RNA_def_property_boolean_sdna(prop, nullptr, "use_eevee_debug", 1);
7378 RNA_def_property_ui_text(prop, "EEVEE Debug", "Enable EEVEE debugging options for developers");
7379 RNA_def_property_update(prop, 0, "rna_userdef_update");
7380
7381 prop = RNA_def_property(srna, "use_sculpt_texture_paint", PROP_BOOLEAN, PROP_NONE);
7382 RNA_def_property_boolean_sdna(prop, nullptr, "use_sculpt_texture_paint", 1);
7383 RNA_def_property_ui_text(prop, "Sculpt Texture Paint", "Use texture painting in Sculpt Mode");
7384
7385 prop = RNA_def_property(srna, "use_extended_asset_browser", PROP_BOOLEAN, PROP_NONE);
7387 "Extended Asset Browser",
7388 "Enable Asset Browser editor and operators to manage regular "
7389 "data-blocks as assets, not just poses");
7390 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7391
7392 prop = RNA_def_property(srna, "show_asset_debug_info", PROP_BOOLEAN, PROP_NONE);
7394 "Asset Debug Info",
7395 "Enable some extra fields in the Asset Browser to aid in debugging");
7396 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7397
7398 prop = RNA_def_property(srna, "use_asset_indexing", PROP_BOOLEAN, PROP_NONE);
7399 RNA_def_property_boolean_sdna(prop, nullptr, "no_asset_indexing", 1);
7401 "No Asset Indexing",
7402 "Disable the asset indexer, to force every asset library refresh to "
7403 "completely reread assets from disk");
7404 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7405
7406 prop = RNA_def_property(srna, "use_viewport_debug", PROP_BOOLEAN, PROP_NONE);
7407 RNA_def_property_boolean_sdna(prop, nullptr, "use_viewport_debug", 1);
7409 "Viewport Debug",
7410 "Enable viewport debugging options for developers in the overlays "
7411 "pop-over");
7412 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7413
7414 prop = RNA_def_property(srna, "write_legacy_blend_file_format", PROP_BOOLEAN, PROP_NONE);
7415 RNA_def_property_boolean_sdna(prop, nullptr, "write_legacy_blend_file_format", 1);
7417 prop,
7418 "Write Legacy Blend File Format",
7419 "Use file format used before Blender 5.0. This format is more limited "
7420 "but it may have better compatibility with tools that don't support the new format yet");
7421
7422 prop = RNA_def_property(srna, "no_data_block_packing", PROP_BOOLEAN, PROP_NONE);
7423 RNA_def_property_boolean_sdna(prop, nullptr, "no_data_block_packing", 1);
7425 prop, "No Data-Block Packing", "Fall-back to appending instead of packing data-blocks");
7427 RNA_def_property_update(prop, 0, "rna_experimental_no_data_block_packing_update");
7428
7429 prop = RNA_def_property(srna, "use_all_linked_data_direct", PROP_BOOLEAN, PROP_NONE);
7431 prop,
7432 "All Linked Data Direct",
7433 "Forces all linked data to be considered as directly linked. Workaround for current "
7434 "issues/limitations in BAT (Blender studio pipeline tool)");
7435
7436 prop = RNA_def_property(srna, "use_shader_node_previews", PROP_BOOLEAN, PROP_NONE);
7438 prop, "Shader Node Previews", "Enables previews in the shader node editor");
7439 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7440
7441 prop = RNA_def_property(srna, "use_geometry_nodes_lists", PROP_BOOLEAN, PROP_NONE);
7442 RNA_def_property_ui_text(prop, "Geometry Nodes Lists", "Enable new list types and nodes");
7443
7444 prop = RNA_def_property(srna, "use_extensions_debug", PROP_BOOLEAN, PROP_NONE);
7446 prop,
7447 "Extensions Debug",
7448 "Extra debugging information & developer support utilities for extensions");
7449 RNA_def_property_update(prop, 0, "rna_userdef_update");
7450
7451 prop = RNA_def_property(srna, "use_recompute_usercount_on_save_debug", PROP_BOOLEAN, PROP_NONE);
7453 "Recompute ID Usercount On Save",
7454 "Recompute all ID usercounts before saving to a blendfile. Allows to "
7455 "work around invalid usercount handling in code that may lead to loss "
7456 "of data due to wrongly detected unused data-blocks");
7457}
7458
7460{
7461 StructRNA *srna;
7462 FunctionRNA *func;
7463 PropertyRNA *parm;
7464
7465 RNA_def_property_srna(cprop, "Addons");
7466 srna = RNA_def_struct(brna, "Addons", nullptr);
7467 RNA_def_struct_ui_text(srna, "User Add-ons", "Collection of add-ons");
7468
7469 func = RNA_def_function(srna, "new", "rna_userdef_addon_new");
7471 RNA_def_function_ui_description(func, "Add a new add-on");
7472 /* return type */
7473 parm = RNA_def_pointer(func, "addon", "Addon", "", "Add-on data");
7474 RNA_def_function_return(func, parm);
7475
7476 func = RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
7478 RNA_def_function_ui_description(func, "Remove add-on");
7479 parm = RNA_def_pointer(func, "addon", "Addon", "", "Add-on to remove");
7482}
7483
7485{
7486 StructRNA *srna;
7487 FunctionRNA *func;
7488 PropertyRNA *parm;
7489
7490 RNA_def_property_srna(cprop, "PathCompareCollection");
7491 srna = RNA_def_struct(brna, "PathCompareCollection", nullptr);
7492 RNA_def_struct_ui_text(srna, "Paths Compare", "Collection of paths");
7493
7494 func = RNA_def_function(srna, "new", "rna_userdef_pathcompare_new");
7496 RNA_def_function_ui_description(func, "Add a new path");
7497 /* return type */
7498 parm = RNA_def_pointer(func, "pathcmp", "PathCompare", "", "");
7499 RNA_def_function_return(func, parm);
7500
7501 func = RNA_def_function(srna, "remove", "rna_userdef_pathcompare_remove");
7503 RNA_def_function_ui_description(func, "Remove path");
7504 parm = RNA_def_pointer(func, "pathcmp", "PathCompare", "", "");
7507}
7508
7510{
7512
7513 StructRNA *srna;
7514 PropertyRNA *prop;
7515
7520
7521 srna = RNA_def_struct(brna, "Preferences", nullptr);
7522 RNA_def_struct_sdna(srna, "UserDef");
7523 RNA_def_struct_ui_text(srna, "Preferences", "Global preferences");
7524
7525 prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
7526 RNA_def_property_enum_sdna(prop, nullptr, "space_data.section_active");
7528 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UseDef_active_section_itemf");
7529 RNA_def_property_ui_text(prop, "Active Section", "Preferences");
7530 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7531
7532 /* don't expose this directly via the UI, modify via an operator */
7533 prop = RNA_def_property(srna, "app_template", PROP_STRING, PROP_NONE);
7534 RNA_def_property_string_sdna(prop, nullptr, "app_template");
7535 RNA_def_property_ui_text(prop, "Application Template", "");
7536
7537 prop = RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
7538 RNA_def_property_collection_sdna(prop, nullptr, "themes", nullptr);
7539 RNA_def_property_struct_type(prop, "Theme");
7540 RNA_def_property_ui_text(prop, "Themes", "");
7541
7542 prop = RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
7543 RNA_def_property_collection_sdna(prop, nullptr, "uistyles", nullptr);
7544 RNA_def_property_struct_type(prop, "ThemeStyle");
7545 RNA_def_property_ui_text(prop, "Styles", "");
7546
7547 prop = RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
7548 RNA_def_property_collection_sdna(prop, nullptr, "addons", nullptr);
7549 RNA_def_property_struct_type(prop, "Addon");
7550 RNA_def_property_ui_text(prop, "Add-on", "");
7552
7553 prop = RNA_def_property(srna, "autoexec_paths", PROP_COLLECTION, PROP_NONE);
7554 RNA_def_property_collection_sdna(prop, nullptr, "autoexec_paths", nullptr);
7555 RNA_def_property_struct_type(prop, "PathCompare");
7556 RNA_def_property_ui_text(prop, "Auto-Execution Paths", "");
7558
7559 prop = RNA_def_property(srna, "use_recent_searches", PROP_BOOLEAN, PROP_NONE);
7561 RNA_def_property_ui_text(prop, "Recent Searches", "Sort the recently searched items at the top");
7562
7563 /* nested structs */
7564 prop = RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
7566 RNA_def_property_struct_type(prop, "PreferencesView");
7567 RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", nullptr, nullptr, nullptr);
7568 RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
7569
7570 prop = RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
7572 RNA_def_property_struct_type(prop, "PreferencesEdit");
7573 RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", nullptr, nullptr, nullptr);
7574 RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
7575
7576 prop = RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
7578 RNA_def_property_struct_type(prop, "PreferencesInput");
7579 RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", nullptr, nullptr, nullptr);
7580 RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
7581
7582 prop = RNA_def_property(srna, "keymap", PROP_POINTER, PROP_NONE);
7584 RNA_def_property_struct_type(prop, "PreferencesKeymap");
7585 RNA_def_property_pointer_funcs(prop, "rna_UserDef_keymap_get", nullptr, nullptr, nullptr);
7586 RNA_def_property_ui_text(prop, "Keymap", "Shortcut setup for keyboards and other input devices");
7587
7588 prop = RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
7590 RNA_def_property_struct_type(prop, "PreferencesFilePaths");
7591 RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", nullptr, nullptr, nullptr);
7592 RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
7593
7594 prop = RNA_def_property(srna, "extensions", PROP_POINTER, PROP_NONE);
7596 RNA_def_property_struct_type(prop, "PreferencesExtensions");
7597 RNA_def_property_pointer_funcs(prop, "rna_UserDef_extensions_get", nullptr, nullptr, nullptr);
7598 RNA_def_property_ui_text(prop, "Extensions", "Settings for extensions");
7599
7600 prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
7602 RNA_def_property_struct_type(prop, "PreferencesSystem");
7603 RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", nullptr, nullptr, nullptr);
7605 prop, "System & OpenGL", "Graphics driver and operating system settings");
7606
7607 prop = RNA_def_property(srna, "apps", PROP_POINTER, PROP_NONE);
7609 RNA_def_property_struct_type(prop, "PreferencesApps");
7610 RNA_def_property_pointer_funcs(prop, "rna_UserDef_apps_get", nullptr, nullptr, nullptr);
7611 RNA_def_property_ui_text(prop, "Apps", "Preferences that work only for apps");
7612
7613 prop = RNA_def_property(srna, "experimental", PROP_POINTER, PROP_NONE);
7615 RNA_def_property_struct_type(prop, "PreferencesExperimental");
7617 prop,
7618 "Experimental",
7619 "Settings for features that are still early in their development stage");
7620
7621 prop = RNA_def_int_vector(srna,
7622 "version",
7623 3,
7624 nullptr,
7625 0,
7626 INT_MAX,
7627 "Version",
7628 "Version of Blender the userpref.blend was saved with",
7629 0,
7630 INT_MAX);
7631 RNA_def_property_int_funcs(prop, "rna_userdef_version_get", nullptr, nullptr);
7634
7635 /* StudioLight Collection */
7636 prop = RNA_def_property(srna, "studio_lights", PROP_COLLECTION, PROP_NONE);
7637 RNA_def_property_struct_type(prop, "StudioLight");
7638 RNA_def_property_srna(prop, "StudioLights");
7640 "rna_UserDef_studiolight_begin",
7641 "rna_iterator_listbase_next",
7642 "rna_iterator_listbase_end",
7643 "rna_iterator_listbase_get",
7644 nullptr,
7645 nullptr,
7646 nullptr,
7647 nullptr);
7648 RNA_def_property_ui_text(prop, "Studio Lights", "");
7649
7650 /* Preferences Flags */
7651 prop = RNA_def_property(srna, "use_preferences_save", PROP_BOOLEAN, PROP_NONE);
7652 RNA_def_property_boolean_sdna(prop, nullptr, "pref_flag", USER_PREF_FLAG_SAVE);
7654 "Save on Exit",
7655 "Save preferences on exit when modified "
7656 "(unless factory settings have been loaded)");
7657
7658 prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
7659 RNA_def_property_boolean_sdna(prop, nullptr, "runtime.is_dirty", 0);
7660 RNA_def_property_ui_text(prop, "Dirty", "Preferences have changed");
7661 RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
7662
7677
7679}
7680
7681#endif
void AS_asset_library_essential_import_method_update()
void AS_asset_library_import_method_ensure_valid(Main &bmain)
struct bAddonPrefType bAddonPrefType
Definition BKE_addon.h:23
void BKE_addon_pref_type_add(bAddonPrefType *apt)
Definition addon.cc:107
struct bAddon * BKE_addon_new(void)
Definition addon.cc:34
bAddonPrefType * BKE_addon_pref_type_find(const char *idname, bool quiet)
Definition addon.cc:84
void BKE_addon_pref_type_remove(const bAddonPrefType *apt)
Definition addon.cc:112
void BKE_addon_free(struct bAddon *addon)
Definition addon.cc:68
void BKE_tempdir_init(const char *userdir)
Definition appdir.cc:1200
Blender util stuff.
bool BKE_blender_version_is_alpha(void)
Definition blender.cc:176
void BKE_callback_exec(Main *bmain, PointerRNA **pointers, int num_pointers, eCbEvent evt)
Definition callbacks.cc:27
void BKE_callback_exec_null(Main *bmain, eCbEvent evt)
Definition callbacks.cc:38
@ 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
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
@ G_FLAG_INTERNET_OVERRIDE_PREF_OFFLINE
@ G_FLAG_SCRIPT_AUTOEXEC
@ G_FLAG_INTERNET_ALLOW
#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY
@ G_FILE_NO_UI
void BKE_image_free_all_gputextures(Main *bmain)
Definition image_gpu.cc:586
General operations, lookup, etc. for blender objects.
SubsurfModifierData * BKE_object_get_last_subsurf_modifier(const Object *ob)
size_t BKE_preferences_extension_repo_dirpath_get(const bUserExtensionRepo *repo, char *dirpath, int dirpath_maxncpy)
void BKE_preferences_extension_repo_module_set(UserDef *userdef, bUserExtensionRepo *repo, const char *module)
bUserExtensionRepo * BKE_preferences_extension_repo_add(UserDef *userdef, const char *name, const char *module, const char *custom_dirpath)
void BKE_preferences_asset_library_path_set(struct bUserAssetLibrary *library, const char *path) ATTR_NONNULL()
struct bUserAssetLibrary * BKE_preferences_asset_library_add(struct UserDef *userdef, const char *name, const char *dirpath) ATTR_NONNULL(1)
void BKE_preferences_extension_repo_remove(UserDef *userdef, bUserExtensionRepo *repo)
void BKE_preferences_asset_library_remove(struct UserDef *userdef, struct bUserAssetLibrary *library) ATTR_NONNULL()
void BKE_preferences_asset_library_name_set(struct UserDef *userdef, struct bUserAssetLibrary *library, const char *name) ATTR_NONNULL()
void BKE_preferences_extension_repo_name_set(UserDef *userdef, bUserExtensionRepo *repo, const char *name)
void BKE_preferences_extension_repo_custom_dirpath_set(bUserExtensionRepo *repo, const char *path)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_INFO
Definition BKE_report.hh:35
@ RPT_ERROR
Definition BKE_report.hh:39
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
void BKE_screen_header_alignment_reset(bScreen *screen)
Definition screen.cc:1059
char ** BKE_sound_get_device_names()
void BKE_studiolight_remove(StudioLight *sl)
@ STUDIOLIGHT_USER_DEFINED
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_TYPE_WORLD
@ STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS
@ STUDIOLIGHT_TYPE_STUDIO
StudioLight * BKE_studiolight_load(const char *filepath, int type)
#define STUDIOLIGHT_FLAG_ORIENTATIONS
struct ListBase * BKE_studiolight_listbase(void)
StudioLight * BKE_studiolight_create(const char *filepath, const SolidLight light[4], const float light_ambient[3])
void BKE_studiolight_refresh(void)
void BLF_default_size(float size)
void BLF_cache_clear()
Definition blf.cc:98
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
void BLI_kdtree_nd_ free(KDTree *tree)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:586
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:270
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:131
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define FILE_MAX
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
Definition string.cc:41
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:693
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
#define STRNCPY_UTF8_RLEN(dst, src)
#define STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define CLAMP(a, b, c)
#define ARRAY_SIZE(arr)
#define UNUSED_VARS(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define UNLIKELY(x)
#define STREQ(a, b)
Compatibility-like things for windows.
bool BLI_windows_is_store_install(void)
const EnumPropertyItem * BLT_lang_RNA_enum_properties()
Definition blt_lang.cc:183
void BLT_lang_set(const char *)
Definition blt_lang.cc:250
#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
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ IDP_FLAG_STATIC_TYPE
eAssetImportMethod
@ ASSET_IMPORT_PACK
@ ASSET_IMPORT_LINK
@ ASSET_IMPORT_APPEND_REUSE
@ ASSET_IMPORT_APPEND
@ ASSET_LIBRARY_RELATIVE_PATH
@ OB_MODE_WEIGHT_PAINT
Object is a sort of wrapper for general info.
@ SCE_DISPLAY_AA_OFF
@ SCE_DISPLAY_AA_SAMPLES_32
@ SCE_DISPLAY_AA_SAMPLES_8
@ SCE_DISPLAY_AA_SAMPLES_11
@ SCE_DISPLAY_AA_SAMPLES_5
@ SCE_DISPLAY_AA_SAMPLES_16
@ SCE_DISPLAY_AA_FXAA
@ TH_WIRECOLOR_CONSTCOLS
@ TH_BACKGROUND_GRADIENT_RADIAL
@ TH_BACKGROUND_SINGLE_COLOR
@ TH_BACKGROUND_GRADIENT_LINEAR
@ USER_DUP_MAT
@ USER_DUP_NTREE
@ USER_DUP_SURF
@ USER_DUP_LIGHTPROBE
@ USER_DUP_MBALL
@ USER_DUP_CURVE
@ USER_DUP_CAMERA
@ USER_DUP_VOLUME
@ USER_DUP_SPEAKER
@ USER_DUP_PSYS
@ USER_DUP_GPENCIL
@ USER_DUP_CURVES
@ USER_DUP_LAMP
@ USER_DUP_ARM
@ USER_DUP_MESH
@ USER_DUP_ACT
@ USER_DUP_POINTCLOUD
@ USER_DUP_FONT
@ USER_DUP_LATTICE
@ VIEW_NAVIGATION_FLY
@ VIEW_NAVIGATION_WALK
@ USER_EXTENSION_FLAG_ONLINE_ACCESS_HANDLED
@ AUTOKEY_FLAG_INSERTNEEDED
@ MANUALKEY_FLAG_INSERTNEEDED
@ AUTOKEY_FLAG_NOWARNING
@ KEYING_FLAG_XYZ2RGB
@ KEYING_FLAG_VISUALKEY
@ AUTOKEY_FLAG_INSERTAVAILABLE
@ USER_TR_REPORTS
@ USER_TR_NEWDATANAME
@ USER_TR_TOOLTIPS
@ USER_TR_IFACE
@ USER_DEPTH_CURSOR
@ USER_SHOW_VIEWPORTNAME
@ USER_DRAWVIEWINFO
@ USER_ORBIT_SELECTION
@ USER_HIDE_DOT
@ USER_AUTOPERSP
@ USER_SHOW_FPS
@ USER_AREA_CORNER_HANDLE
@ USER_FILTER_BRUSHES_BY_TOOL
@ USER_LOCK_CURSOR_ADJUST
@ USER_REGISTER_ALL_USERS
@ USER_MENUOPENAUTO
@ USER_SPLASH_DISABLE
@ USER_SHOW_GIZMO_NAVIGATE
@ USER_HIDE_SYSTEM_BOOKMARKS
@ USER_ZOOM_INVERT
@ USER_HEADER_FROM_PREF
@ USER_FILTERFILEEXTS
@ USER_SAVE_PROMPT
@ USER_HEADER_BOTTOM
@ USER_CONTINUOUS_MOUSE
@ USER_ZOOM_TO_MOUSEPOS
@ USER_WHEELZOOMDIR
@ USER_GLOBALUNDO
@ USER_DEPTH_NAVIGATE
@ USER_PLAINMENUS
@ USER_HIDE_RECENT
@ USER_REDUCE_MOTION
@ USER_NO_MULTITOUCH_GESTURES
@ USER_NODE_AUTO_OFFSET
@ USER_ZOOM_HORIZ
@ IMAGE_DRAW_METHOD_AUTO
@ IMAGE_DRAW_METHOD_GLSL
@ IMAGE_DRAW_METHOD_2DTEXTURE
@ USER_TABLET_NATIVE
@ USER_TABLET_AUTOMATIC
@ USER_TABLET_WINTAB
@ USER_EXTENSION_REPO_SOURCE_SYSTEM
@ USER_EXTENSION_REPO_SOURCE_USER
@ USER_GPU_FLAG_SUBDIVISION_EVALUATION
@ USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE
@ USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE
@ USER_GPU_FLAG_FRESNEL_EDIT
@ USER_WALK_MOUSE_REVERSE
@ USER_WALK_GRAVITY
@ USER_EMU_MMB_MOD_OSKEY
@ USER_EMU_MMB_MOD_ALT
@ USER_FACTOR_AS_FACTOR
@ USER_FACTOR_AS_PERCENTAGE
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
@ USER_SEQ_PROXY_SETUP_MANUAL
@ USER_CP_SQUARE_SV
@ USER_CP_CIRCLE_HSL
@ USER_CP_SQUARE_HS
@ USER_CP_SQUARE_HV
@ USER_CP_CIRCLE_HSV
@ USER_FLAG_RECENT_SEARCHES_DISABLE
@ USER_ADD_VIEWALIGNED
@ USER_TXT_TABSTOSPACES_DISABLE
@ USER_ADD_CURSORALIGNED
@ USER_RELEASECONFIRM
@ USER_RELPATHS
@ USER_TOOLTIPS
@ USER_INTERNET_ALLOW
@ USER_FILENOUI
@ USER_NONEGFRAMES
@ USER_MENU_CLOSE_LEAVE
@ USER_ADD_EDITMODE
@ USER_TRACKBALL
@ USER_FILECOMPRESS
@ USER_SCRIPT_AUTOEXEC_DISABLE
@ USER_NONUMPAD
@ USER_TOOLTIPS_PYTHON
@ USER_AUTOSAVE
@ USER_FLAG_NUMINPUT_ADVANCED
@ USER_CUSTOM_RANGE
@ USER_DEVELOPER_UI
@ USER_TWOBUTTONMOUSE
@ USER_MAT_ON_OB
@ STATUSBAR_SHOW_STATS
@ STATUSBAR_SHOW_MEMORY
@ STATUSBAR_SHOW_VRAM
@ STATUSBAR_SHOW_SCENE_DURATION
@ STATUSBAR_SHOW_VERSION
@ STATUSBAR_SHOW_EXTENSIONS_UPDATES
@ USER_ZOOM_SCALE
@ USER_ZOOM_CONTINUE
@ USER_ZOOM_DOLLY
@ USER_ANIM_HIGH_QUALITY_DRAWING
@ USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS
@ USER_ANIM_SHOW_CHANNEL_GROUP_COLORS
@ USER_REGION_OVERLAP
@ USER_ALWAYS_SHOW_NUMBER_ARROWS
@ NDOF_NAVIGATION_MODE_OBJECT
@ NDOF_NAVIGATION_MODE_FLY
@ USER_RENDER_DISPLAY_AREA
@ USER_RENDER_DISPLAY_NONE
@ USER_RENDER_DISPLAY_SCREEN
@ USER_RENDER_DISPLAY_WINDOW
@ USER_SPACEDATA_ADDONS_SHOW_ONLY_ENABLED
@ USER_SPACEDATA_INPUT_HIDE_UI_KEYCONFIG
@ USER_FILE_PREVIEW_NONE
@ USER_FILE_PREVIEW_CAMERA
@ USER_FILE_PREVIEW_SCREENSHOT
@ USER_FILE_PREVIEW_AUTO
@ NDOF_ROTX_INVERT_AXIS
@ NDOF_SHOW_GUIDE_ORBIT_AXIS
@ NDOF_LOCK_HORIZON
@ NDOF_PANX_INVERT_AXIS
@ NDOF_ORBIT_CENTER_AUTO
@ NDOF_PANY_INVERT_AXIS
@ NDOF_ROTY_INVERT_AXIS
@ NDOF_SHOW_GUIDE_ORBIT_CENTER
@ NDOF_SWAP_YZ_AXIS
@ NDOF_CAMERA_PAN_ZOOM
@ NDOF_ORBIT_CENTER_SELECTED
@ NDOF_FLY_HELICOPTER
@ NDOF_PANZ_INVERT_AXIS
@ NDOF_FLY_SPEED_AUTO
@ NDOF_ROTZ_INVERT_AXIS
@ USER_ANIM_KEY_CHANNEL_ROTATION_MODE
@ USER_ANIM_KEY_CHANNEL_SCALE
@ USER_ANIM_KEY_CHANNEL_ROTATION
@ USER_ANIM_KEY_CHANNEL_LOCATION
@ USER_ANIM_KEY_CHANNEL_CUSTOM_PROPERTIES
@ USER_PATHCMP_GLOB
@ USER_TEXT_HINTING_SLIGHT
@ USER_TEXT_HINTING_FULL
@ USER_TEXT_DISABLE_AA
@ USER_TEXT_HINTING_NONE
@ USER_TEXT_RENDER_SUBPIXELAA
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
@ USER_MINI_AXIS_TYPE_NONE
@ AUTOKEY_MODE_NORMAL
@ AUTOKEY_MODE_EDITKEYS
@ AUTOKEY_ON
@ ZOOM_FRAME_MODE_SECONDS
@ ZOOM_FRAME_MODE_KEYFRAMES
@ ZOOM_FRAME_MODE_KEEP_RANGE
@ USER_TIMECODE_SMPTE_FULL
@ USER_TIMECODE_SECONDS_ONLY
@ USER_TIMECODE_MINIMAL
@ USER_TIMECODE_MILLISECONDS
@ USER_TIMECODE_SMPTE_MSF
@ USER_SHADER_COMPILE_THREAD
@ USER_SHADER_COMPILE_SUBPROCESS
@ USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT
@ USER_TRACKPAD_SCROLL_DIR_TRADITIONAL
@ USER_TRACKPAD_SCROLL_DIR_NATURAL
@ USER_EXTENSION_REPO_FLAG_DISABLED
@ USER_EXTENSION_REPO_FLAG_USE_ACCESS_TOKEN
@ USER_EXTENSION_REPO_FLAG_USE_CUSTOM_DIRECTORY
@ USER_EXTENSION_REPO_FLAG_SYNC_ON_STARTUP
@ USER_EXTENSION_REPO_FLAG_NO_CACHE
@ USER_EXTENSION_REPO_FLAG_USE_REMOTE_URL
@ USER_TEXT_EDIT_AUTO_CLOSE
@ USER_SECTION_EXTENSIONS
@ USER_SECTION_EDITING
@ USER_SECTION_KEYMAP
@ USER_SECTION_THEME
@ USER_SECTION_DEVELOPER_TOOLS
@ USER_SECTION_ADDONS
@ USER_SECTION_EXPERIMENTAL
@ USER_SECTION_LIGHT
@ USER_SECTION_NAVIGATION
@ USER_SECTION_VIEWPORT
@ USER_SECTION_ANIMATION
@ USER_SECTION_INTERFACE
@ USER_SECTION_SAVE_LOAD
@ USER_SECTION_INPUT
@ USER_SECTION_FILE_PATHS
@ USER_SECTION_SYSTEM
@ USER_PREF_FLAG_SAVE
@ USER_GIZMO_DRAW
@ USER_XR_NAV_SNAP_TURN
@ USER_XR_NAV_INVERT_ROTATION
@ USER_TEMP_SPACE_DISPLAY_FULLSCREEN
@ USER_TEMP_SPACE_DISPLAY_WINDOW
@ USER_APP_HIDE_REGION_TOGGLE
@ USER_APP_LOCK_CORNER_SPLIT
@ USER_APP_LOCK_EDGE_RESIZE
void ED_reset_audio_device(bContext *C)
bool GPU_mem_stats_supported()
blender::Span< GPUDevice > GPU_platform_devices_list()
void GPU_samplers_update()
void MEM_CacheLimiter_set_maximum(size_t m)
Read Guarded memory(de)allocation.
ParameterFlag
Definition RNA_types.hh:544
@ PARM_RNAPTR
Definition RNA_types.hh:547
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ FUNC_USE_REPORTS
Definition RNA_types.hh:914
@ FUNC_NO_SELF
Definition RNA_types.hh:907
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:913
@ STRUCT_NO_DATABLOCK_IDPROPERTIES
Definition RNA_types.hh:970
int(*)(PointerRNA *ptr, void *data, bool *have_function) StructValidateFunc
Definition RNA_types.hh:985
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_STRING
Definition RNA_types.hh:165
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_COLLECTION
Definition RNA_types.hh:168
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:676
int(*)(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *list) StructCallbackFunc
Definition RNA_types.hh:986
void(*)(void *data) StructFreeFunc
Definition RNA_types.hh:990
@ PROP_UNIT_LENGTH
Definition RNA_types.hh:174
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:503
PropertyFlag
Definition RNA_types.hh:300
@ PROP_THICK_WRAP
Definition RNA_types.hh:423
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:407
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:456
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_ENUM_FLAG
Definition RNA_types.hh:404
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:430
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_REGISTER
Definition RNA_types.hh:411
@ PROP_SKIP_SAVE
Definition RNA_types.hh:344
@ PROP_HIDDEN
Definition RNA_types.hh:338
@ PROP_TIME
Definition RNA_types.hh:253
@ PROP_DIRECTION
Definition RNA_types.hh:262
@ PROP_PASSWORD
Definition RNA_types.hh:243
@ PROP_COLOR
Definition RNA_types.hh:260
@ PROP_PIXEL
Definition RNA_types.hh:248
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_DIRPATH
Definition RNA_types.hh:237
@ PROP_PERCENTAGE
Definition RNA_types.hh:250
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:272
@ PROP_UNSIGNED
Definition RNA_types.hh:249
@ PROP_FILEPATH
Definition RNA_types.hh:236
@ PROP_VELOCITY
Definition RNA_types.hh:263
#define C
Definition RandGen.cpp:29
void UI_reinit_font()
void UI_update_text_styles()
const uiStyle * UI_style_get()
#define NC_WINDOW
Definition WM_types.hh:375
#define ND_SPACE_INFO
Definition WM_types.hh:521
#define ND_SPACE_DOPESHEET
Definition WM_types.hh:533
#define ND_SPACE_ASSET_PARAMS
Definition WM_types.hh:525
#define NC_SCREEN
Definition WM_types.hh:377
#define NA_EDITED
Definition WM_types.hh:584
#define ND_SPACE_GRAPH
Definition WM_types.hh:532
#define NS_VIEW3D_GPU
Definition WM_types.hh:576
#define ND_SPACE_TEXT
Definition WM_types.hh:530
#define ND_SPACE_VIEW3D
Definition WM_types.hh:528
#define NC_SPACE
Definition WM_types.hh:392
#define U
BMesh const char void * data
long long int int64_t
constexpr int64_t size() const
Definition BLI_span.hh:252
#define offsetof(t, d)
void * MEM_mallocN(size_t len, const char *str)
Definition mallocn.cc:128
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
MINLINE size_t min_zz(size_t a, size_t b)
#define G(x, y, z)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
void clear_all_library(const bContext *C)
void set_approximate_size_limit(int64_t limit_in_bytes)
static struct PyModuleDef module
Definition python.cpp:796
const char * name
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
const PointerRNA PointerRNA_NULL
void * RNA_struct_blender_type_get(StructRNA *srna)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]
Definition rna_curve.cc:64
const EnumPropertyItem rna_enum_keyframe_handle_type_items[]
Definition rna_curve.cc:36
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
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 RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
void RNA_def_struct_flag(StructRNA *srna, int flag)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
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_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
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_def_property_int_default(PropertyRNA *prop, int value)
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_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
void RNA_def_property_enum_default_func(PropertyRNA *prop, const char *get_default)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[]
Definition rna_fcurve.cc:61
BlenderRNA BLENDER_RNA
void rna_userdef_is_dirty_update(Main *bmain, Scene *scene, PointerRNA *ptr)
void rna_userdef_is_dirty_update_impl()
static void rna_def_userdef_theme_common_anim(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_preference_gpu_backend_items[]
static void rna_def_userdef_script_directory_collection(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_userdef_theme_space_common(StructRNA *srna)
static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
static void rna_def_userdef_theme_regions_asset_shelf(BlenderRNA *brna)
static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
#define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE
const EnumPropertyItem rna_enum_preference_section_items[]
static void rna_def_userdef_edit(BlenderRNA *brna)
static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
static void rna_def_userdef_theme_strip_color(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_preference_gpu_preferred_device_items[]
static void rna_def_userdef_filepaths_asset_library(BlenderRNA *brna)
static void rna_def_userdef_extensions(BlenderRNA *brna)
static void rna_def_userdef_view(BlenderRNA *brna)
static void rna_def_userdef_theme_space_spreadsheet(BlenderRNA *brna)
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_userdef_studiolight(BlenderRNA *brna)
static void rna_def_userdef_addon_pref(BlenderRNA *brna)
static void rna_def_userdef_pathcompare(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
static const EnumPropertyItem rna_enum_userdef_viewport_aa_items[]
static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_main(StructRNA *srna)
static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_gpencil(StructRNA *srna)
static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
static void rna_def_userdef_extension_repos_collection(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_userdef_input(BlenderRNA *brna)
static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
static void rna_def_userdef_filepaths(BlenderRNA *brna)
static const EnumPropertyItem audio_device_items[]
#define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE
static void rna_def_userdef_autoexec_path_collection(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_userdef_theme_common_curves(BlenderRNA *brna)
static void rna_def_userdef_theme_regions_channels(BlenderRNA *brna)
static void rna_def_userdef_walk_navigation(BlenderRNA *brna)
static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
static void rna_def_userdef_script_directory(BlenderRNA *brna)
static void rna_def_userdef_themes(BlenderRNA *brna)
static void rna_def_userdef_theme_collection_color(BlenderRNA *brna)
static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
static void rna_def_userdef_xr_navigation(BlenderRNA *brna)
static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
static void rna_def_userdef_apps(BlenderRNA *brna)
static void rna_def_userdef_theme_space_gradient(BlenderRNA *brna)
static void rna_def_userdef_theme_space_topbar(BlenderRNA *brna)
static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
static void rna_def_userdef_solidlight(BlenderRNA *brna)
static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_userdef_theme_background_types_items[]
static const EnumPropertyItem rna_enum_preferences_extension_repo_source_type_items[]
static void rna_def_userdef_theme_ui_gradient(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_face(StructRNA *srna, const bool has_face_orientation)
static size_t max_memory_in_megabytes()
static void rna_def_userdef_studiolights(BlenderRNA *brna)
static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
static void rna_def_userdef_asset_library_collection(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_userdef_theme_space_generic(BlenderRNA *brna)
void RNA_def_userdef(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_key_insert_channels[]
static void rna_def_userdef_theme_regions_scrubbing(BlenderRNA *brna)
static void rna_def_userdef_dothemes(BlenderRNA *brna)
static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
static void rna_def_userdef_keymap(BlenderRNA *brna)
static void rna_def_userdef_theme_regions(BlenderRNA *brna)
static void rna_def_userdef_filepaths_extension_repo(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna, const bool has_vertex_active)
static void rna_def_userdef_system(BlenderRNA *brna)
const EnumPropertyItem rna_enum_navigation_mode_items[]
static void rna_def_userdef_experimental(BlenderRNA *brna)
static void rna_def_userdef_theme_regions_sidebars(BlenderRNA *brna)
static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
static int max_memory_in_megabytes_int()
static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_preferences_asset_import_method_items[]
static void rna_def_userdef_theme_ui(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_language_default_items[]
static void rna_def_userdef_addon(BlenderRNA *brna)
static void rna_def_userdef_theme_common(BlenderRNA *brna)
static void rna_def_userdef_theme_spaces_gradient(StructRNA *srna)
static const EnumPropertyItem rna_enum_studio_light_type_items[]
static void rna_def_userdef_theme_space_statusbar(BlenderRNA *brna)
#define FLT_MAX
Definition stdcycles.h:14
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
const char * description
Definition RNA_types.hh:663
uint32_t device_id
uint32_t vendor_id
void * next
Definition DNA_ID.h:417
void * first
ListBase wm
Definition BKE_main.hh:307
ListBase screens
Definition BKE_main.hh:292
ListBase objects
Definition BKE_main.hh:280
void invalidate()
Definition RNA_types.hh:110
void * data
Definition RNA_types.hh:53
float light_ambient[3]
char mouse_emulate_3_button_modifier
struct SolidLight light_param[4]
float ndof_deadzone
struct IDProperty * prop
char module[128]
char name[64]
uiFontStyle widget
i
Definition text_draw.cc:230
#define N_(msgid)
void WM_keyconfig_reload(bContext *C)
Definition wm.cc:406
void WM_main_add_notifier(uint type, void *reference)
void WM_file_autosave_init(wmWindowManager *wm)
Definition wm_files.cc:2394
PointerRNA * ptr
Definition wm_files.cc:4238
void WM_reinit_gizmomap_all(Main *bmain)
void WM_init_input_devices()
uint8_t flag
Definition wm_window.cc:145