Commit Graph

3360 Commits

Author SHA1 Message Date
Campbell Barton
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
Campbell Barton
78a26f28aa Fix own error using handler after freeing
Was introduced in e7895bac07
Only certain actions caused this, reported as T55155
2018-05-22 19:35:48 +02:00
Joshua Leung
c685c19df9 Drivers UI (Part of T55145): Add "Show Drivers Editor" entry to RMB menus
This commit adds an operator, "Show Drivers Editor", to the RMB menu when
clicking on properties.

As per T54653, this will open a new Graph Editor instance in a new/separate
window (much like how the User Preferences show up in a popup window now),
and will configure all the relevant panels so that you can see and edit the
driver settings immediately without doing a lot of the view configuration steps
that were previously needed.

When doing so on a property that is driven, the driver/fcurve for that property
will be made active in the editor, ready for you to start editing its settings
without having to hunt it down again first.
2018-05-22 16:44:13 +02:00
Campbell Barton
6781fac42e Cleanup: warning 2018-05-22 16:12:41 +02:00
Campbell Barton
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
Brecht Van Lommel
bc46034752 Cleanup: fix compiler warnings. 2018-05-22 14:17:52 +02:00
Campbell Barton
9fc5a0c95e Fix area tool getting out of sync w/ active tool 2018-05-22 09:41:41 +02:00
Campbell Barton
0c1676f388 WM: call keymap callback from manipulators
Not currently needed, add to avoid confusion later on.
2018-05-22 09:27:02 +02:00
Campbell Barton
6974afba82 WM: use keymap poll for manipulators 2018-05-22 09:22:20 +02:00
Campbell Barton
3b1b625ead UI: use spacebar for toolbar
- This allows quick, consistent toolbar access
  w/o conflicting w/ the keymap.
  Where pressing space before a key activates that operator as a tool
  instead of running immediately.
- Search can still be accessed by pressing spacebar again.
- When there is no toolbar for a space, operator search still opens.
2018-05-21 12:46:26 +02:00
Campbell Barton
e7895bac07 UI: support for custom keymaps for popovers 2018-05-20 22:39:14 +02:00
Campbell Barton
ddebf1ea3b UI: Add menu to show the toolbar
For people who prefer to keep the toolbar hidden,
expose as a menu (currently Shift-Space).
2018-05-18 22:28:59 +02:00
Campbell Barton
f9547ab313 Fix tools not being initialized on startup 2018-05-18 17:36:11 +02:00
Campbell Barton
c2d5411cbf Fix manipulator removal
The flag could be left set, removing the manipulator type again.
2018-05-18 17:36:11 +02:00
Brecht Van Lommel
6776a55464 Fix crash rendering files with Python errors in background mode. 2018-05-18 15:50:08 +02:00
Brecht Van Lommel
17bd5c9d4b Collections and groups unification
OVERVIEW

* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
  which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
  and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
  for each. For many workflows one view layer can be used, these are more of an
  advanced feature now.

OUTLINER

* The outliner now has a "View Layer" display mode instead of "Collections",
  which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
  These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
  can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
  text gives different results, we'll unify this later.

LINKING AND OVERRIDES

* Collections can now be linked into the scene without creating an instance,
  with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
  but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
  into collections with overrides directly in the scene.

PERFORMANCE

* We tried to make performance not worse than before and improve it in some
  cases. The main thing that's still a bit slower is multiple scenes, we have to
  change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
  updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
  lookups internally and in API functions like visible_get().

VERSIONING

* Compatibility with 2.7 files should be improved due to the new visibility
  controls. Of course users may not want to set up their scenes differently
  now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
  files. There's a few things which are know to be not quite compatible, like
  nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
  #ifdef so it can be removed at the end of the release cycle.

KNOWN ISSUES

* The G-key group operators in the 3D viewport were left mostly as is, they
  need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
  still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
  be done later, we'll have to see how important this is as all objects within
  the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.

Differential Revision: https://developer.blender.org/D3383

