Commit Graph

9185 Commits

Author SHA1 Message Date
Yevgeny Makarov
773beec541 macOS: add trackpad smart zoom event support
This is done with two-finger double tap on trackpads, and is usually used to
zoom into an element under the cursor.

It can now be used for toggling local view in the 3D viewport.

Differential Revision: https://developer.blender.org/D6588
2020-01-28 11:35:18 +01:00
Christian Rauch
bb65f49005 Linux: update EGL context code to fully work, including offscreen rendering
This is a step towards Wayland and headless rendering support, using EGL
instead of GLX. The EGL backend is not enabled by default, it can be tested
using WITH_GL_EGL=ON.

Differential Revision: https://developer.blender.org/D6585
2020-01-28 10:59:42 +01:00
Harley Acheson
22ca8b8aee UI: Win32 - Restore Minimized App On WM_Close
Changes needed for Windows 10 to restore and show close dialog from minimized state.

https://developer.blender.org/D5107

Reviewed by Brecht Van Lommel
2020-01-27 10:41:39 -08:00
Ray Molenkamp
f357740a80 Merge remote-tracking branch 'origin/blender-v2.82-release' 2020-01-27 10:49:18 -07:00
Ray Molenkamp
10eb711e16 Fix: Building without WITH_MOD_FLUID
When MOD_FLUID was off and WITH_CYCLES was on there was a build error.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6542
2020-01-27 10:46:55 -07:00
mano-wii
67f3941dd5 Merge branch 'blender-v2.82-release' 2020-01-27 14:17:51 -03:00
Simon G
c8103efbe3 Fix undefined behavior in tangent space computation
Use an improved implementation for circular shift.

Differential Revision: https://developer.blender.org/D6677
2020-01-27 18:00:34 +01:00
Yevgeny Makarov
f4f57ed21a Fix part of T65404: quit dialog doesn't show if Blender is minimized
This solves the problem for macOS and Linux, but not Windows yet.

Differential Revision: https://developer.blender.org/D6673
2020-01-27 17:38:21 +01:00
Charlie Jolly
20e803ac6b Shading: Add color output to White Noise node
Hash input values to a color.

Differential Revision: https://developer.blender.org/D6672
2020-01-27 15:47:51 +00:00
aabf4d4076 Merge branch 'blender-v2.82-release' 2020-01-27 12:26:18 +01:00
c76a8f65b7 Memory: add OBJECT_GUARDED_SAFE_DELETE like MEM_SAFE_FREE 2020-01-27 12:22:01 +01:00
1107af1abb Fix OBJECT_GUARDED_FREE compiler error when type is in namespace 2020-01-27 12:22:01 +01:00
3788901107 Cleanup: fix compiler warnings 2020-01-27 12:19:49 +01:00
Campbell Barton
cdebc8a9f6 Cleanup: include missing CMake headers 2020-01-25 20:15:35 +11:00
Pablo Dobarro
f08f92a04d Merge branch 'blender-v2.82-release' 2020-01-24 18:15:15 +01:00
Sebastián Barschkis
64b152c254 Fluid: Added resume cache boolean to standalone scripts
Exported Manta script was missing the new resume options in the data load functions.
2020-01-24 17:23:50 +01:00
Sergey Sharybin
6fff73e3f0 Merge branch 'blender-v2.82-release' 2020-01-23 16:59:50 +01:00
Sergey Sharybin
517870a4a1 CMake: Refactor external dependencies handling
This is a more correct fix to the issue Brecht was fixing in D6600.

While the fix in that patch worked fine for linking it broke ASAN
runtime under some circumstances.
For example, `make full debug developer` would compile, but trying
to start blender will cause assert failure in ASAN (related on check
that ASAN is not running already).

Top-level idea: leave it to CMake to keep track of dependency graph.

The root of the issue comes to the fact that target like "blender" is
configured to use a lot of static libraries coming from Blender sources
and to use external static libraries. There is nothing which ensures
order between blender's and external libraries. Only order of blender
libraries is guaranteed.

It was possible that due to a cycle or other circumstances some of
blender libraries would have been passed to linker after libraries
it uses, causing linker errors.

For example, this order will likely fail:

  libbf_blenfont.a libfreetype6.a libbf_blenfont.a

This change makes it so blender libraries are explicitly provided
their dependencies to an external libraries, which allows CMake to
ensure they are always linked against them.

General rule here: if bf_foo depends on an external library it is
to be provided to LIBS for bf_foo.
For example, if bf_blenkernel depends on opensubdiv then LIBS in
blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES.

