blender.git
2 years agoPyTemplates operator_modal_view3d_raycast: update to blender2.8 (*/@)
Philipp Oeser [Fri, 16 Nov 2018 11:09:41 +0000 (12:09 +0100)]
PyTemplates operator_modal_view3d_raycast: update to blender2.8 (*/@)

2 years agoFix T57566: Blender 2.8 crashes with the new multires
Sergey Sharybin [Fri, 16 Nov 2018 09:34:00 +0000 (10:34 +0100)]
Fix T57566: Blender 2.8 crashes with the new multires

2 years agoKeymap: allow filling in existing key-configs
Campbell Barton [Fri, 16 Nov 2018 04:59:44 +0000 (15:59 +1100)]
Keymap: allow filling in existing key-configs

Needed so we can get the preferences of a key-config
which are sent to a function that generates the contents.

2 years agoCleanup: set variable for preference name
Campbell Barton [Fri, 16 Nov 2018 04:00:27 +0000 (15:00 +1100)]
Cleanup: set variable for preference name

2 years agoKeymap: add support for key-config preferences
Campbell Barton [Fri, 16 Nov 2018 00:24:49 +0000 (11:24 +1100)]
Keymap: add support for key-config preferences

This is needed for keymaps to define their own options,
which can include left/right mouse select.

This can also help to us to provide popular keymap tweaks as options,
so users can easily fit blender to their workflow with well supported
adjustments which don't give the overhead of having to maintain
your own keymap, which become out-dated when operators change.

2 years agoKeymap: remove loading keymaps from old files
Campbell Barton [Fri, 16 Nov 2018 01:30:02 +0000 (12:30 +1100)]
Keymap: remove loading keymaps from old files

These keymaps are not going to work usefully in 2.8x,
remove support for loading them.

2 years agoCleanup: remove 27X define
Campbell Barton [Fri, 16 Nov 2018 00:04:19 +0000 (11:04 +1100)]
Cleanup: remove 27X define

2 years agoBKE: Fix probe duplication not duplicating data block
Clément Foucault [Fri, 16 Nov 2018 00:03:04 +0000 (01:03 +0100)]
BKE: Fix probe duplication not duplicating data block

2 years agoCleanup: de-duplicate 3d view select items
Campbell Barton [Thu, 15 Nov 2018 23:41:17 +0000 (10:41 +1100)]
Cleanup: de-duplicate 3d view select items

2 years agoEdit Mesh: Fixes display of custom normals
Clément Foucault [Thu, 15 Nov 2018 23:45:13 +0000 (00:45 +0100)]
Edit Mesh: Fixes display of custom normals

Should fix T57620

2 years agoKeymaps: add double click loop select to RMB keymap.
Brecht Van Lommel [Thu, 15 Nov 2018 23:27:00 +0000 (00:27 +0100)]
Keymaps: add double click loop select to RMB keymap.

2 years agoFix Blender RMB keymap cursor being set when using border select.
Brecht Van Lommel [Thu, 15 Nov 2018 23:32:32 +0000 (00:32 +0100)]
Fix Blender RMB keymap cursor being set when using border select.

2 years agoFix Blender 2.7 keymap missing spacebar search menu.
Brecht Van Lommel [Thu, 15 Nov 2018 23:24:52 +0000 (00:24 +0100)]
Fix Blender 2.7 keymap missing spacebar search menu.

2 years agoEdit Mesh: Improve mesh cage drawing / fix errors and cleanup
Clément Foucault [Thu, 15 Nov 2018 23:12:45 +0000 (00:12 +0100)]
Edit Mesh: Improve mesh cage drawing / fix errors and cleanup

* Fixes vertices with bad coloring. Now vertices draw with depth write so
they occlude the underlying face geom overlay, avoiding double drawing the
vertex.

* Decrease the z_offset of edges so they don't poke too much through
geometry. Also delete this offset in ortho view.

* Add zoffset to active and selected vertices so they always draw on top
if they overlap a non selected vertex.

* Fix alpha of edge_fix in vertex selection mode

2 years agoRNA: LayerCollection.has_hidden_objects
Dalai Felinto [Thu, 15 Nov 2018 20:25:45 +0000 (18:25 -0200)]
RNA: LayerCollection.has_hidden_objects

With this we have a way to tell that a collection has visible objects
but not all of its objects are visible.