https://code.blender.org/2018/05/collections-and-groups/
2018-05-18 13:34:24 +02:00
Campbell Barton
17852b079c Tool System: support for tool cursors 2018-05-18 11:44:28 +02:00
Campbell Barton
6e40b2de7a Fix operator execution resetting the cursor
Area and region are NULL in the context if the operator finishes.
2018-05-18 11:42:58 +02:00
Campbell Barton
1cf0930e89 Fix manipulator resetting the cursor 2018-05-18 11:42:37 +02:00
Campbell Barton
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
Campbell Barton
3af4a46a18 Tool System: tools now initialize on startup 2018-05-17 22:03:34 +02:00
Campbell Barton
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
Campbell Barton
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
Brecht Van Lommel
12e523d12c Fix menu navigation and modal tools affecting the active region.
We updated the active region during redraw to fix missing updates on
file load, restrict it more now to avoid unwanted updates.
2018-05-17 11:17:45 +02:00
Campbell Barton
599bf05c56 Merge branch 'master' into blender2.8 2018-05-15 19:53:34 +02:00
Campbell Barton
4461be1b72 Fix T55032: Redo w/ file saved in edit-mode failed
It's important edit-mode has a step stored for redo to work,
file load now ensures this in a generic way.
2018-05-15 19:37:06 +02:00
Campbell Barton
bac9c2dc7d Manipulator: utility to get matrix w/o offset 2018-05-14 23:15:44 +02:00
Campbell Barton
1ec48f8042 Tool System: Support set w/ space-type argument 2018-05-13 11:49:21 +02:00
Campbell Barton
e1772dac70 WM: utility to create tool keybindings 2018-05-13 09:34:22 +02:00
Campbell Barton
194cba8ba4 Merge branch 'master' into blender2.8 2018-05-11 20:13:07 +02:00
Campbell Barton
73a7885ab3 WM: initialize last used macro properties 2018-05-11 20:01:51 +02:00
Jeroen Bakker
d3c4248946 Workbench: StudioLight HDRI's
The Studio lights are now loaded from disk. The location is
`datafiles/studiolights` they need to be JPG for now. JPG cannot store
HDRI color range but they are clamped inside the Workbench
engine for speed reason. I didn't select JP2K as it might not be
enabled.

Users can add upto 20 HDRI files. This limitation is inside the
RNA_space.c Currently the icons are calculated when you first open the
selection box for the HDRI's. We could add them to a background
rendering later.

I added 2 test files a sky texture rendered in Cycles and an HDRI from
cloud.blender.org.
2018-05-11 17:02:13 +02:00
Campbell Barton
e6814acf13 Manipulator: API call to invoke on setup
Needed for manipulators that start out interactive,
similar use-case to modal operators, except these can be tweaked after.
2018-05-09 22:43:24 +02:00
Campbell Barton
0d4b165d4f Merge branch 'master' into blender2.8 2018-05-09 11:25:35 +02:00
Campbell Barton
b59b812400 MSVC: resolve near/far issue take2
Previous fix failed w/ compositor,
tested on MSVC2015, full build.
2018-05-09 11:23:32 +02:00
Campbell Barton
a92557f77b Merge branch 'master' into blender2.8 2018-05-09 10:02:33 +02:00
Campbell Barton
598216c36e MSVC: remove hack for near/far name collision
windows headers define these, conflicting w/ View3D.near/far.
2018-05-09 10:00:55 +02:00
Campbell Barton
fa69ce9e3a Cleanup: whitespace, duplicate includes 2018-05-08 16:57:07 +02:00
Campbell Barton
86b9311926 Cleanup: quiet warning, whitespace 2018-05-08 10:58:04 +02:00
Campbell Barton
6feb6235e1 WM: log message bus operations 2018-05-08 08:34:06 +02:00
Campbell Barton
6f57d12e2e Merge branch 'master' into blender2.8 2018-05-08 07:53:48 +02:00
Campbell Barton
433aaa8c2e Cleanup: remove unused wmReport struct 2018-05-08 07:52:13 +02:00
Campbell Barton
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
Campbell Barton
bf593a8631 WM: quiet GCC redundant declaration warnings 2018-05-08 07:18:49 +02:00
Campbell Barton
f7123f0f11 WM: manipulator redo support
Support for adjusting a setting from the last executed operator.
2018-05-06 09:49:55 +02:00
Campbell Barton
4163beb818 Merge branch 'master' into blender2.8 2018-05-06 09:02:47 +02:00
Campbell Barton
632f2b5c18 WM: include macros in last-properties
Needed for 2.8 tool system storage of macro properties.
2018-05-06 08:57:53 +02:00
Campbell Barton
b3545ae373 Merge branch 'master' into blender2.8 2018-05-04 07:30:14 +02:00
Campbell Barton
f3c5b0394f IDProp API: expose repr utility function
Useful for logging properties passed to operators.
2018-05-04 07:29:05 +02:00
Campbell Barton
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