1
1

Compare commits

...

70 Commits

Author SHA1 Message Date
Severin
000009f4d6 Use full region width for file path panels
The horizontal margin would shrink the text button, reducing space to
show file paths in. For file paths, larger buttons make sense though, so
remove the margin.
2019-01-04 21:42:51 +01:00
3e159e7a9b Move text editor load/save options to filepath RNA 2019-01-04 21:13:58 +01:00
Severin
8dc369da4a Cleanup: PEP 8 2019-01-04 20:18:09 +01:00
Severin
42ff84eca6 Merge branch 'master' into userpref_redesign 2019-01-04 19:53:16 +01:00
Severin
ca9c55d0ee If anim player is not custom, gray out path option 2019-01-03 22:16:04 +01:00
62392f76c9 Revert changes to RNA path of undo settings
Too many Add-ons use these settings, we shouldn't break them all after
beta release. RNA and UI structuring are a bit out-of-sync here now, but
that's an acceptable annoyance.

Also adds some slightly nicer grouping in the RNA file, and moves the
Weight Paint Range property to the View category to match the UI.
2019-01-02 22:52:51 +01:00
Severin
52a7ecac35 Merge branch 'master' into userpref_redesign 2019-01-02 20:28:44 +01:00
Severin
204ded594d Avoid empty panel bl_label
And remove unused operator execution context change.
2018-12-30 17:46:55 +01:00
5b868a8b26 Tiny layout improvements
* Moved Anisotropic Filter setting to the Textures panel (it’s a
  texture setting after all)
* Very minor change to Textures panel ordering
* Moved Text panel higher in the list - rather than being at the bottom
  it’s not below the Display panel which makes more sense
2018-12-30 16:39:59 +01:00
Severin
a421e57490 Merge branch 'master' into userpref_redesign 2018-12-30 15:54:25 +01:00
Severin
2822a74958 Fix invisible scrollbars in Preferences
Need to force correct updates of action-zone alphas for dynamically
sized regions.
2018-12-30 12:48:33 +01:00
Severin
0093f5b1ec Fix responsive Preference layout ignoring hiDPI 2018-12-29 19:18:39 +01:00
Severin
71b98a8769 Merge branch 'master' into userpref_redesign 2018-12-29 19:12:37 +01:00
Severin
f461ba611f Fix merge errors and whitespace cleanup 2018-12-29 18:41:10 +01:00
Severin
5420be42d3 Fix "Show Preferences" shortcut not working
Was broken in 2.7 keymap.