2 years agoKeymaps: left click select keymap changes
Brecht Van Lommel [Thu, 15 Nov 2018 22:27:53 +0000 (09:27 +1100)]
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.

2 years agoRevert "Keymap: remove 3D cursor keymap"
Campbell Barton [Thu, 15 Nov 2018 22:44:19 +0000 (09:44 +1100)]
Revert "Keymap: remove 3D cursor keymap"

This reverts commit 8ecc51e87fd0e3e9bb13622456d03d09926eab47.

This is needed for keymaps that dont include cursor placement by
default.

2 years agoWM: fix hard coded rename
Campbell Barton [Thu, 15 Nov 2018 22:35:24 +0000 (09:35 +1100)]
WM: fix hard coded rename

Currently the filenames are used when setting keymaps.
This hard coded naming meant the preset and setting function
need to be kept in sync.

Prefer to not have hard coded replacements which need to be duplicated.

2 years agoError in recent keymap update
Campbell Barton [Thu, 15 Nov 2018 22:23:48 +0000 (09:23 +1100)]
Error in recent keymap update

2 years agoWM: Fix secondary toolbar events being ignored
Campbell Barton [Thu, 15 Nov 2018 22:19:33 +0000 (09:19 +1100)]
WM: Fix secondary toolbar events being ignored

Error in recent workaround.

2 years agoKeymaps: replace select / action mouse system
Brecht Van Lommel [Thu, 15 Nov 2018 21:28:58 +0000 (08:28 +1100)]
Keymaps: replace select / action mouse system

For Blender builtin configurations the option to choose the select mouse remains
and is now also in the splash screen. It works by changing the keymap dynamically
in the script, rather than using special events.

The system of automatic switching of events was not flexible enough to deal with
side effects that require further keymap changes, so it is now under more manual
control in the script.

This breaks compatibility for some scripts and exported key configurations.
These can be fixed by replacing SELECTMOUSE, ACTIONMOUSE, EVT_TWEAK_S and
EVT_TWEAK_A with appropriate LEFTMOUSE, RIGHTMOUSE, EVT_TWEAK_L and
EVT_TWEAK_R events.

Other than that, there should be no functional changes.

2 years agoKeymap: remove 3D cursor keymap
Campbell Barton [Thu, 15 Nov 2018 20:56:38 +0000 (07:56 +1100)]
Keymap: remove 3D cursor keymap

Rely on 3D view keymap, fixes T57843

2 years agoEevee: Add Filter Quality setting
Clément Foucault [Thu, 15 Nov 2018 19:04:35 +0000 (20:04 +0100)]
Eevee: Add Filter Quality setting

This setting can be tweaked to improve glossy reflection cubemaps.

It increases the sample count for each roughness level.
This settings affect the lookdev mode quality as well.

2 years agoEevee: Add Glossy Reflection clamping
Clément Foucault [Thu, 15 Nov 2018 18:41:15 +0000 (19:41 +0100)]
Eevee: Add Glossy Reflection clamping

This enables reducing the noise comming from very bright light sources
(like a sun) that can be found in distant HDRIs.

The lost energy may be replaced manually by a sunlight that compensate the
this loss.

This clamping only concerns Reflection Cubmaps and is done on all on all
of them.

Setting to 0.0 disables it (default).

2 years agoViewport collections visibility: Viewport and Selection options
Dalai Felinto [Thu, 15 Nov 2018 15:32:03 +0000 (13:32 -0200)]
Viewport collections visibility: Viewport and Selection options

Right now we have a different behaviour whether users click on the name or on
the visibility eye.

When clicking on the eye, it is a toggle. When clicking in the name, you
are isolating this collection (unless you use shift).

As for the UI I tried using separator_spacer, but it was more work than
worth. A lot of sub panels, and LEFT/RIGHT alignment work just fine.

2 years agoViewport collections visibility: Remove collection icon
Dalai Felinto [Thu, 15 Nov 2018 18:46:27 +0000 (16:46 -0200)]
Viewport collections visibility: Remove collection icon

I added the icon inspired by the H menu, but there is no need for this.

2 years agoExplicitly disable separator spacer in popover and pie menus
Dalai Felinto [Thu, 15 Nov 2018 18:44:42 +0000 (16:44 -0200)]
Explicitly disable separator spacer in popover and pie menus

It is doable to get it to work, you just need to process it line
by line though, and get the right width of each one.

