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