Also whitespace cleanup.
2018-12-29 16:51:53 +01:00
Severin
2e3fdeb54c Avoid panel content margins in small regions
Don't see a need for changes in the layout system here, a simple trick
like I've done here is sufficient.
Also: Some refactoring of the `PreferencePanel` class.
2018-12-29 16:38:55 +01:00
d75c410bf5 Another round of tweaks to new Preferences
- Removed doubled Cycles Compute Device text
 - Moved header placement into menus panel
 - Moved Text panel & rna to Interface
 - Moved OpenGL Texture panel inside OpenGL panel
 - Moved Color Picker Type to from System>Misc to Interface>Menus (eventually it'd be nice to include this option inside the color pickers themselves to make it more useful and discoverable)
 - Combined all memory-related preferences (Undo + Console Scrollback + Sequencer Cache) in a Memory panel in System section (avoids needing previous Misc panel)
 - Added correct greying out to Files > Auto Run Python Scripts panel
 - Added flow layout to Save & Load checkboxes
 - Rejiggered some of the Texture preferences to make more logical sense together
 - A few other minor adjustments
2018-12-29 14:18:17 +01:00
Julian Eisel
822aae0ff2 Merge branch 'master' into userpref_redesign 2018-12-29 13:36:10 +01:00
Julian Eisel
b789e5a82a Own left-bottom aligned region for Save Preference button
* Own region allows scrolling the navigation bar independently (Save
  Preference button stays visible).
* We may want to change background color and size, but I'll leave that
  for others to do.
* Region can be hidden but not scaled or scrolled.
* Bumps subversion.
* Added new execute region type which we may want to use in more places.
* Had to do some tweaks to drawing/layout code to get the dynamically
  sized region to work without glitches.
* Also correct navigation bar versioning code to use full area width for
  header.
2018-12-24 13:00:34 +01:00
Julian Eisel
ea282f4de0 Merge branch 'master' into userpref_redesign 2018-12-23 22:55:23 +01:00
Julian Eisel
2db613225d Merge branch 'master' into userpref_redesign 2018-12-23 18:13:09 +01:00
56a4e7cba0 More tweaks to Preferences
* Brighter navigation bar background to avoid conflicts with subpanel backgrounds
* Group together device input settings into one panel (with sub-panels)
* Group together view manipulation settings into one panel (with sub-panels)
* Move Save Preferences button back to header until own region for it is ready
2018-12-23 13:48:01 +01:00
Julian Eisel
6f6ad48c25 Merge branch 'master' into userpref_redesign 2018-12-23 12:38:43 +01:00
Julian Eisel
f7cbe35aec Merge branch 'blender2.8' into userpref_redesign 2018-12-21 00:25:56 +01:00
Julian Eisel
13b3869b5f Use term "Preferences" instead of "User Preferences" in the UI 2018-12-21 00:24:04 +01:00
b5d4bd8ac3 More small tweaks/fixes to new Preferences
* Fixed gap in Viewports panel
* Made all buttons to install things (Addons, Lights, Keymaps, Themes etc) use the same icon and use elipses (...) to communicate the fact that they open a dialog.
* Fixed own code error in Input > View panel
* Re-ordered panels in Input section - now related Mouse and Devices panels are next to each other
* Renamed User Preferences in the Editor list to just Preferences - consistent with Edit > Preferences
* Removed icon for auto-key toggle - doesn't fit here
2018-12-21 00:09:01 +01:00
Julian Eisel
0178cfa305 Hide Preferences header when opened in temporary window
Also, use full width of the area again for the header.
2018-12-20 02:11:41 +01:00
Julian Eisel
0b3603dcc1 Remove colons in Preferences section group names 2018-12-20 01:54:18 +01:00
Julian Eisel
dd6d1ac32c Shrink horizontal size of Preferences Window 2018-12-20 01:49:42 +01:00
e5b553a8b7 Various improvements to Preferences buttons/layouts
* Header is now fully redundant. Added buttons to add studio lights under the Lights category.
* Removed redundant theme category dropdown
* Made the theme layout use layout flow, so it goes to single column when narrow, but multiple columns as you make it wider
* Made all the themes layouts consistent and all use property split fit with the rest of 2.8
* Fix UI Scale property so it doesn't flicker, by making it a number value rather than a slider - it's more correct this way anyway
2018-12-20 01:41:53 +01:00
Julian Eisel
1571f18a89 Merge branch 'blender2.8' into userpref_redesign 2018-12-19 22:29:22 +01:00
Julian Eisel
3cfb9e0ec5 Merge branch 'blender2.8' into userpref_redesign 2018-12-19 12:52:09 +01:00
Julian Eisel
b61dfee18a Use subpanels for User Interface theme options
The widget color subpanels are dynamically generated.
2018-12-17 00:02:22 +01:00
Julian Eisel
7cf1f30a99 Initial panel & subpanel based layout for theme section
Panels/subpanels for the editor theming are dynamically generated from the RNA
API.
Widget theming doesn't use subpanels yet.
2018-12-16 22:09:15 +01:00
Julian Eisel
1b722f1ac8 Merge branch 'blender2.8' into userpref_redesign 2018-12-16 00:32:46 +01:00
Julian Eisel
e86d851fef Merge branch 'blender2.8' into userpref_redesign 2018-12-07 01:10:06 +01:00
Julian Eisel
6d6aad08d7 Split keymap settings from "Input" into separate section
Adds a new section "Keymap" and puts keymap settings into this.
2018-12-07 01:06:58 +01:00
c4bf66e542 Use panel layout in most Preferences sections
Also removes all buttons from the header (except editor switch) and puts
them into the corresponding sections.

Breaks the input section which will be fixed in a followup commit.
2018-12-06 23:19:00 +01:00
Julian Eisel
684f885e95 Panel based, single column layout for the editing category 2018-12-02 21:31:43 +01:00
Julian Eisel
90f8900146 Merge branch 'blender2.8' into userpref_redesign 2018-12-02 17:12:29 +01:00
Julian Eisel
9cd6ca299d Minor refactor of enum item grouping logic 2018-11-25 16:21:35 +01:00
Julian Eisel
a5b8a3bcfb Rename User Preferences to Settings in new menus 2018-11-25 15:33:58 +01:00
Julian Eisel
1f71fb7057 Bump subversion for adding navigation region correctly on file load 2018-11-25 14:59:18 +01:00
Julian Eisel
ba567f634a Merge branch 'blender2.8' into userpref_redesign 2018-11-25 14:45:23 +01:00
Julian Eisel
91e0dc0b8e Move File section into system group
And rename from "File" to "Files".
2018-11-24 02:32:27 +01:00
Julian Eisel
770f42fb86 Rename operator: "Save User Preferences" -> "Save Settings" 2018-11-24 01:40:15 +01:00
Julian Eisel
f091b0fad5 Move interface item back to top 2018-11-24 01:38:10 +01:00
Julian Eisel
cbe7ecb8bd Address review inline comments 2018-11-24 01:09:36 +01:00
Julian Eisel
183eab6eb7 Merge branch 'blender2.8' into userpref_redesign 2018-11-24 00:30:47 +01:00
Julian Eisel
96acf70159 Scale up layout & use icons for category groups
Icons were already prepared by @jendrzych. Thanks a lot!
2018-11-23 22:37:42 +01:00
Julian Eisel
9e6bfa4180 Update default theme for UserPref navigation bar
Uses a slightly darker grey than the main region. This color is used in
various other places too.
2018-11-23 01:12:35 +01:00
Julian Eisel
b59443d33f Use new navigation region type for UserPref navigation 2018-11-23 00:33:57 +01:00
Julian Eisel
a2b41f105c Fix merge conflicts
Used 'git stash' to stash a single file, which (for some reason) caused quite
some trouble. Should be fine again now.
2018-11-22 22:15:17 +01:00
Julian Eisel
37b62ac344 Merge branch 'blender2.8' into userpref_redesign 2018-11-22 19:35:03 +01:00
Julian Eisel
6a7e974a93 Merge branch 'blender2.8' into userpref_redesign 2018-11-22 19:06:52 +01:00
Julian Eisel
3f5f4f089d Merge branch 'blender2.8' into userpref_redesign 2018-04-09 11:22:38 +02:00
Julian Eisel
d532f76df7 Revert some rather experimental changes
* Revert name change of "Editing" section
* Comment out placeholder worskpace sections
* Leave all system settings in a singe section
2018-03-19 23:13:18 +01:00
Severin
07112ef2ed Merge branch 'blender2.8' into userpref_redesign 2018-03-19 19:44:57 +01:00
Severin
a2ce84c089 Get rid of uiLayout.prop group parameter
Just always use the grouping behavior, that should be fine. Also add colons to
the group title.
2018-03-19 01:49:10 +01:00
Severin
6b2907926e Address most minor points from review
* Increase size of settings window again (some sections are too squeezed).
* Use '...' suffix to indicate that menu entry opens new window.
* Stick to current naming convention for area/region variables.
* Simplify tooltip.
* Remove hyphen ("keymap", not "key-map")
2018-03-19 01:48:36 +01:00
Severin
5a5ac2b217 Merge branch 'blender2.8' into userpref_redesign 2018-03-18 23:45:30 +01:00
Julian Eisel
66a3142cfd Go back to old size of UserPref/Settings window
If we split up and reorganize sections a bit, the current window size should be
totally fine. Bringing it back for now.

Reverts rB93edc452920870b.
2018-02-28 17:52:27 +01:00
Julian Eisel
f064957e2e Merge branch 'blender2.8' into userpref_redesign 2018-02-27 23:49:07 +01:00
Julian Eisel
3e4c1209de Split up System section into General, Drawing and Devices 2018-02-27 23:39:07 +01:00
Julian Eisel
cef6fb72c8 Initial grouping/categorizing of settings sections
Made this to work just like we define categories in menus: a enum item with only
the UI-name set starts a new category with given name. Also added another
uiLayout.prop option "group", not sure if thats such a nice way to do it though.
Will check during review.
2018-02-27 20:08:10 +01:00
Julian Eisel
a9d146910b Add placeholder sections for workspaces
Adds
* "Worspace Configuration File",
* "Worspace Add-on Overrides",
* "Worspace Key-map Overrides"
sections to the Blender settings.
2018-02-27 14:37:25 +01:00
Julian Eisel
33dc1214b1 Rename "Editing" section to "General"
Also moved to be first item.
2018-02-26 23:37:27 +01:00
Julian Eisel
104af87614 Rename "User Preferences" to "Settings" in the UI 2018-02-26 23:18:03 +01:00
Julian Eisel
93edc45292 UI: Increase default size of User-Preferences window
Increased it by factor 1.28 (so we get a width of 1024px).
WM_window_open_temp will ensure the window fits into the screen, so didn't need to ensure that.
2018-02-23 11:02:34 +01:00
Julian Eisel
34743b1dfa UI: Move User-Preferences navigation tabs to a sidebar region
This is the first commit for a bigger User-Preferences redesign, see T54115.
2018-02-23 11:02:34 +01:00
25 changed files with 1729 additions and 1159 deletions

View File

@@ -1485,7 +1485,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
def draw_impl(self, layout, context):
available_device_types = self.get_device_types(context)
layout.label(text="Cycles Compute Device:")
if len(available_device_types) == 1:
layout.label(text="No compatible GPUs found", icon='INFO')
return

View File

@@ -821,7 +821,8 @@ const bTheme U_theme_default = {
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.navigation_bar = RGBA(0x373737ff),
.navigation_bar = RGBA(0x4b4b4bff),
.execution_buts = RGBA(0x4b4b4bff),
.panelcolors = {
.header = RGBA(0x42424200),
.back = RGBA(0x333333b3),

View File

@@ -572,7 +572,7 @@ def preset_find(name, preset_path, display_name=False, ext=".py"):
def keyconfig_init():
# Key configuration initialization and refresh, called from the Blender
# window manager on startup and refresh.
active_config = _preferences.inputs.active_keyconfig
active_config = _preferences.keymap.active_keyconfig
# Load the default key configuration.
default_filepath = preset_find("blender", "keyconfig")

View File

@@ -372,15 +372,24 @@ def draw_keymaps(context, layout):
subcol = subsplit.column()
col = subcol.column()
row = col.row(align=True)
# row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config")
text = bpy.path.display_name(kc_active.name)
if not text:
text = "Blender (default)"
row.menu("USERPREF_MT_keyconfigs", text=text)
row.operator("wm.keyconfig_preset_add", text="", icon='ADD')
row.operator("wm.keyconfig_preset_add", text="", icon='REMOVE').remove_active = True
row = col.row()
row.operator("wm.keyconfig_import", text="Import...", icon='IMPORT')
row.operator("wm.keyconfig_export", text="Export...", icon='EXPORT')
row.separator()
rowsub = row.row(align=True)
rowsub.menu("USERPREF_MT_keyconfigs", text=text)
rowsub.operator("wm.keyconfig_preset_add", text="", icon='ADD')
rowsub.operator("wm.keyconfig_preset_add", text="", icon='REMOVE').remove_active = True
# layout.context_pointer_set("keyconfig", wm.keyconfigs.active)
# row.operator("wm.keyconfig_remove", text="", icon='X')
@@ -413,14 +422,14 @@ def draw_keymaps(context, layout):
box = col.box()
row = box.row(align=True)
prefs = context.preferences
inputs = prefs.inputs
show_ui_keyconfig = inputs.show_ui_keyconfig
pref = context.preferences
keymappref = pref.keymap
show_ui_keyconfig = keymappref.show_ui_keyconfig
row.prop(
inputs,
keymappref,
"show_ui_keyconfig",
text="",
icon='TRIA_DOWN' if show_ui_keyconfig else 'TRIA_RIGHT',
icon='DISCLOSURE_TRI_DOWN' if show_ui_keyconfig else 'DISCLOSURE_TRI_RIGHT',
emboss=False,
)
row.label(text="Preferences")

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 280
#define BLENDER_SUBVERSION 39
#define BLENDER_SUBVERSION 40
/* Several breakages with 280, e.g. collections vs layers */
#define BLENDER_MINVERSION 280
#define BLENDER_MINSUBVERSION 0

View File

@@ -2382,12 +2382,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
ARegion *navigation_region = BKE_spacedata_find_region_type(slink, area, RGN_TYPE_NAV_BAR);
if (!navigation_region) {
ARegion *main_region = BKE_spacedata_find_region_type(slink, area, RGN_TYPE_WINDOW);
ListBase *regionbase = (slink == area->spacedata.first) ?
&area->regionbase : &slink->regionbase;
navigation_region = MEM_callocN(sizeof(ARegion), "userpref navigation-region do_versions");
BLI_addhead(regionbase, navigation_region); /* order matters, addhead not addtail! */
BLI_insertlinkbefore(regionbase, main_region, navigation_region); /* order matters, addhead not addtail! */
navigation_region->regiontype = RGN_TYPE_NAV_BAR;
navigation_region->alignment = RGN_ALIGN_LEFT;
}
@@ -2691,9 +2692,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
{
/* Versioning code until next subversion bump goes here. */
if (!MAIN_VERSION_ATLEAST(bmain, 280, 40)) {
if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "snap_transform_mode_flag")) {
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->toolsettings->snap_transform_mode_flag =
@@ -2748,5 +2747,34 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
ca->gpu_dof.ratio = 0.01f;
}
}
for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_USERPREF) {
ARegion *execute_region = BKE_spacedata_find_region_type(sl, area, RGN_TYPE_EXECUTE);
if (!execute_region) {
ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
ARegion *ar_navbar = BKE_spacedata_find_region_type(sl, area, RGN_TYPE_NAV_BAR);
execute_region = MEM_callocN(sizeof(ARegion), "execute region for properties");
BLI_assert(ar_navbar);
BLI_insertlinkafter(regionbase, ar_navbar, execute_region);
execute_region->regiontype = RGN_TYPE_EXECUTE;
execute_region->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
execute_region->flag |= RGN_FLAG_DYNAMIC_SIZE;
}
}
}
}
}
}
{
/* Versioning code until next subversion bump goes here. */
}
}

