Commit Graph

105 Commits

Author SHA1 Message Date
e7641b6834 Edit last commit
Split out ensure-tool check into its own function.
2018-12-04 14:33:45 +11:00
80816fc712 Fix T58256: error message w/ missing Select Box tool
Support space modes not having tools.
2018-12-04 13:55:50 +11:00
b58d4e7fe4 WM: remove tool initialization code
Area initialization handles these cases now.
2018-11-28 13:58:53 +11:00
dcf0860dab Fix tool not being initialized switching windows 2018-11-28 13:41:36 +11:00
1944bca49a Tool System: use tools for node editor 2018-11-27 18:43:08 +11:00
e7662ea257 Keymaps: keep Select Box as default tool. 2018-11-26 13:53:09 +01:00
43325e98da Tools: add Select tool, with transform tweak on drag and no click delay.
For users that want the 2.7 LMB keymap behavior, this provides a way of
working without tools interfering. For RMB select this operator is quite
redundant with the Cursor tool, we may have to find a solution for that.

Note that we also might later add transform tweak to the transform tools,
when nothing is selected. But this is important for existing users who
preferred the existing workflow.
2018-11-25 20:09:43 +01:00
bf7af31e9f Keymaps: left click select keymap changes
Both the active tools and selection are now on LMB, which leads to
various conflicts.

For that reason the LMB keymap now has a couple of differences
compared to before. These changes do not affect the RMB keymap.

* Context Menu: W -> RMB
* Select Tool activate: None -> W
* Set Cursor: RMB -> Shift+RMB
* Loop Select: Alt+LMB -> double click LMB
* Mask Feather Vertex Slide: Shift+RMB -> Ctrl+Shift+RMB
* Node Select: only with LMB now, no RMB

The idea behind the W key Select Tool shortcut is that various
tools can't be combined with selection, unlike the RMB keymap.
So this works as a quick shortcut to drop a tool
and go back to selection.

Tools: set Select Box tool as default, rather than Cursor.

This goes along with coming LMB select keymap changes,
where we want the user to be able to LMB click to select by default,
rather than set the cursor.
The cursor will still be directly setabble with shift+RMB.
2018-11-16 09:54:50 +11:00
2b3b481c3d Merge branch 'master' into blender2.8 2018-11-14 11:27:42 +11: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
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
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
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
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
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
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
dce12293d0 WM: generalize tool property initialization
Prepare for storing different kinds of properties in tools.
2018-10-02 15:39:20 +10:00
250a377592 Partial revert of recent toolsystem defaults
- Use ctrl for de-select since we may want to use shift for extend.
- Use cursor tool by default,
  it's agreed lasso select isn't accessible from a shortcut by default.
2018-09-27 21:19:45 +10:00
ed83075402 Tool System: set a default tool for each mode
Also clear tools for the default startup file
so changes to defaults apply to new files.
2018-09-27 11:20:27 +10:00
1f1802307f Gizmo: value2d utility to adjust operator values
This allows any operator to interactively redo without having to
manually make each operator modal.
2018-09-13 09:10:19 +10:00
3a93314753 Tool System: initial particle system support 2018-08-02 19:27:26 +10:00
b457cae397 Cleanup: use variable names based on term gizmo 2018-07-15 14:35:33 +02:00
5ebebcfbff WM: rename manipulator to gizmo internally 2018-07-14 23:49:00 +02:00
c43443d530 Workspaces: store view layer per main window, instead of per workspace.
It was a bit odd that the scene was stored per window but not the view
layer. The reasoning was that you would use different view layers for
different tasks. This is still possible, but it's more predictable to
switch them both explicitly, and with child window support manually
syncing the view layers between multiple windows is no longer needed
as often.
2018-07-04 18:40:33 +02:00
b608133075 Fix crash if no tool is set 2018-06-02 13:10:15 +02:00
eb1feb9f4a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_select.c
	source/blender/editors/space_outliner/outliner_edit.c
2018-05-31 16:21:47 +02:00
81bf9a41e1 Tool System: Utility to set the tool by name
Wrapper for the Python operator.
2018-05-31 09:02:43 +02:00
44f78c95be Cleanup: move toolsystem into own include
Many files using the window manager don't access the tool-system.

This avoids rebuilding many files when the tool-system changes.
2018-05-23 08:23:16 +02:00
6781fac42e Cleanup: warning 2018-05-22 16:12:41 +02:00
96a7ed8a15 Tool System: store operator properties in the tool
This replaces last-used property use which wasn't reliable since
properties were not considered 'set' - causing them to be ignored.
2018-05-22 15:31:06 +02:00
bc46034752 Cleanup: fix compiler warnings. 2018-05-22 14:17:52 +02:00
9fc5a0c95e Fix area tool getting out of sync w/ active tool 2018-05-22 09:41:41 +02:00
f9547ab313 Fix tools not being initialized on startup 2018-05-18 17:36:11 +02:00
987d1df571 Tool System: store the active tool in ScrArea
Without this we need to have the context to get the
(space_type, mode) args for an active tool lookup.

For event handling & poll its more convenient to have direct access.
2018-05-18 09:40:52 +02:00
3af4a46a18 Tool System: tools now initialize on startup 2018-05-17 22:03:34 +02:00
b0c8d35142 Tool System: use context mode
Was using object mode in the workspace API which isn't
useful for accessing tools.
2018-05-17 20:28:14 +02:00
edf6676a77 Tool System: per space/mode tool support
This patch adds support for:

- Per space-type tools (3D view and edit).
- Per mode tools (object, edit, weight-paint .. etc).

The top-bar shows the last activated tools options, this is a design
issue with using a global topbar to show per-space settings.

See D3395
2018-05-17 15:57:33 +02:00
86b9311926 Cleanup: quiet warning, whitespace 2018-05-08 10:58:04 +02:00
05ec0108dc WM: refresh tool on object mode switch
The tool manipulator could become disabled when set in the wrong mode.
2018-05-08 07:27:53 +02:00
e954082dda WM: warn when tool widget not found
This happens when testing adding tools, assert isn't useful.
2018-05-03 07:33:44 +02:00
2c9670b92d Tool System: support non-brush tools w/ paint modes
Allows select, gradient tools not to conflict with brush keymap.
2018-05-01 11:23:46 +02:00
ba339379fe Fix linking brushes crashing on load
We need to link brushes for all windows that use a workspace.
2018-04-30 20:09:39 +02:00
0c512a6f95 Fix missing NULL check when setting the tool 2018-04-29 19:14:51 +02:00