The change is made based on searching for used include folders
such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries
to LIBS ion that CMakeLists.txt. Transitive dependencies are not
simplified by this approach, but I am not aware of any downside of
this: CMake should be smart enough to simplify them on its side.
And even if not, this shouldn't affect linking time.

Benefit of not relying on transitive dependencies is that build
system is more robust towards future changes. For example, if
bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES
and all such code is moved to bf_blenkernel this will not break
linking.

The not-so-trivial part is change to blender_add_lib (and its
version in Cycles). The complexity is caused by libraries being
provided as a single list argument which doesn't allow to use
different release and debug libraries on Windows. The idea is:

- Have every library prefixed as "optimized" or "debug" if
  separation is needed (non-prefixed libraries will be considered
  "generic").

- Loop through libraries passed to function and do simple parsing
  which will look for "optimized" and "debug" words and specify
  following library to corresponding category.

This isn't something particularly great. Alternative would be to
use target_link_libraries() directly, which sounds like more code
but which is more explicit and allows to have more flexibility
and control comparing to wrapper approach.

Tested the following configurations on Linux, macOS and Windows:

- make full debug developer
- make full release developer
- make lite debug developer
- make lite release developer

NOTE: Linux libraries needs to be compiled with D6641 applied,
otherwise, depending on configuration, it's possible to run into
duplicated zlib symbols error.

Differential Revision: https://developer.blender.org/D6642
2020-01-23 16:59:18 +01:00
Antonio Vazquez
fb671035be Merge branch 'blender-v2.82-release' 2020-01-23 16:56:26 +01:00
Jacques Lucke
9c9ea37770 Fix: Use a minimal alignment of 8 in MEM_lockfree_mallocN_aligned
`posix_memalign` requires the `alignment` to be at least `sizeof(void *)`.
Previously, `MEM_mallocN_aligned` would simply return `NULL` if a too small
`alignment` was used. This was an OS specific issue.

The solution is to use a minimal alignment of `8` for all aligned allocations.
The unit tests have been extended to test more possible alignments (some
of which were broken before).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D6660
2020-01-23 14:21:48 +01:00
Sebastián Barschkis
ca7bd3f1c3 Fluid: Cleaned up functions that deal with Python objects (C-API)
This commit belongs to T72894. It's related to (my) previous commits on pointer exchanges (today + yesterday). It cleans up the functions by describing their usage in the comments, adds additional nullptr checks, and fixes the reference count responsibilities of newly created PyObjects.
2020-01-22 18:31:19 +01:00
Sebastián Barschkis
be7571a5e4 Fluid: Refactored Mantaflow <-> Blender pointer exchange once more 2020-01-22 16:45:57 +01:00
Patrick Mours
26687dda5a Fix T71344: Optix render errors with motion blur and unknown bone constraint relationship
The OptiX SRT motion expects a motion defined by translation,
rotation, shear and scale, but the matrix decomposition code in
Cycles was not able to extract shear information and instead
produced a stretch matrix with the information baked in. This
caused conflicting transforms between traversal and shading
and lead to render artifacts.
This patch changes the matrix decomposition to produce factors
inline with what OptiX expects to fix that.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6605
2020-01-22 15:49:14 +01:00
Richard Antalik
d51760dc5a Merge branch 'blender-v2.82-release' 2020-01-22 13:41:43 +01:00
Sebastián Barschkis
96fa613639 Fix T73311: Mantaflow > Liquid: Enabling Initial Velocity on Inflow / Outflow crashes Blender 2020-01-22 11:40:04 +01:00
Sebastián Barschkis
c4b5279bbc Fix T72894: Mantaflow: several crashes due to null pointers
Incorporated LazyDodo's suggestions from the task.
2020-01-22 11:17:54 +01:00
Bastien Montagne
676f6a699b Merge branch 'blender-v2.82-release' 2020-01-21 20:10:56 +01:00
Sebastián Barschkis
6c50e82efb Fluid: Refactored the Mantaflow <-> Blender pointer exchange function and switched to from NULL to nullptr in cpp files 2020-01-21 18:31:10 +01:00
2e9d5ba211 GHOST: bundle tablet data with GHOST event
Previously the window manager would receive the GHOST event and then query the
latest tablet data from the window to go along with it. If multiple events were
queued, it would then use too new tablet data for handling older events.

