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