View File

@@ -106,6 +106,11 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme)
copy_v4_v4_char(btheme->tclip.metadatabg, U_theme_default.tima.metadatabg);
copy_v4_v4_char(btheme->tclip.metadatatext, U_theme_default.tima.metadatatext);
}
if (!USER_VERSION_ATLEAST(280, 40)) {
copy_v4_v4_char(btheme->tuserpref.execution_buts, btheme->tuserpref.navigation_bar);
}
#undef USER_VERSION_ATLEAST
}

View File

@@ -143,7 +143,7 @@ void ED_area_tag_redraw_no_rebuild(ScrArea *sa);
void ED_area_tag_redraw_regiontype(ScrArea *sa, int type);
void ED_area_tag_refresh(ScrArea *sa);
void ED_area_do_refresh(struct bContext *C, ScrArea *sa);
void ED_area_azones_update(ScrArea *sa, const int mouse_xy[]);
struct AZone *ED_area_azones_update(ScrArea *sa, const int mouse_xy[]);
void ED_area_status_text(ScrArea *sa, const char *str);
void ED_area_newspace(struct bContext *C, ScrArea *sa, int type, const bool skip_ar_exit);
void ED_area_prevspace(struct bContext *C, ScrArea *sa);

View File

@@ -658,7 +658,6 @@ static void ui_item_enum_expand_exec(
uiLayout *layout_radial = NULL;
const EnumPropertyItem *item, *item_array;
const char *name;
char group_name[UI_MAX_NAME_STR];
int itemw, icon, value;
bool free;
bool radial = (layout->root->type == UI_LAYOUT_PIEMENU);
@@ -703,8 +702,7 @@ static void ui_item_enum_expand_exec(
if (!is_first) {
uiItemS(block->curlayout);
}
BLI_snprintf(group_name, sizeof(group_name), "%s:", item->name);
uiItemL(block->curlayout, group_name, item->icon);
uiItemL(block->curlayout, item->name, item->icon);
}
else if (radial && layout_radial) {
uiItemS(layout_radial);

View File

@@ -1345,7 +1345,7 @@ static int edittranslation_exec(bContext *C, wmOperator *op)
if (!BLI_is_dir(root)) {
BKE_report(
op->reports, RPT_ERROR,
"Please set your User Preferences' 'Translation Branches "
"Please set your Preferences' 'Translation Branches "
"Directory' path to a valid directory");
return OPERATOR_CANCELLED;
}

View File

@@ -147,7 +147,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar)
return BUT_VERTICAL;
else if (sa->spacetype == SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW)
return BUT_VERTICAL;
else if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS, RGN_TYPE_HUD, RGN_TYPE_NAV_BAR))
else if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS, RGN_TYPE_HUD, RGN_TYPE_NAV_BAR, RGN_TYPE_EXECUTE))
return BUT_VERTICAL;
return 0;

