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