Disabling it for now since it is not implemented anyways.

2 years agoFix tool error opening Sculpt template.
Brecht Van Lommel [Thu, 15 Nov 2018 17:48:29 +0000 (18:48 +0100)]
Fix tool error opening Sculpt template.

2 years agoTemplates: set autosmooth threshold to 30°, matching default for new meshes.
Brecht Van Lommel [Thu, 15 Nov 2018 17:28:51 +0000 (18:28 +0100)]
Templates: set autosmooth threshold to 30°, matching default for new meshes.

2 years agoFix T57854: Disable viewport visibility crash
Sergey Sharybin [Thu, 15 Nov 2018 17:28:43 +0000 (18:28 +0100)]
Fix T57854: Disable viewport visibility crash

2 years agoEevee: Add irradiance smoothing
Clément Foucault [Thu, 15 Nov 2018 17:13:07 +0000 (18:13 +0100)]
Eevee: Add irradiance smoothing

This is a parameter that will make the interpolation between irradiance
cells of a same Irradiance Volume smoother, reducing the weight of the
light leaking correction factors.

It is usefull in some cases to avoid harsh lighting transition that can
happen when a sample point it near a surface.

2 years agoEevee: Irradiance Grid: Make the influence shape corners round
Clément Foucault [Thu, 15 Nov 2018 16:52:55 +0000 (17:52 +0100)]
Eevee: Irradiance Grid: Make the influence shape corners round

This makes it easier to add corrective light grids without having ugly
blending corners revealing the shape of the grid bounds.

2 years agoEevee: Lights: Reduce default cascade distance
Clément Foucault [Thu, 15 Nov 2018 14:34:42 +0000 (15:34 +0100)]
Eevee: Lights: Reduce default cascade distance

2 years agoEevee: Cleanup & small optimization
Clément Foucault [Thu, 15 Nov 2018 13:51:51 +0000 (14:51 +0100)]
Eevee: Cleanup & small optimization

2 years agoEevee: Add Light Threshold value
Clément Foucault [Thu, 15 Nov 2018 13:44:45 +0000 (14:44 +0100)]
Eevee: Add Light Threshold value

This is an important change. Starting from now, all lights have a finite
influence radius (similar to the old sphere option for BI).

In order to avoid costly setup time, this distance is first computed
automatically based on a light threshold. The distance is computed
at the light origin and using the inverse square falloff. The setting
can be found inside the render settings panel > shadow tab.

This light threshold does not take the light shape into account an may not
suit every case. That's why we provide a per lamp override where you can
just set the cutt off distance (Light Properties Panel > Light >
Custom Distance).

The influence distance is also used as shadow far clip distance.

This influence distance does not concerns sun lights that still have a
far clip distance.

---

This change is important because it makes it possible to cull lights
an improve performance drastically in the future.

2 years agoEevee: Optimisation: Bypass light power calculation when not needed
Clément Foucault [Wed, 14 Nov 2018 15:03:24 +0000 (16:03 +0100)]
Eevee: Optimisation: Bypass light power calculation when not needed

This makes quite a big improvement in my case 1.8ms vs 2.3ms for a single
area light.
This will make even more difference with light attenuation.

2 years agoEevee: Cleanup: Fix wrong sun area light power calculation
Clément Foucault [Wed, 14 Nov 2018 14:54:10 +0000 (15:54 +0100)]
Eevee: Cleanup: Fix wrong sun area light power calculation

2 years agoEevee: Make sun power match cycles better.
Clément Foucault [Wed, 14 Nov 2018 14:46:40 +0000 (15:46 +0100)]
Eevee: Make sun power match cycles better.

I made an empirical test with a 100% diffuse sphere and manually tweak the
lighting power of a sun lamp trying to fit cycles and eevee the best I can.

Then I plotted the result and found a rough fit to the equation and that
seems to work pretty well.

2 years agoFix node_shader_utils: "Specular Tint" is a float (not a color)
Philipp Oeser [Thu, 15 Nov 2018 16:44:14 +0000 (17:44 +0100)]
Fix node_shader_utils: "Specular Tint" is a float (not a color)

2 years agoRNA: always allow fallback from defaultarray to defaultvalue.
Alexander Gavrilov [Sun, 11 Nov 2018 17:56:42 +0000 (20:56 +0300)]
RNA: always allow fallback from defaultarray to defaultvalue.