View File

@@ -183,6 +183,8 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
cp = ts->header;
else if (theme_regionid == RGN_TYPE_NAV_BAR)
cp = ts->navigation_bar;
else if (theme_regionid == RGN_TYPE_EXECUTE)
cp = ts->execution_buts;
else
cp = ts->button;

View File

@@ -186,52 +186,6 @@ void ED_area_do_refresh(bContext *C, ScrArea *sa)
sa->do_refresh = false;
}
/**
* Action zones are only updated if the mouse is inside of them, but in some cases (currently only fullscreen icon)
* it might be needed to update their properties and redraw if the mouse isn't inside.
*/
void ED_area_azones_update(ScrArea *sa, const int mouse_xy[2])
{
AZone *az;
bool changed = false;
for (az = sa->actionzones.first; az; az = az->next) {
if (az->type == AZONE_FULLSCREEN) {
/* only if mouse is not hovering the azone */
if (BLI_rcti_isect_pt_v(&az->rect, mouse_xy) == false) {
az->alpha = 0.0f;
changed = true;
/* can break since currently only this is handled here */
break;
}
}
else if (az->type == AZONE_REGION_SCROLL) {
/* only if mouse is not hovering the azone */
if (BLI_rcti_isect_pt_v(&az->rect, mouse_xy) == false) {
View2D *v2d = &az->ar->v2d;
if (az->direction == AZ_SCROLL_VERT) {
az->alpha = v2d->alpha_vert = 0;
changed = true;
}
else if (az->direction == AZ_SCROLL_HOR) {
az->alpha = v2d->alpha_hor = 0;
changed = true;
}
else {
BLI_assert(0);
}
}
}
}
if (changed) {
sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE;
ED_area_tag_redraw_no_rebuild(sa);
}
}
/**
* \brief Corner widget use for quitting fullscreen.
*/
@@ -412,18 +366,11 @@ static void region_draw_azones(ScrArea *sa, ARegion *ar)
}
else if (az->type == AZONE_FULLSCREEN) {
area_draw_azone_fullscreen(az->x1, az->y1, az->x2, az->y2, az->alpha);
if (az->alpha != 0.0f) {
area_azone_tag_update(sa);
}
}
else if (az->type == AZONE_REGION_SCROLL) {
if (az->alpha != 0.0f) {
area_azone_tag_update(sa);
}
/* Don't draw this azone. */
}
}
if (!IS_EQF(az->alpha, 0.0f) && ELEM(az->type, AZONE_FULLSCREEN, AZONE_REGION_SCROLL)) {
area_azone_tag_update(sa);
}
}
GPU_matrix_pop();
@@ -1605,6 +1552,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
if (!(area->flag & AREA_FLAG_REGION_SIZE_UPDATE)) {
return;
}
const bScreen *screen = WM_window_get_active_screen(win);
WM_window_rect_calc(win, &window_rect);
area_calc_totrct(area, &window_rect);
@@ -1614,6 +1562,9 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
overlap_rect = rect;
region_rect_recursive(area, area->regionbase.first, &rect, &overlap_rect, 0);
/* Dynamically sized regions may have changed region sizes, so we have to force azone update. */
area_azone_initialize(win, screen, area);
for (ARegion *ar = area->regionbase.first; ar; ar = ar->next) {
region_subwindow(ar);
@@ -1621,7 +1572,11 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
if (ar->type->init) {
ar->type->init(wm, ar);
}
/* Some AZones use View2D data which is only updated in region init, so call that first! */
region_azones_add(screen, area, ar, ar->alignment & ~RGN_SPLIT_PREV);
}
ED_area_azones_update(area, &win->eventstate->x);
area->flag &= ~AREA_FLAG_REGION_SIZE_UPDATE;
}
@@ -2386,6 +2341,9 @@ void ED_region_panels_draw(const bContext *C, ARegion *ar)
/* set the view */
UI_view2d_view_ortho(v2d);
/* View2D matrix might have changed due to dynamic sized regions. */
UI_blocklist_update_window_matrix(C, &ar->uiblocks);
/* draw panels */
UI_panels_draw(C, ar);

View File