Fixes T62565: tablet pressure not working on macOS with some devices
2020-01-21 12:24:01 +01:00
Campbell Barton
c81549af28 Cleanup: unused vars, clang-format 2020-01-21 20:57:15 +11:00
Lukas Stockner
2210f9c7c8 Merge branch 'blender-v2.82-release' 2020-01-20 23:11:38 +01:00
Lukas Stockner
902209eda5 Partial Fix T73043: Denoising Albedo not working well for Sheen
Similar to the Microfacet Closures, the Principled BSDF Sheen closure is
added at a high weight but typically results in fairly low values.
Therefore, the default weight is a bad indicator of importance.

The fix here is the same as it was back then for Microfacets:
Compute an average weight using the normal as the half-vector
and use it to scale down the sample weight and the albedo channel.

In addition to drastically improving denoising of materials with
sheen when using the new Denoising node, this also can reduce noise
on such materials considerably.
2020-01-20 23:06:08 +01:00
a5270d4cf3 Merge branch 'blender-v2.82-release' 2020-01-20 14:53:14 +01:00
1613c994b0 Fix Cycles not correctly using Background.shader if specified
Based on patch by Alex Fuller.

Differential Revision: https://developer.blender.org/D6627
2020-01-20 14:03:14 +01:00
Sebastián Barschkis
153a96472a Fluid: Fix typo in smoke script 2020-01-20 12:34:38 +01:00
a5a30e485f Merge branch 'blender-v2.82-release' 2020-01-20 09:50:09 +01:00
Brecht Van Lommel
02f6722350 Build: upgrade to OpenEXR 2.4.0, OpenVDB 7.0.0 and Boost 1.70.0
This aligns with the VFX reference platform 2020 along with the decision
to stick to Python 3.7, see T68774.

Blosc was downgraded to 1.5 as recommended by the OpenVDB documentation.

IlmBase and OpenEXR are now built together with CMake rather separately
using autoconf.

Differential Revision: https://developer.blender.org/D6593
2020-01-20 09:43:28 +01:00
Campbell Barton
fb26d25405 Merge branch 'blender-v2.82-release' 2020-01-20 19:22:44 +11:00
Sebastián Barschkis
c7596cd820 Fluid: Improved cache file loading
Cache file loading for mesh and particle files now works through the direct update_structures functions. The final cache mode now also only bakes the most essential files and is therefore not resumable anymore.
2020-01-19 23:44:56 +01:00
OmarSquircleArt
6dc979e2f9 Cycles: Suppress OSL normalize function warnings.
This patch suppress the OSL warnings resulted from ambiguous calls
to the normalize function. This is done by casting to the vector
type before normalizing.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D6621
2020-01-18 19:19:26 +02:00
Stefan Werner
b963745cdf Merge branch 'blender-v2.82-release' 2020-01-16 20:54:11 +01:00
Stefan Werner
6257cdc376 Fix T73064: Embree does not like Bevel shader
Embree's local intersection routine was not prepared
for local intersections without per-object BVH.
Now it should be able to handle any kind of local
intersection, such as AO, bevel and SSS.

Differential Revision: https://developer.blender.org/D6602
2020-01-16 20:42:17 +01:00
Campbell Barton
09122883b2 Merge branch 'blender-v2.82-release' 2020-01-17 02:55:31 +11:00
db33867270 Fix T71952, T70125: Blender Linux crash on startup with some tablets
It's not certain this fixes the issue since I can't reproduce the crash, but
the code was wrong in any case.

Thanks to Ray Molenkamp and Anonymous for finding this.
2020-01-16 16:14:57 +01:00
59d3e4357a Merge branch 'blender-v2.82-release' 2020-01-16 15:52:53 +01:00
Sebastián Barschkis
d4261760c7 Fluid: Fix for mesh velocities
Was using incorrect file format when reading mesh velocities from cache
2020-01-16 15:33:15 +01:00
Lukas Stockner
7f571aad22 Merge branch 'blender-v2.82-release' 2020-01-16 02:21:32 +01:00
Sebastián Barschkis
68462a9419 Fix T73111: Bake data of fluid causes crash of Blender 2020-01-15 17:22:00 +01:00
Sebastián Barschkis
adcc9d014c Fluid: Moved grid reset loop for inner obstacle cells from blenkernel code into Mantaflow
Having this loop in directly Manta is faster and potentially fixes issues T72783 and T72894.
2020-01-15 16:28:56 +01:00
Sebastián Barschkis
2ff3877f71 Fluid: Moved grid reset loop for inner obstacle cells from blenkernel code into Mantaflow
Having this loop in directly Manta is faster and potentially fixes issues T72783 and T72894.
2020-01-15 15:51:49 +01:00