The python getters for the array already allowed that, but not the
actual C RNA access functions. This is inconsistent, so implement
the fallback in all cases. Now if by default the property should
contain the same value in all positions, it is not necessary to
actually use an array.

Reviewers: campbellbarton

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

2 years agoCycles: Cleanup, code style
Sergey Sharybin [Thu, 15 Nov 2018 16:19:26 +0000 (17:19 +0100)]
Cycles: Cleanup, code style

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 15 Nov 2018 16:17:37 +0000 (17:17 +0100)]
Merge branch 'master' into blender2.8

2 years agoCycles: Cleanup, code style
Sergey Sharybin [Thu, 15 Nov 2018 16:16:40 +0000 (17:16 +0100)]
Cycles: Cleanup, code style

2 years agoPy API: Fix documentation/actual behavior missmatch in gpu.matrix
Jacques Lucke [Thu, 15 Nov 2018 16:10:32 +0000 (17:10 +0100)]
Py API: Fix documentation/actual behavior missmatch in gpu.matrix

2 years agoPy API Docs: Fix formatting
Jacques Lucke [Thu, 15 Nov 2018 15:54:17 +0000 (16:54 +0100)]
Py API Docs: Fix formatting

2 years agoFix T57825: Crash when assign material
Sergey Sharybin [Thu, 15 Nov 2018 15:50:30 +0000 (16:50 +0100)]
Fix T57825: Crash when assign material

We need to make sure that all the nested node trees are localized.

Because of this reason, we need to roll back to a bit older way
of dealing with materials.

Should be all safe now with the fixes from few moments ago.

2 years agoDepsgraph: Clear localization tag for CoW IDs
Sergey Sharybin [Thu, 15 Nov 2018 15:38:20 +0000 (16:38 +0100)]
Depsgraph: Clear localization tag for CoW IDs

They are self-contained now, and should not cause any sync or
free happening when freeing them.

2 years agoTag all localized ID types as such
Sergey Sharybin [Thu, 15 Nov 2018 15:36:35 +0000 (16:36 +0100)]
Tag all localized ID types as such

2 years agoRemove legacy node tree localization tag
Sergey Sharybin [Thu, 15 Nov 2018 15:35:28 +0000 (16:35 +0100)]
Remove legacy node tree localization tag

Is stored on ID level now.

2 years agoFollowup to the previous commit
Sergey Sharybin [Thu, 15 Nov 2018 15:33:00 +0000 (16:33 +0100)]
Followup to the previous commit

Thought this is to be fixed in master first. Turns out, nope :)

2 years agoCleanup: Double semicolon at the end of line
Sergey Sharybin [Thu, 15 Nov 2018 15:32:18 +0000 (16:32 +0100)]
Cleanup: Double semicolon at the end of line

