Commit Graph

3719 Commits

Author SHA1 Message Date
fe4df40f30 Fix crash when Python creates modal keymaps without items. 2018-11-13 18:22:07 +01:00
aab959d71c Cleanup: split object mode out of tool checks 2018-11-13 16:58:29 +11:00
b657e9875c Tool System: use enum for gp sculpt/weight paint
Fixes T57525
2018-11-13 16:52:39 +11:00
ed4f204d86 WM: default operators to replace selection
Tools now default to creating new selection.
2018-11-13 14:02:28 +11:00
dc21ef7b86 Fix 'Load Factory Settings' loosing the keymap
Caused by recent move to Python based keymaps.
2018-11-10 11:04:32 +11:00
0121258770 Merge branch 'master' into blender2.8 2018-11-10 10:57:35 +11:00
7efac2b0b0 PyAPI: add imports arg to BPY_execute_string
Allows for avoiding `__import__` in expressions,
was already supported for BPY_execute_string_as_* API calls.
2018-11-10 10:55:04 +11:00
8bf5af7bd3 UI: Make Region overlap slide instead of fade
Requested by @billreynish.
Increases the TIMESTEP to 60Hz to have smooth animation.
2018-11-09 15:35:31 +01:00
3064da1200 Keymap: move builtin keymaps from C to Python
This should be purely an implementation change,
for end users there should be no functional difference.

The entire key configuration is in one file with ~5000 lines of code.
Mostly avoiding code duplication and preserve comments and utility
functions from the C code.
It's a bit long but for searching and editing it's also convenient to
have it all in one file.

Notes:

- Actual keymap is shared by blender / blender_legacy
  and stored in `keymap_data/blender_default.py`

  This only generates JSON-like data to be passed into
  `keyconfig_import_from_data`, allowing other presets to load and
  manipulate the default keymap.

- Each preset defines 'keyconfig_data'
  which can be shared between presets.

- Some of the utility functions for generating keymap items still
  need to be ported over to Python.

- Some keymap items can be made into loops (marked as TODO).

See: D3907
2018-11-09 11:33:06 +11:00
64ec05b64d Cleanup: remove some useless BKE_library and BKE_main includes.
Makes it simpler to make some changes...

Also fix order of some includes (use alphabetical please).
2018-11-07 20:58:54 +01:00
ee201d8a50 Cleanup, more meaningful and up to date comments 2018-11-07 14:04:47 +01:00
48488b7106 Skip dependency graph update when interface is locked
This is a variation of legacy dependency graph update check based on
G.is_rendering. Now it is ensured, that locked interface does not
tempter around with the dependency graph.
2018-11-07 14:04:47 +01:00
1cadd811ce Cleanup, indentation 2018-11-07 14:04:47 +01:00
188857e0f2 Cleanup: style 2018-11-07 12:57:24 +11:00
fb932bb52a Cleanup: use BKE_brush_tool_get/set macros
Also add API call WM_toolsystem_ref_sync_from_context
(was in rna_workspace_api.c)
2018-11-07 08:43:56 +11:00
99c1075e3b Paint: fix for creating duplicate brushes
Setting the tool added a brush if none was found
but wasn't checking for existing brushes.
2018-11-07 08:43:56 +11:00
57aea0ce19 Paint: correct brush defaults 2018-11-07 08:43:56 +11:00
a90bcdf93d Tool System: use tool type enum to access brushes
Previously the brush names were used which had the limit that:

- Brush names that were deleted wouldn't show up in the toolbar.
- Naming collisions between user defined brushes and existing tools
  broke tool selection.

Now brushes are created as needed when tools are selected.

Note, vertex/weight paint combine tool and blend modes,
this should be split out into a separate enum.
2018-11-06 12:39:51 +11:00
aa41c17d32 UI: add option for permanently allowing execution of scripts to dialog.
Ref T57197
2018-11-02 17:34:50 +01:00
d9dd20bcb3 UI: Rename Save User Settings operator to Save User Preferences.
The term Settings is not used anywhere, plus the menu entry and editor use the word Preferences.
2018-11-02 03:08:58 +01:00
2d6a10615d UI: Typo 2018-11-02 01:19:34 +01:00
28f3f4da12 Cleanup: style 2018-11-02 07:44:26 +11:00
c2bcde5c28 UI: show blocking popup when auto execution of scripts is disabled.
This is important information, and it was easily missed at the top/bottom of
the screen.

Ref T57197.
2018-11-01 19:44:03 +01:00
77c126dd4c Fix T57553: Python operator popup size does not follow UI scale and DPI.
Make it the convention to multiply by scaling factor inside the function, so
Python scripts that didn't add DPI scale start working correctly.
2018-11-01 12:33:27 +01:00
48f9e24f0c Enable dependency graph update while rendering
It is a whole point of copy-on-write to make such updates safe.
If this causes an issues, we need to solve them.