@@ -639,7 +639,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
ED_screen_areas_iter(win, scr, area_iter) {
if (xy[0] > area_iter->totrct.xmin && xy[0] < area_iter->totrct.xmax) {
if (xy[1] > area_iter->totrct.ymin && xy[1] < area_iter->totrct.ymax) {
if (ED_area_actionzone_refresh_xy(area_iter, xy) == NULL) {
if (ED_area_azones_update(area_iter, xy) == NULL) {
sa = area_iter;
break;
}
@@ -1251,7 +1251,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
for (ar = newa->regionbase.first; ar; ar = ar->next) {
ar->flagfullscreen = ar->flag;
if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS, RGN_TYPE_NAV_BAR)) {
if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS, RGN_TYPE_NAV_BAR, RGN_TYPE_EXECUTE)) {
ar->flag |= RGN_FLAG_HIDDEN;
}
}

View File

@@ -57,7 +57,6 @@ int screen_area_join(struct bContext *C, bScreen *scr, ScrArea *sa1, Scr
int area_getorientation(ScrArea *sa, ScrArea *sb);
struct AZone *ED_area_actionzone_find_xy(ScrArea *sa, const int xy[2]);
struct AZone *ED_area_actionzone_refresh_xy(ScrArea *sa, const int xy[2]);
/* screen_geometry.c */
int screen_geom_area_height(const ScrArea *area);

View File

@@ -798,6 +798,32 @@ static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const boo
}
}
}
else if (!test_only && !IS_EQF(az->alpha, 0.0f)) {
bool changed = false;
if (az->type == AZONE_FULLSCREEN) {
az->alpha = 0.0f;
changed = true;
}
else if (az->type == AZONE_REGION_SCROLL) {
if (az->direction == AZ_SCROLL_VERT) {
az->alpha = az->ar->v2d.alpha_vert = 0;
changed = true;
}
else if (az->direction == AZ_SCROLL_HOR) {
az->alpha = az->ar->v2d.alpha_hor = 0;
changed = true;
}
else {
BLI_assert(0);
}
}
if (changed) {
sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE;
ED_area_tag_redraw_no_rebuild(sa);
}
}
}
return az;
@@ -808,7 +834,7 @@ AZone *ED_area_actionzone_find_xy(ScrArea *sa, const int xy[2])
return area_actionzone_refresh_xy(sa, xy, true);
}
AZone *ED_area_actionzone_refresh_xy(ScrArea *sa, const int xy[2])
AZone *ED_area_azones_update(ScrArea *sa, const int xy[2])
{
return area_actionzone_refresh_xy(sa, xy, false);
}
@@ -2382,8 +2408,12 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (!(rmd->ar->flag & RGN_FLAG_HIDDEN))
region_scale_toggle_hidden(C, rmd);
}
else if (rmd->ar->flag & RGN_FLAG_HIDDEN)
else if (rmd->ar->flag & RGN_FLAG_HIDDEN) {
region_scale_toggle_hidden(C, rmd);
}
else if (rmd->ar->flag & RGN_FLAG_DYNAMIC_SIZE) {
rmd->ar->sizex = rmd->origval;
}
}
else {
int maxsize = region_scale_get_maxsize(rmd);
@@ -2411,10 +2441,15 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (!(rmd->ar->flag & RGN_FLAG_HIDDEN))
region_scale_toggle_hidden(C, rmd);
}
else if (maxsize > 0 && (rmd->ar->sizey > maxsize))
else if (maxsize > 0 && (rmd->ar->sizey > maxsize)) {
rmd->ar->sizey = maxsize;
else if (rmd->ar->flag & RGN_FLAG_HIDDEN)
}
else if (rmd->ar->flag & RGN_FLAG_HIDDEN) {
region_scale_toggle_hidden(C, rmd);
}
else if (rmd->ar->flag & RGN_FLAG_DYNAMIC_SIZE) {
rmd->ar->sizey = rmd->origval;
}
}
ED_area_tag_redraw(rmd->sa);
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
@@ -4349,11 +4384,15 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot)
static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
int sizex = (800 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
int sizey = 500 * UI_DPI_FAC;
int sizex = (500 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
int sizey = 520 * UI_DPI_FAC;
/* changes context! */
if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) {
/* The header only contains the editor switcher and looks empty. So hiding in the temp window makes sense. */
ScrArea *area = CTX_wm_area(C);
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
region->flag |= RGN_FLAG_HIDDEN;
return OPERATOR_FINISHED;
}
else {

View File

@@ -61,13 +61,6 @@ static SpaceLink *userpref_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
spref = MEM_callocN(sizeof(SpaceUserPref), "inituserpref");
spref->spacetype = SPACE_USERPREF;
/* navigation region */
ar = MEM_callocN(sizeof(ARegion), "navigation region for userpref");
BLI_addtail(&spref->regionbase, ar);
ar->regiontype = RGN_TYPE_NAV_BAR;
ar->alignment = RGN_ALIGN_LEFT;
/* header */
ar = MEM_callocN(sizeof(ARegion), "header for userpref");
@@ -76,6 +69,21 @@ static SpaceLink *userpref_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
/* Ignore user preference "USER_HEADER_BOTTOM" here (always show bottom for new types). */
ar->alignment = RGN_ALIGN_BOTTOM;
/* navigation region */
ar = MEM_callocN(sizeof(ARegion), "navigation region for userpref");
BLI_addtail(&spref->regionbase, ar);
ar->regiontype = RGN_TYPE_NAV_BAR;
ar->alignment = RGN_ALIGN_LEFT;
/* execution region */
ar = MEM_callocN(sizeof(ARegion), "execution region for userpref");
BLI_addtail(&spref->regionbase, ar);
ar->regiontype = RGN_TYPE_EXECUTE;
ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
ar->flag |= RGN_FLAG_DYNAMIC_SIZE;
/* main region */
ar = MEM_callocN(sizeof(ARegion), "main region for userpref");
@@ -159,6 +167,13 @@ static void userpref_navigation_region_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar);
}
/* add handlers, stuff you only do once or on area/region changes */
static void userpref_execute_region_init(wmWindowManager *wm, ARegion *ar)
{
ED_region_panels_init(wm, ar);
ar->v2d.keepzoom |= V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y;
}
static void userpref_main_region_listener(
wmWindow *UNUSED(win), ScrArea *UNUSED(sa), ARegion *UNUSED(ar),
wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene))
@@ -186,6 +201,13 @@ static void userpref_navigation_region_listener(
/* context changes */
}
static void userpref_execute_region_listener(
wmWindow *UNUSED(win), ScrArea *UNUSED(sa), ARegion *UNUSED(ar),
wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene))
{
/* context changes */
}
/* only called once, from space/spacetypes.c */
void ED_spacetype_userpref(void)
{
@@ -234,6 +256,17 @@ void ED_spacetype_userpref(void)
BLI_addhead(&st->regiontypes, art);
/* regions: execution window */
art = MEM_callocN(sizeof(ARegionType), "spacetype userpref region");
art->regionid = RGN_TYPE_EXECUTE;
art->init = userpref_execute_region_init;
art->layout = ED_region_panels_layout;
art->draw = ED_region_panels_draw;
art->listener = userpref_execute_region_listener;
art->keymapflag = ED_KEYMAP_UI;
BLI_addhead(&st->regiontypes, art);
BKE_spacetype_register(st);
}

View File

@@ -476,6 +476,8 @@ enum {
RGN_TYPE_HUD = 8,
/* Region to navigate the main region from (RGN_TYPE_WINDOW). */
RGN_TYPE_NAV_BAR = 9,
/* A place for buttons to trigger execution of somthing that was set up in other regions. */
RGN_TYPE_EXECUTE = 10,
};
/* use for function args */
#define RGN_TYPE_ANY -1

View File