2 years agoFix strict compiler warnings/errors
Sergey Sharybin [Thu, 15 Nov 2018 15:31:26 +0000 (16:31 +0100)]
Fix strict compiler warnings/errors

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 15 Nov 2018 15:28:37 +0000 (16:28 +0100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: Comments
Sergey Sharybin [Thu, 15 Nov 2018 15:28:07 +0000 (16:28 +0100)]
Cleanup: Comments

2 years agoSplash: tweak quick setup to use single column style layout.
Brecht Van Lommel [Thu, 15 Nov 2018 14:04:23 +0000 (15:04 +0100)]
Splash: tweak quick setup to use single column style layout.

2 years agoKeymaps: add select with left / right option to quick setup splash screen.
Brecht Van Lommel [Thu, 15 Nov 2018 14:04:23 +0000 (15:04 +0100)]
Keymaps: add select with left / right option to quick setup splash screen.

2 years agoViewport collections visibility popover
Dalai Felinto [Thu, 15 Nov 2018 13:35:14 +0000 (11:35 -0200)]
Viewport collections visibility popover

This brings the functionality currently in the H shortcut, to hide/show
individual collections.

In order to convey hierarchy, and to make justice to the originally
intended 1-10 shortcuts, we group the collections per siblings.

2 years agoLayerCollection RNA API util functions
Dalai Felinto [Thu, 15 Nov 2018 13:13:26 +0000 (11:13 -0200)]
LayerCollection RNA API util functions

* has_objects()
* has_visible_objects(view_layer)
* has_selected_objects(view_layer)

2 years agoHide collections menu: ignore excluded collections
Dalai Felinto [Thu, 15 Nov 2018 12:00:21 +0000 (10:00 -0200)]
Hide collections menu: ignore excluded collections

Note: I didn't change the shortcuts, I think this is a separate decision
to be made. I just want at the moment to have the H operator to mimic
the upcoming popover.

Personally if we are to keep the 1-10 shortcuts (and they do work) I
think we should skip the excluded collections altogether.

In fact we could have an option to hide them from the outliner too.

2 years agoUnits: Identifiers in Python
Jacques Lucke [Thu, 15 Nov 2018 13:39:52 +0000 (14:39 +0100)]
Units: Identifiers in Python

I only specified the identifiers for the units that are actually accessible for now.
This way we can postpone some decisions for now. E.g. if it should be `METER_SQUARE`, `SQUARE_METER`, `METER_SQ`, ...

Reviewers: brecht

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

2 years agoFix T57848: Transforming large linked instances freezes Blender
Sergey Sharybin [Thu, 15 Nov 2018 12:55:15 +0000 (13:55 +0100)]
Fix T57848: Transforming large linked instances freezes Blender

2 years agoKeymaps: minor code refactor after adding tools to default preset.
Brecht Van Lommel [Thu, 15 Nov 2018 10:45:25 +0000 (11:45 +0100)]
Keymaps: minor code refactor after adding tools to default preset.

2 years agoDepsgraph: Build all type of IDs for modifiers and constraints
Sergey Sharybin [Thu, 15 Nov 2018 11:47:58 +0000 (12:47 +0100)]
Depsgraph: Build all type of IDs for modifiers and constraints

It was missing handling of collections there, which caused collection
used for smoke colliders to not be in the dependency graph.

2 years agoIcons: sculpt tool updates r62157
William Reynish [Thu, 15 Nov 2018 11:32:38 +0000 (22:32 +1100)]
Icons: sculpt tool updates r62157

- Blue = Add/Subtract
- Yellow = Flatten/Contrast
- Red = Grab
- Grey = General/Other

2 years agoTool System: add curve tilt tool
William Reynish [Thu, 15 Nov 2018 11:27:02 +0000 (22:27 +1100)]
Tool System: add curve tilt tool

2 years agoIcons: add tilt tool
William Reynish [Thu, 15 Nov 2018 11:28:55 +0000 (22:28 +1100)]
Icons: add tilt tool

2 years agoFix T57831: Crash with multi-select / delete of the same object in Collection outliner.
Bastien Montagne [Thu, 15 Nov 2018 11:24:51 +0000 (12:24 +0100)]
Fix T57831: Crash with multi-select / delete of the same object in Collection outliner.

Tssst… that piece of code should have been removed when we got rid of
bases here, kind of obvious it would break if object pointer itself is
NULL! And since deleting an object clears its ID pointers in outliner
tree, this fixes for free the issue of deleting several time the same
object (being selected in several collections at once).

2 years agoRemove unused parameter.
Alexander Gavrilov [Thu, 15 Nov 2018 11:19:26 +0000 (14:19 +0300)]
Remove unused parameter.

2 years agoDepsgraph: Make drivers builder less noisy
Sergey Sharybin [Thu, 15 Nov 2018 11:12:08 +0000 (12:12 +0100)]
Depsgraph: Make drivers builder less noisy

Do early output when trying to add target relation with wrong rna_path.

We can't do anything reliably in that case anyway, so hopefully it is
a no-functional-change for artists, just avoids noisy error prints in
the terminal.

2 years agoStretch To: fix initialization of the constraint with copy-on-write.
Alexander Gavrilov [Thu, 15 Nov 2018 11:09:13 +0000 (14:09 +0300)]
Stretch To: fix initialization of the constraint with copy-on-write.

The constraint is supposed to automatically initialize the rest
length when it is first evaluated, so now that evaluation is done
on a separate copy it also has to copy the value to the master
instance - or newly created constraints will be broken.

Since this is supposed to happen once at constraint creation,
implementing as a search for now instead of adding new fields.

2 years agoDepsgraph: Save memory by ignoring invisible objects
Sergey Sharybin [Wed, 14 Nov 2018 15:50:59 +0000 (16:50 +0100)]
Depsgraph: Save memory by ignoring invisible objects

This finished old standing TODO which was attempting to
ignore objects of all invisible collections.

The difference here is that we remove invisible bases from
view layers. This guarantees that the evaluated state is
consistent and does not reference original objects.

2 years agoDepsgraph: Fix/workaround crash after recent point cache changes
Sergey Sharybin [Thu, 15 Nov 2018 10:23:59 +0000 (11:23 +0100)]
Depsgraph: Fix/workaround crash after recent point cache changes

For some reason relations can not always be found. This is to be
investigated, but doesn't hurt to be safe here. Also allows to
unlock production.

2 years agoDepsgraph: Use more human readable relation keys identifier
Sergey Sharybin [Thu, 15 Nov 2018 10:32:45 +0000 (11:32 +0100)]
Depsgraph: Use more human readable relation keys identifier

2 years agoUI: remove node tree panels
Campbell Barton [Thu, 15 Nov 2018 08:34:48 +0000 (19:34 +1100)]
UI: remove node tree panels

This duplicates items in the add menu and uses a lot of vertical space.

This should be used for tools or disabled.

2 years agoCleanup: typo, whitespace
Campbell Barton [Thu, 15 Nov 2018 07:50:18 +0000 (18:50 +1100)]
Cleanup: typo, whitespace

2 years agoWM: use Python bytecode cache to run presets
Campbell Barton [Thu, 15 Nov 2018 07:42:23 +0000 (18:42 +1100)]
WM: use Python bytecode cache to run presets

Key-maps can be very large, avoid parsing on every startup.

2 years agoUI: 'Add Object' rename dimensions
Campbell Barton [Thu, 15 Nov 2018 06:44:50 +0000 (17:44 +1100)]
UI: 'Add Object' rename dimensions

D3943 by @Zachman w/ edits

2 years agoWM: use spacebar press event (not double click)
Campbell Barton [Thu, 15 Nov 2018 06:12:33 +0000 (17:12 +1100)]
WM: use spacebar press event (not double click)

Functionality) is nicer but this uses a hack to make it work,
keep the code under a variable in case we want to remove.