Fixes T57302: Viewport (selection etc) not updated while rendering
2018-10-29 12:16:18 +01:00
4e6f5fabd4 Fix topbar UI being lost on undo w/ mode change 2018-10-29 20:20:16 +11:00
Dalai Felinto
009bfbf408 Fix crash when switching to Scripting workspace
Crash introduced on: a4a6ed1ba3.
2018-10-26 15:33:20 -03:00
6be7a98906 PyAPI: raise error when toolbar panels use tabs
Add-ons that register panels in the toolbar can
no longer use 'bl_categories' (tabs).
2018-10-26 15:05:07 +11:00
a4a6ed1ba3 WM: default tool was being set for space types w/o tools
Add mask for space types so we don't accidentally add tools
for space types that don't support it.
2018-10-26 10:46:35 +11:00
6c86e1a781 PyAPI: draw handlers now store args in the capsule context
Was using the handlers custom-data which crashes
when Blender frees the screen data before Python removes the handler.
2018-10-26 09:30:17 +11:00
6d49b623e2 WM: space, region type filtering for paint cursor
Avoids calling poll on mouse-move for unrelated space/region types.
2018-10-25 16:06:47 +11:00
f2c77558b4 Merge branch 'master' into blender2.8 2018-10-25 15:19:35 +11:00
2046817c08 WM: minor changes to cursor API 2018-10-25 15:18:24 +11:00
650cdc6b2d Drag & Drop: Support Open/Link/Append when dropping .blend file
When a .blend file is dropped into Blender a small menu opens.
In that menu the user can choose between three options: Open, Link and Append.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3801
2018-10-22 17:18:42 +02:00
0e70feab22 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/windowmanager/intern/wm_init_exit.c
2018-10-22 10:55:16 +02:00
32d66889e9 Tentative fix for T57066: Daily build of Blend 2.79 crashes on OSX Mojave.
Looks like we need to explicitly set i18n language to default value on
some OSs... Unless that 'need to create new translated-name IDs in
versionning code for startup file' situation is really seldom.

Anyway, hopefully that will fix the crash.
2018-10-22 10:39:57 +02:00
84eff5c126 Merge branch 'master' into blender2.8 2018-10-22 15:13:43 +11:00
24162c977c Prevent G.fileflags changes when WM_OT_save_mainfile() is called from script
This is to solve an issue where a blend file could be compressed
unbeknownst to the artist. This happened in the following situtation:

- Artist edits an uncompressed blend file.
- Some script saves a compressed blendfile to a separate location.
- When the artist saves the file (s)he is editing (File>Save, or Ctrl+S),
  it was silently compressed.

Cherry pick from: cd3b313d5f
2018-10-22 15:08:26 +11:00
71466cac1e Merge branch 'master' into blender2.8
Reverts: 92fd931e53
2018-10-22 14:59:12 +11:00
64a6c78a9a Fix T57328: 'Save As Copy' prints warning 2018-10-22 14:51:06 +11:00
16882ca535 Image Space: make 'UV Edit' a separate mode
This is needed for splitting UV into its own editor, see: T54744
2018-10-19 20:15:18 +11:00
40f679ccb9 Cleanup: move gizmo sort functions into an API 2018-10-18 11:50:22 +11:00
3f3eae675a Cleanup: naming
'mp' was a reference to 'manipulator'
2018-10-16 22:09:27 +11:00
eba1b0487c Event System: don't invoke operator that should only be executed
Problem was that the event was not `NULL` even though the `context` is `WM_OP_EXEC_*`.
I noticed this problem when dropping .blend files into Blender.
Instead of only executing `WM_OT_open_mainfile`, it was invoked (opening a file selector).

The `wm_operator_invoke`, which also executes operators, always invokes operators when `event != NULL`. So setting `event` to `NULL` tells `wm_operator_invoke` not to invoke but to execute the operator.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3799
2018-10-16 11:48:12 +02:00
cd3b313d5f Prevent G.fileflags changes when WM_OT_save_mainfile() is called from script
This is to solve an issue where a blend file could be compressed
unbeknownst to the artist. This happened in the following situtation:

- Artist edits an uncompressed blend file.
- Some script saves a compressed blendfile to a separate location.
- When the artist saves the file (s)he is editing (File>Save, or Ctrl+S),
  it was silently compressed.
2018-10-12 10:24:25 +02:00
e7218e7049 Cleanup: naming
- immAttrib*    -> immAttr*
- immSkipAttrib -> immAttrSkip

Term 'attr' is a convention for GPU module.
2018-10-09 11:01:50 +11:00
2ac65f6153 UI: new icon set by Andrzej Ambroz.
This is a monochrome icon set, with a more modern look and icons for
various features that did not have a proper icon before.
2018-10-08 19:46:00 +02:00
143ece7199 Tool System: initial support for UV-sculpt
This currently conflicts with the UV-sculpt toggle being manually set,
ideally this would work more like other paint modes in Blender.
2018-10-05 13:13:30 +10:00
0b98a679bb UI: rename Border Select -> Box Select
See: T56648
2018-10-05 10:29:31 +10:00
33d89e482b Revert "UI: start maximized on X11 if possible, like other platforms."
This reverts commit ac0dfcced3.
2018-10-04 18:52:55 +02:00