@@ -236,7 +236,7 @@ typedef struct ThemeSpace {
/* navigation bar regions */
char navigation_bar[4]; /* region background */
int pad2;
char execution_buts[4]; /* region background */
/* float panel */
/* char panel[4]; unused */
@@ -687,14 +687,15 @@ typedef enum eUserPref_Section {
USER_SECTION_INPUT = 5,
USER_SECTION_ADDONS = 6,
USER_SECTION_LIGHT = 7,
USER_SECTION_KEYMAP = 8,
#ifdef WITH_USERDEF_WORKSPACES
USER_SECTION_WORKSPACE_CONFIG = 8,
USER_SECTION_WORKSPACE_ADDONS = 9,
USER_SECTION_WORKSPACE_KEYMAPS = 10,
USER_SECTION_WORKSPACE_CONFIG = 9,
USER_SECTION_WORKSPACE_ADDONS = 10,
USER_SECTION_WORKSPACE_KEYMAPS = 11,
#endif
#ifdef WITH_USERDEF_SYSTEM_SPLIT
USER_SECTION_SYSTEM_DISPLAY = 11,
USER_SECTION_SYSTEM_DEVICES = 12,
USER_SECTION_SYSTEM_DISPLAY = 12,
USER_SECTION_SYSTEM_DEVICES = 13,
#endif
} eUserPref_Section;

View File

@@ -712,6 +712,7 @@ extern StructRNA RNA_Preferences;
extern StructRNA RNA_PreferencesEdit;
extern StructRNA RNA_PreferencesFilePaths;
extern StructRNA RNA_PreferencesInput;
extern StructRNA RNA_PreferencesKeymap;
extern StructRNA RNA_PreferencesSystem;
extern StructRNA RNA_PreferencesView;
extern StructRNA RNA_PreferencesWalkNavigation;

View File

@@ -47,6 +47,7 @@ const EnumPropertyItem rna_enum_region_type_items[] = {
{RGN_TYPE_TOOL_PROPS, "TOOL_PROPS", 0, "Tool Properties", ""},
{RGN_TYPE_PREVIEW, "PREVIEW", 0, "Preview", ""},
{RGN_TYPE_NAV_BAR, "NAVIGATION_BAR", 0, "Navigation Bar", ""},
{RGN_TYPE_EXECUTE, "EXECUTE", 0, "Execute Buttons", ""},
{0, NULL, 0, NULL, NULL}
};

View File

@@ -4735,7 +4735,7 @@ static void rna_def_space_userpref(BlenderRNA *brna)
srna = RNA_def_struct(brna, "SpacePreferences", "Space");
RNA_def_struct_sdna(srna, "SpaceUserPref");
RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
RNA_def_struct_ui_text(srna, "Space Preferences", "Blender preferences space data");
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filter_type");

View File

@@ -298,6 +298,11 @@ static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_PreferencesInput, ptr->data);
}
static PointerRNA rna_UserDef_keymap_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_PreferencesKeymap, ptr->data);
}
static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_PreferencesFilePaths, ptr->data);
@@ -1369,6 +1374,11 @@ static void rna_def_userdef_theme_space_common(StructRNA *srna)
RNA_def_property_ui_text(prop, "Navigation Bar Background", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "execution_buts", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Execution Region Background", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* tabs */
prop = RNA_def_property(srna, "tab_active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
@@ -2084,7 +2094,7 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ThemePreferences", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
RNA_def_struct_ui_text(srna, "Theme Preferences", "Theme settings for the Blender Preferences");
rna_def_userdef_theme_spaces_main(srna);
}
@@ -3656,6 +3666,17 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem color_picker_types[] = {
{USER_CP_CIRCLE_HSV, "CIRCLE_HSV", 0, "Circle (HSV)", "A circular Hue/Saturation color wheel, with "
"Value slider"},
{USER_CP_CIRCLE_HSL, "CIRCLE_HSL", 0, "Circle (HSL)", "A circular Hue/Saturation color wheel, with "
"Lightness slider"},
{USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
{USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
{USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem zoom_frame_modes[] = {
{ZOOM_FRAME_MODE_KEEP_RANGE, "KEEP_RANGE", 0, "Keep Range", ""},
{ZOOM_FRAME_MODE_SECONDS, "SECONDS", 0, "Seconds", ""},
@@ -3680,7 +3701,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
/* View */
prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_FACTOR);
prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "UI Scale", "Changes the size of the fonts and buttons in the interface");
RNA_def_property_range(prop, 0.25f, 4.0f);
RNA_def_property_ui_range(prop, 0.5f, 2.0f, 1, 2);
@@ -3734,6 +3755,23 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"Show the frames per second screen refresh rate, while animation is played back");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* Weight Paint */
prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
RNA_def_property_ui_text(prop, "Use Weight Color Range",
"Enable color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
prop = RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Weight Color Range",
"Color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
/* app flags (use for app-templates) */
prop = RNA_def_property(srna, "show_layout_ui", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_LOCK_UI_LAYOUT);
@@ -3758,6 +3796,12 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay",
"Time delay in 1/10 seconds before automatically opening sub level menus");
prop = RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, color_picker_types);
RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* pie menus */
prop = RNA_def_property(srna, "pie_initial_timeout", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
@@ -3822,44 +3866,13 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Header Position", "Default header position for new space-types");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_NAVIGATE);
RNA_def_property_ui_text(prop, "Auto Depth",
"Use the depth under the mouse to improve view pan/rotate/zoom functionality");
prop = RNA_def_property(srna, "use_mouse_depth_cursor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_CURSOR);
RNA_def_property_ui_text(prop, "Cursor Surface Project",
"Use the surface depth for cursor placement");
prop = RNA_def_property(srna, "use_cursor_lock_adjust", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCK_CURSOR_ADJUST);
RNA_def_property_ui_text(prop, "Cursor Lock Adjust",
"Place the cursor without 'jumping' to the new location (when lock-to-cursor is used)");
prop = RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
RNA_def_property_ui_text(prop, "Camera Parent Lock",
"When the camera is locked to the view and in fly mode, "
"transform the parent rather than the camera");
/* view zoom */
prop = RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
RNA_def_property_ui_text(prop, "Zoom To Mouse Position",
"Zoom in towards the mouse pointer's position in the 3D view, "
"rather than the 2D window center");
/* view rotation */
prop = RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
RNA_def_property_ui_text(prop, "Auto Perspective",
"Automatically switch between orthographic and perspective when changing "
"from top/front/side views");
prop = RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
static const EnumPropertyItem text_hinting_items[] = {
{0, "AUTO", 0, "Auto", ""},
{USER_TEXT_HINTING_NONE, "NONE", 0, "None", ""},
{USER_TEXT_HINTING_SLIGHT, "SLIGHT", 0, "Slight", ""},
{USER_TEXT_HINTING_FULL, "FULL", 0, "Full", ""},
{0, NULL, 0, NULL, NULL}
};
/* mini axis */
static const EnumPropertyItem mini_axis_type_items[] = {
@@ -3948,6 +3961,64 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Zoom Seconds",
"Seconds around cursor that we zoom around");
/* Text. */
prop = RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
RNA_def_property_update(prop, 0, "rna_userdef_text_update");
prop = RNA_def_property(srna, "text_hinting", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "text_render");
RNA_def_property_enum_items(prop, text_hinting_items);
RNA_def_property_ui_text(prop, "Text Hinting", "Method for making user interface text render sharp");
RNA_def_property_update(prop, 0, "rna_userdef_text_update");
prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui");
RNA_def_property_ui_text(prop, "Interface Font", "Path to interface font");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop = RNA_def_property(srna, "font_path_ui_mono", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui_mono");
RNA_def_property_ui_text(prop, "Mono-space Font", "Path to interface mono-space Font");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
/* Language. */
prop = RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
RNA_def_property_ui_text(prop, "Translate UI", "Enable UI translation and use international fonts");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_language_default_items);
#ifdef WITH_INTERNATIONAL
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_lang_enum_properties_itemf");
#endif
RNA_def_property_ui_text(prop, "Language", "Language used for translation");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop = RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
RNA_def_property_ui_text(prop, "Translate Tooltips",
"Translate the descriptions when hovering UI elements (recommended)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE);
RNA_def_property_ui_text(prop, "Translate Interface",
"Translate all labels in menus, buttons and panels "
"(note that this might make it hard to follow tutorials or the manual)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_translate_new_dataname", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_NEWDATANAME);
RNA_def_property_ui_text(prop, "Translate New Names",
"Translate the names of new data-blocks (objects, materials...)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
static void rna_def_userdef_edit(BlenderRNA *brna)
@@ -4011,8 +4082,8 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
"When entering numbers while transforming, "
"default to advanced mode for full math expression evaluation");
/* Undo */
prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "undosteps");
RNA_def_property_range(prop, 0, 256);
@@ -4030,13 +4101,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
"Global undo works by keeping a full copy of the file itself in memory, "
"so takes extra memory");
/* auto keyframing */
prop = RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
RNA_def_property_ui_text(prop, "Auto Keying Enable",
"Automatic keyframe insertion for Objects and Bones "
"(default setting used for new Scenes)");
RNA_def_property_ui_icon(prop, ICON_REC, 0);
prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, auto_key_modes);
@@ -4258,15 +4329,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem color_picker_types[] = {
{USER_CP_CIRCLE_HSV, "CIRCLE_HSV", 0, "Circle (HSV)", "A circular Hue/Saturation color wheel, with Value slider"},
{USER_CP_CIRCLE_HSL, "CIRCLE_HSL", 0, "Circle (HSL)", "A circular Hue/Saturation color wheel, with Lightness slider"},
{USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
{USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
{USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem multi_sample_levels[] = {
{USER_MULTISAMPLE_NONE, "NONE", 0, "No MultiSample", "Do not use OpenGL MultiSample"},
{USER_MULTISAMPLE_2, "2", 0, "MultiSample: 2", "Use 2x OpenGL MultiSample (requires restart)"},
@@ -4290,14 +4352,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem text_hinting_items[] = {
{0, "AUTO", 0, "Auto", ""},
{USER_TEXT_HINTING_NONE, "NONE", 0, "None", ""},
{USER_TEXT_HINTING_SLIGHT, "SLIGHT", 0, "Slight", ""},
{USER_TEXT_HINTING_FULL, "FULL", 0, "Full", ""},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "PreferencesSystem", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "Preferences");
@@ -4328,63 +4382,57 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_sdna(prop, NULL, "pixelsize");
prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui");
RNA_def_property_ui_text(prop, "Interface Font", "Path to interface font");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop = RNA_def_property(srna, "font_path_ui_mono", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui_mono");
RNA_def_property_ui_text(prop, "Mono-space Font", "Path to interface mono-space Font");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
/* Memory */
prop = RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 500, 1, -1);
RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback (sequencer only)");
prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
RNA_def_property_range(prop, 0, max_memory_in_megabytes_int());
RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit (in megabytes)");
RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
prop = RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "scrollback");
RNA_def_property_range(prop, 32, 32768);
RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "author");
RNA_def_property_string_maxlength(prop, 80);
RNA_def_property_ui_text(prop, "Author",
"Name that will be used in exported files when format supports such feature");
/* OpenGL */
/* Language. */
/* Full scene anti-aliasing */
prop = RNA_def_property(srna, "multi_sample", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "ogl_multisamples");
RNA_def_property_enum_items(prop, multi_sample_levels);
RNA_def_property_ui_text(prop, "MultiSample",
"Enable OpenGL multi-sampling, only for systems that support it, requires restart");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
prop = RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
RNA_def_property_ui_text(prop, "Translate UI", "Enable UI translation and use international fonts");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
/* grease pencil anti-aliasing */
prop = RNA_def_property(srna, "gpencil_multi_sample", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_multisamples");
RNA_def_property_enum_items(prop, multi_sample_levels);
RNA_def_property_ui_text(prop, "Gpencil MultiSample",
"Enable Grease Pencil OpenGL multi-sampling, only for systems that support it");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_language_default_items);
#ifdef WITH_INTERNATIONAL
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_lang_enum_properties_itemf");
#endif
RNA_def_property_ui_text(prop, "Language", "Language used for translation");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop = RNA_def_property(srna, "use_region_overlap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_REGION_OVERLAP);
RNA_def_property_ui_text(prop, "Region Overlap",
"Draw tool/property regions over the main region, when using Triple Buffer");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
prop = RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
RNA_def_property_ui_text(prop, "Translate Tooltips",
"Translate the descriptions when hovering UI elements (recommended)");
prop = RNA_def_property(srna, "gpu_viewport_quality", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gpu_viewport_quality");
RNA_def_property_float_default(prop, 0.6f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Viewport Quality", "Quality setting for Solid mode rendering in the 3d viewport");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE);
RNA_def_property_ui_text(prop, "Translate Interface",
"Translate all labels in menus, buttons and panels "
"(note that this might make it hard to follow tutorials or the manual)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_translate_new_dataname", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_NEWDATANAME);
RNA_def_property_ui_text(prop, "Translate New Names",
"Translate the names of new data-blocks (objects, materials...)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* System & OpenGL */
prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "light_param", "");
RNA_def_property_struct_type(prop, "UserSolidLight");
@@ -4402,56 +4450,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
"View the result of the studio light editor in the viewport");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
RNA_def_property_ui_text(prop, "Use Weight Color Range",
"Enable color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
prop = RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Weight Color Range",
"Color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
prop = RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, color_picker_types);
RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
"Allow any .blend file to run scripts automatically "
"(unsafe with blend files from an untrusted source)");
RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
RNA_def_property_ui_text(prop, "Tabs as Spaces",
"Automatically convert all new tabs into spaces for new and loaded text files");
prop = RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 500, 1, -1);
RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback (sequencer only)");
prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
RNA_def_property_range(prop, 0, max_memory_in_megabytes_int());
RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit (in megabytes)");
RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
prop = RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* Textures */
prop = RNA_def_property(srna, "use_16bit_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_16bit_textures", 1);
RNA_def_property_ui_text(prop, "16 Bit Float Textures", "Use 16 bit per component texture for float images");
@@ -4465,7 +4471,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop = RNA_def_property(srna, "image_draw_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_draw_methods);
RNA_def_property_enum_sdna(prop, NULL, "image_draw_method");
RNA_def_property_ui_text(prop, "Image Draw Method", "Method used for displaying images on the screen");
RNA_def_property_ui_text(prop, "Image Display Method", "Method used for displaying images on the screen");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
@@ -4496,6 +4502,20 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Texture Collection Rate",
"Number of seconds between each run of the GL texture garbage collector");
/* Select */
prop = RNA_def_property(srna, "select_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "gpu_select_method");
RNA_def_property_enum_items(prop, gpu_select_method_items);
RNA_def_property_ui_text(prop, "Selection Method",
"Use OpenGL occlusion queries or selection render mode to accelerate selection");
prop = RNA_def_property(srna, "use_select_pick_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gpu_select_pick_deph", 1);
RNA_def_property_ui_text(prop, "OpenGL Depth Picking", "Use the depth buffer for picking 3D View selection");
/* Audio */
prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
RNA_def_property_enum_items(prop, audio_mixing_samples_items);
@@ -4527,56 +4547,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
prop = RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
RNA_def_property_update(prop, 0, "rna_userdef_text_update");
prop = RNA_def_property(srna, "text_hinting", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "text_render");
RNA_def_property_enum_items(prop, text_hinting_items);
RNA_def_property_ui_text(prop, "Text Hinting", "Method for making user interface text render sharp");
RNA_def_property_update(prop, 0, "rna_userdef_text_update");
prop = RNA_def_property(srna, "select_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "gpu_select_method");
RNA_def_property_enum_items(prop, gpu_select_method_items);
RNA_def_property_ui_text(prop, "Selection Method",
"Use OpenGL occlusion queries or selection render mode to accelerate selection");
prop = RNA_def_property(srna, "use_select_pick_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gpu_select_pick_deph", 1);
RNA_def_property_ui_text(prop, "OpenGL Depth Picking", "Use the depth buffer for picking 3D View selection");
/* Full scene anti-aliasing */
prop = RNA_def_property(srna, "multi_sample", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "ogl_multisamples");
RNA_def_property_enum_items(prop, multi_sample_levels);
RNA_def_property_ui_text(prop, "MultiSample",
"Enable OpenGL multi-sampling, only for systems that support it, requires restart");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
/* grease pencil anti-aliasing */
prop = RNA_def_property(srna, "gpencil_multi_sample", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_multisamples");
RNA_def_property_enum_items(prop, multi_sample_levels);
RNA_def_property_ui_text(prop, "Gpencil MultiSample",
"Enable Grease Pencil OpenGL multi-sampling, only for systems that support it");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
prop = RNA_def_property(srna, "use_region_overlap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_REGION_OVERLAP);
RNA_def_property_ui_text(prop, "Region Overlap",
"Draw tool/property regions over the main region, when using Triple Buffer");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
prop = RNA_def_property(srna, "gpu_viewport_quality", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gpu_viewport_quality");
RNA_def_property_float_default(prop, 0.6f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Viewport Quality", "Quality setting for Solid mode rendering in the 3d viewport");
RNA_def_property_update(prop, 0, "rna_userdef_update");
#ifdef WITH_OPENSUBDIV
prop = RNA_def_property(srna, "opensubdiv_compute_type", PROP_ENUM, PROP_NONE);
@@ -4603,8 +4573,8 @@ static void rna_def_userdef_input(BlenderRNA *brna)
StructRNA *srna;
static const EnumPropertyItem view_rotation_items[] = {
{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
{0, "TURNTABLE", 0, "Turntable", "Turntable keeps the Z-axis upright while orbiting"},
{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Trackball allows you to tumble your view at any angle"},
{0, NULL, 0, NULL, NULL}
};
@@ -4642,10 +4612,6 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
prop = RNA_def_property(srna, "show_ui_keyconfig", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "userpref_flag", USER_SECTION_INPUT_HIDE_UI_KEYCONFIG);
RNA_def_property_ui_text(prop, "Show UI Key-Config", "");
prop = RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
RNA_def_property_enum_items(prop, view_zoom_styles);
@@ -4660,10 +4626,49 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
prop = RNA_def_property(srna, "use_cursor_lock_adjust", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCK_CURSOR_ADJUST);
RNA_def_property_ui_text(prop, "Cursor Lock Adjust",
"Place the cursor without 'jumping' to the new location (when lock-to-cursor is used)");
prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_NAVIGATE);
RNA_def_property_ui_text(prop, "Auto Depth",
"Use the depth under the mouse to improve view pan/rotate/zoom functionality");
prop = RNA_def_property(srna, "use_mouse_depth_cursor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_CURSOR);
RNA_def_property_ui_text(prop, "Cursor Surface Project",
"Use the surface depth for cursor placement");
prop = RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
RNA_def_property_ui_text(prop, "Camera Parent Lock",
"When the camera is locked to the view and in fly mode, "
"transform the parent rather than the camera");
/* view zoom */
prop = RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
RNA_def_property_ui_text(prop, "Zoom To Mouse Position",
"Zoom in towards the mouse pointer's position in the 3D view, "
"rather than the 2D window center");
/* view rotation */
prop = RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
RNA_def_property_ui_text(prop, "Auto Perspective",
"Automatically switch between orthographic and perspective when changing "
"from top/front/side views");
prop = RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
RNA_def_property_ui_text(prop, "Orbit Around Selection", "Use selection as the pivot point");
prop = RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, view_rotation_items);
RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
RNA_def_property_ui_text(prop, "Orbit Method", "Orbit method in the viewport");
prop = RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
@@ -4807,7 +4812,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse",
"Emulate Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
"Emulate Middle Mouse with Alt+Left Mouse");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
@@ -4828,6 +4833,21 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_TRACKPAD_NATURAL);
RNA_def_property_ui_text(prop, "Trackpad Natural",
"If your system uses 'natural' scrolling, this option keeps consistent trackpad usage throughout the UI");
}
static void rna_def_userdef_keymap(BlenderRNA *brna)
{
PropertyRNA *prop;
StructRNA *srna = RNA_def_struct(brna, "PreferencesKeymap", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "Preferences");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Keymap", "Shortcut setup for keyboards and other input devices");
prop = RNA_def_property(srna, "show_ui_keyconfig", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "userpref_flag", USER_SECTION_INPUT_HIDE_UI_KEYCONFIG);
RNA_def_property_ui_text(prop, "Show UI Key-Config", "");
prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
@@ -4889,6 +4909,27 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
RNA_def_property_update(prop, 0, "rna_userdef_load_ui_update");
prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
"Allow any .blend file to run scripts automatically "
"(unsafe with blend files from an untrusted source)");
RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "author");
RNA_def_property_string_maxlength(prop, 80);
RNA_def_property_ui_text(prop, "Author",
"Name that will be used in exported files when format supports such feature");
prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
RNA_def_property_ui_text(prop, "Tabs as Spaces",
"Automatically convert all new tabs into spaces for new and loaded text files");
/* Directories */
prop = RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "fontdir");
RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
@@ -5035,13 +5076,14 @@ void RNA_def_userdef(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem preference_section_items[] = {
{0, "", ICON_USER, "User Preferences", ""},
{0, "", ICON_USER, "User", ""},
{USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
{USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
{USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
{USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""},
{USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
{USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""},
{USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
{USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
{USER_SECTION_KEYMAP, "KEYMAP", 0, "Keymap", ""},
{USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""},
#ifdef WITH_USERDEF_WORKSPACES
{0, "", ICON_WORKSPACE, "Workspaces", ""},
{USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""},
@@ -5071,7 +5113,7 @@ void RNA_def_userdef(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "userpref");
RNA_def_property_enum_items(prop, preference_section_items);
RNA_def_property_ui_text(prop, "Active Section",
"Active section of the user preferences shown in the user interface");
"Active section of the preferences shown in the user interface");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* don't expose this directly via the UI, modify via an operator */
@@ -5120,6 +5162,12 @@ void RNA_def_userdef(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
prop = RNA_def_property(srna, "keymap", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "PreferencesKeymap");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_keymap_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Keymap", "Shortcut setup for keyboards and other input devices");
prop = RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "PreferencesFilePaths");
@@ -5151,6 +5199,7 @@ void RNA_def_userdef(BlenderRNA *brna)
rna_def_userdef_view(brna);
rna_def_userdef_edit(brna);
rna_def_userdef_input(brna);
rna_def_userdef_keymap(brna);
rna_def_userdef_filepaths(brna);
rna_def_userdef_system(brna);
rna_def_userdef_addon(brna);

View File

@@ -1684,7 +1684,7 @@ void WM_OT_save_userpref(wmOperatorType *ot)
{
ot->name = "Save Preferences";
ot->idname = "WM_OT_save_userpref";
ot->description = "Save user preferences separately, overrides startup file preferences";
ot->description = "Save preferences separately, overrides startup file preferences";
ot->invoke = WM_operator_confirm;
ot->exec = wm_userpref_write_exec;
@@ -1825,7 +1825,7 @@ void WM_OT_read_factory_settings(wmOperatorType *ot)
ot->name = "Load Factory Settings";
ot->idname = "WM_OT_read_factory_settings";
ot->description = "Load default file and user preferences";
ot->description = "Load default file and preferences";
ot->invoke = WM_operator_confirm;
ot->exec = wm_homefile_read_exec;