2 years agoFix gizmos in the node editor
Campbell Barton [Thu, 15 Nov 2018 04:43:50 +0000 (15:43 +1100)]
Fix gizmos in the node editor

2 years agoGizmo: tweak navigation drawing for axis views
Campbell Barton [Thu, 15 Nov 2018 03:11:08 +0000 (14:11 +1100)]
Gizmo: tweak navigation drawing for axis views

Axis aligned views now show both small/large handles,
this makes it possible to well if the view is in front or behind.

2 years agoKeymap: remove keymap export that wrote API calls
Campbell Barton [Thu, 15 Nov 2018 02:51:55 +0000 (13:51 +1100)]
Keymap: remove keymap export that wrote API calls

Use new keymap format which defines data to be loaded.

2 years agoTool System: use preset keymap loading logic
Campbell Barton [Thu, 15 Nov 2018 02:36:23 +0000 (13:36 +1100)]
Tool System: use preset keymap loading logic

The data structures for tool keymaps and presets were different,
use the same structure and expose function publicly.

2 years agoMissed when moving tool keymaps
Campbell Barton [Thu, 15 Nov 2018 02:34:47 +0000 (13:34 +1100)]
Missed when moving tool keymaps

2 years agoKeymap: use parameters for tool keymap
Campbell Barton [Thu, 15 Nov 2018 01:54:44 +0000 (12:54 +1100)]
Keymap: use parameters for tool keymap

2 years agoKeymap: move tool system keymaps into the default keymap
Campbell Barton [Thu, 15 Nov 2018 01:22:36 +0000 (12:22 +1100)]
Keymap: move tool system keymaps into the default keymap

Note that tools can still define their keymaps,
since it's useful for add-ons.

2 years agoWM: remove warning when toolbar not found
Campbell Barton [Wed, 14 Nov 2018 22:50:13 +0000 (09:50 +1100)]
WM: remove warning when toolbar not found

Not useful for general usage, so removing.

2 years agoGizmo: use color fading to show depth for navigate
Campbell Barton [Wed, 14 Nov 2018 22:44:03 +0000 (09:44 +1100)]
Gizmo: use color fading to show depth for navigate

Previously the positive axis was always brighter,
now use bright colors which face towards the view.

2 years agoGizmo: minor fix for navigation axis color
Campbell Barton [Wed, 14 Nov 2018 21:17:16 +0000 (08:17 +1100)]
Gizmo: minor fix for navigation axis color

When view aligned, the near axis was hidden,
making it seem as if the opposite axis was at the front.

2 years agoGizmo: skip text drawing w/ select for navigate
Campbell Barton [Wed, 14 Nov 2018 20:58:03 +0000 (07:58 +1100)]
Gizmo: skip text drawing w/ select for navigate

Also use struct for storing extra args.

2 years agoPy API Docs: New custom shader example
Jacques Lucke [Wed, 14 Nov 2018 17:41:28 +0000 (18:41 +0100)]
Py API Docs: New custom shader example

2 years agoFix assert in bevel modifier with certain geometry.
Brecht Van Lommel [Wed, 14 Nov 2018 17:15:48 +0000 (18:15 +0100)]
Fix assert in bevel modifier with certain geometry.

This happened in in the barbershop_interior.blend benchmark file, seems
duplicate hash entries are ok for this algorithm.

2 years agoFix some templates for 2.8.
Bastien Montagne [Wed, 14 Nov 2018 17:19:41 +0000 (18:19 +0100)]
Fix some templates for 2.8.

2 years agoFix (unreported) `bpy.ops.wm.read_factory_settings(use_empty=True)` crash.
Bastien Montagne [Wed, 14 Nov 2018 17:04:01 +0000 (18:04 +0100)]
Fix (unreported) `bpy.ops.wm.read_factory_settings(use_empty=True)` crash.

`BKE_blendfile_read_make_empty()` was not preserving workspaces...

2 years agoDepsgraph: suppress logs from add_relation on invalid driver variables.
Alexander Gavrilov [Wed, 14 Nov 2018 17:16:55 +0000 (20:16 +0300)]
Depsgraph: suppress logs from add_relation on invalid driver variables.

Rig generators (e.g. rigify) use dummy drivers to attach extra
ID references to rigs for Append/Link. These references use
Single Property variables with empty path, which is intentionally
invalid and shouldn't produce low-level error logs from depsgraph.

The removed code would always print an error because RNAPathKey
requires a valid path to produce a non-NULL reference.

2 years agoFix assertion failure evaluating depsgraph on an empty armature.
Alexander Gavrilov [Wed, 14 Nov 2018 15:54:56 +0000 (18:54 +0300)]
Fix assertion failure evaluating depsgraph on an empty armature.

If there are no bones, chan_array may not be allocated.

2 years agoFix T57760: Depsgraph 'object_instances' showing incorrect list of objects.
Bastien Montagne [Wed, 14 Nov 2018 16:04:10 +0000 (17:04 +0100)]
Fix T57760: Depsgraph 'object_instances' showing incorrect list of objects.

It appears that Python gets next item before using current one, which
would break our Depsgraph instance iterator (since only current item is
valid there, we use the same memory at each iteration).

Working around that with an ugly ping-pong game between two sets of
iterator data, so that previous one (C RNA-iterator-wise) remains valid
memory for Python to access to.

2 years agoFix typo in comment.
Bastien Montagne [Wed, 14 Nov 2018 15:46:33 +0000 (16:46 +0100)]
Fix typo in comment.

2 years agoFix T57558: Outliner displaying same object twice in some cases.
Bastien Montagne [Wed, 14 Nov 2018 15:40:37 +0000 (16:40 +0100)]
Fix T57558: Outliner displaying same object twice in some cases.

Logical flaw in `BKE_scene_objects_iterator_begin()` code (two errors
actually, wrong handling of first object of Master collection, and
missing call to `object_base_unique()` to 'register' that first object
and avoid getting it returned a second time).

Simply fixed by always calling `BKE_scene_objects_iterator_next()`
after minimal proper init, that one knows how to do the things. ;)

2 years agoPy API Docs: documentation for gpu_extras.presets
Jacques Lucke [Wed, 14 Nov 2018 15:43:09 +0000 (16:43 +0100)]
Py API Docs: documentation for gpu_extras.presets

2 years agoDepsgraph: Remove meaningless evaluation mode
Sergey Sharybin [Wed, 14 Nov 2018 10:43:25 +0000 (11:43 +0100)]
Depsgraph: Remove meaningless evaluation mode

With the current implementation it only confuses logic around
checks like vewport/render subdivision levels.

If this mode is really needed for any decision making, implement
this properly.