blender-staging.git
5 months agoCleanup: deduplicate OpenVDB library definitions/include/libs logic
Brecht Van Lommel [Wed, 26 Feb 2020 14:11:24 +0000 (15:11 +0100)]
Cleanup: deduplicate OpenVDB library definitions/include/libs logic

This will more important when we start using OpenVDB in more modules.

5 months agoBuild: add compatibility between precompiled libraries and new glibc
Brecht Van Lommel [Tue, 25 Feb 2020 12:05:09 +0000 (13:05 +0100)]
Build: add compatibility between precompiled libraries and new glibc

On Linux, precompiled libraries may be made with a glibc version that is
incompatible with the system libraries that Blender is built on. To solve
this we add a few -ffast-math symbols that can be missing.

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

5 months agoBuild: ignore system paths when using precompiled libraries on Linux
Nathan Craddock [Fri, 21 Feb 2020 05:09:14 +0000 (22:09 -0700)]
Build: ignore system paths when using precompiled libraries on Linux

Based on work by Nathan Craddock, with further changes to apply it to all
precompiled libraries.

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

5 months agoFix T74225: Image (from sequence) cannot be loaded
Philipp Oeser [Wed, 26 Feb 2020 14:55:30 +0000 (15:55 +0100)]
Fix T74225: Image (from sequence) cannot be loaded

If the current frame was not in range, the ImageTile's 'ok' was stuck at
0. Similar to the ImageUser being reset to 'ok' in
BKE_image_user_frame_calc, we now do for ImageTiles as well.

note: the crasher part of T74225 was fixed in rB5c490d437743.

Maniphest Tasks: T74225

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

5 months agoFix T74236: Golden ratio in camera composition guides is not working
Philipp Oeser [Wed, 26 Feb 2020 16:19:15 +0000 (17:19 +0100)]
Fix T74236: Golden ratio in camera composition guides is not working

Caused by 52da1b6e2b54 (where it was switched from a value to a define -
but the define was wrong...)

5 months agoUI: Add Separate to bone and curve edit context menus
William Reynish [Wed, 26 Feb 2020 15:25:25 +0000 (16:25 +0100)]
UI: Add Separate to bone and curve edit context menus

Makes it more consistent with mesh edit mode.

5 months agoFix T74221 Crash when changing Image Source in UV editor
Clément Foucault [Wed, 26 Feb 2020 14:33:44 +0000 (15:33 +0100)]
Fix T74221 Crash when changing Image Source in UV editor

5 months agoEEVEE: Fix crash on certain drivers caused by redefined constant
Clément Foucault [Wed, 26 Feb 2020 13:59:47 +0000 (14:59 +0100)]
EEVEE: Fix crash on certain drivers caused by redefined constant

5 months agoCleanup: don't set renderpass_block twice for volumes
Brecht Van Lommel [Wed, 26 Feb 2020 11:10:41 +0000 (12:10 +0100)]
Cleanup: don't set renderpass_block twice for volumes

5 months agoUI: add kerning menu for 3D text editing
Campbell Barton [Wed, 26 Feb 2020 11:26:40 +0000 (22:26 +1100)]
UI: add kerning menu for 3D text editing

5 months agoCleanup: avoid path copy in XDG support
Campbell Barton [Wed, 26 Feb 2020 10:50:40 +0000 (21:50 +1100)]
Cleanup: avoid path copy in XDG support

5 months agoCleanup: fix compiler warning
Brecht Van Lommel [Wed, 26 Feb 2020 10:51:34 +0000 (11:51 +0100)]
Cleanup: fix compiler warning

5 months agoFix for recent commit removing slashes
Campbell Barton [Wed, 26 Feb 2020 10:34:45 +0000 (21:34 +1100)]
Fix for recent commit removing slashes

The slashed were used for comparing bookmarks to the current directory.

Add trailing slashes in 'fsmenu_insert_entry',
which avoids having to duplicate strings just to add a slash
before passing to this function.

5 months agoCleanup: printf from xdg parsing
Campbell Barton [Wed, 26 Feb 2020 07:42:51 +0000 (18:42 +1100)]
Cleanup: printf from xdg parsing

5 months agoUI: remove check for HOME existing on unix
Campbell Barton [Wed, 26 Feb 2020 07:19:29 +0000 (18:19 +1100)]
UI: remove check for HOME existing on unix

This is such a corner case there is no need to make the UI aware of it.

5 months agoCleanup: remove trailing slash from bookmarks
Campbell Barton [Wed, 26 Feb 2020 07:17:19 +0000 (18:17 +1100)]
Cleanup: remove trailing slash from bookmarks

This isn't needed.

5 months agoUI: Linux platform support for 'user-dirs.dirs'
Campbell Barton [Wed, 26 Feb 2020 07:07:05 +0000 (18:07 +1100)]
UI: Linux platform support for 'user-dirs.dirs'

Originally D6826 by @a.monti with parsing rewritten.

5 months agoBLI_fileops: add utility to read text with newlines set to nil
Campbell Barton [Wed, 26 Feb 2020 07:01:42 +0000 (18:01 +1100)]
BLI_fileops: add utility to read text with newlines set to nil

5 months agoDocs: expand comment on tagging id properties to update
Campbell Barton [Wed, 26 Feb 2020 04:15:56 +0000 (15:15 +1100)]
Docs: expand comment on tagging id properties to update

Addresses issue from T74000.

5 months agoCleanup: spelling
Campbell Barton [Wed, 26 Feb 2020 04:21:32 +0000 (15:21 +1100)]
Cleanup: spelling

5 months agoCleanup: remove unused derived mesh functionality
Campbell Barton [Wed, 26 Feb 2020 03:52:42 +0000 (14:52 +1100)]
Cleanup: remove unused derived mesh functionality

5 months agoCleanup: reduce CDDM use, remove unused function calls
Campbell Barton [Wed, 26 Feb 2020 03:24:57 +0000 (14:24 +1100)]
Cleanup: reduce CDDM use, remove unused function calls

5 months agoCleanup: format, unused var
Campbell Barton [Wed, 26 Feb 2020 03:21:57 +0000 (14:21 +1100)]
Cleanup: format, unused var

5 months agoPyAPI Doc: Add missing Imbuf documentantion
Aaron Carlisle [Wed, 26 Feb 2020 04:16:10 +0000 (23:16 -0500)]
PyAPI Doc: Add missing Imbuf documentantion

The documentation existed but it was never added to the script.

5 months agoFix T74063: Cycles light pass viewport display wrong with saturated colors
Brecht Van Lommel [Tue, 25 Feb 2020 18:51:20 +0000 (19:51 +0100)]
Fix T74063: Cycles light pass viewport display wrong with saturated colors

5 months agoFix T72721: Add visibility flags updates to the PBVH
Pablo Dobarro [Thu, 6 Feb 2020 21:14:18 +0000 (22:14 +0100)]
Fix T72721: Add visibility flags updates to the PBVH

Currently, there its a function that sets manually the fully_hidden flag
of the nodes from the visibility operators in paint_hide.c. The undo
code was not updating the flag, so the visibility state of the nodes was
incorrect after preforming undo operations. This sometimes was drawing
fully hidden nodes with empty buffers, causing artifacts in the
geometry.

I added a function to mark nodes which visibility state changed (similar
as we are updating the mask flags and the nodes bounding boxes). This
way, the tools, operators and undo code don't have to update the
visibility flags, making everything much simpler to understand and
maintain.

I did not remove the flag update code from the current visibility
operators in this patch, but after reimplementing them (and all the new
ones) in the new visibility system, all visibility updates should be
done using this method and the BKE_pbvh_node_fully_hidden_set function
should be removed.

Reviewed By: jbakker

Maniphest Tasks: T72721

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

5 months agoCleanup: Constraints, simplified ChildOf evaluation function
Sybren A. Stüvel [Tue, 25 Feb 2020 17:16:25 +0000 (18:16 +0100)]
Cleanup: Constraints, simplified ChildOf evaluation function

This un-indents the `childof_evaluate()` function by one level, making it
easier to add new functionality in an upcoming commit.

No functional changes.

5 months agoCleanup: Reduced indentation in objectsolver_evaluate()
Sybren A. Stüvel [Tue, 25 Feb 2020 15:17:40 +0000 (16:17 +0100)]
Cleanup: Reduced indentation in objectsolver_evaluate()

This will make an upcoming change cleaner to implement.

No functional changes.

5 months agoConstraints: fixed Object Solver 'Clear Inverse' operator
Sybren A. Stüvel [Tue, 25 Feb 2020 14:44:21 +0000 (15:44 +0100)]
Constraints: fixed Object Solver 'Clear Inverse' operator

The 'Clear Inverse' operator didn't properly update the constraint, so
it didn't do anything until the entire depsgraph was updated. It's now
properly tagged for update.

5 months agoTests: Constraints, enable layer collections before testing
Sybren A. Stüvel [Tue, 25 Feb 2020 15:46:37 +0000 (16:46 +0100)]
Tests: Constraints, enable layer collections before testing

In the collections unit test file developers can now disable layer
collections and declutter the 3D Viewport while working in
`constraints.blend`, without influencing the actual unit tests themselves.

5 months agoCleanup: Silence compilation warnings (unused variables)
Dalai Felinto [Tue, 25 Feb 2020 16:18:25 +0000 (17:18 +0100)]
Cleanup: Silence compilation warnings (unused variables)

5 months agoCleanup: Remove superfluous "cuda_device_ptr" function
Patrick Mours [Tue, 25 Feb 2020 16:10:39 +0000 (17:10 +0100)]
Cleanup: Remove superfluous "cuda_device_ptr" function

5 months agoCleanup: removed runtime error
Jeroen Bakker [Tue, 25 Feb 2020 15:15:03 +0000 (16:15 +0100)]
Cleanup: removed runtime error

The render passes checked all bits of an integer, that can lead to
runtime errors. Added the max bit in the DNA and used this.

5 months agoinstall_deps: fix several issues.
Bastien Montagne [Tue, 25 Feb 2020 14:56:32 +0000 (15:56 +0100)]
install_deps: fix several issues.

Lots of fixes and cleanups, mainly addressing:
* OpenEXR building was fully broken.
* Missing dependencies of Alembic to Boost and openEXR.
* OSL had changed its CMake parameters for custom OpenEXR install path.
* Dependencies between libs were not properly handles when switching a
lib from own build to system package.

5 months agoEEVEE: First Buffer Drawn Incorrectly
Jeroen Bakker [Tue, 25 Feb 2020 14:35:42 +0000 (15:35 +0100)]
EEVEE: First Buffer Drawn Incorrectly

SSS buffers are lazy initialized when needed. When shaders recompile the
SSS buffers could be incorrectly drawn. During the render passes project
we tried to fix this, but that resulted in incorrect result of the first
sample after a shader was compiled.

We revert this change knowing that we know the issue, but haven't found
a proper solution for it.

5 months agoCycles: Add option to change which sample to start viewport denoising at
Patrick Mours [Tue, 25 Feb 2020 12:31:08 +0000 (13:31 +0100)]
Cycles: Add option to change which sample to start viewport denoising at

This patch adds a new user-configurable option to change at which sample viewport
denoising should kick in. Setting it to zero retains previous behavior (start immediately), while
other values will defer denoising until the particular sample has been reached. Default is now
at one, to avoid the weirdness that is AI denoising at small resolutions.

Reviewed By: brecht

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

5 months agoUI: Add theme option for time markers line
Michael Soluyanov [Tue, 25 Feb 2020 14:09:30 +0000 (15:09 +0100)]
UI: Add theme option for time markers line

This patch adds the ability to set colors and alpha of dashed line of
Time Markers. That way themes can avoid contrast issues and communicate
selection better. See screenshots in D6877.

Bumps subversion.

Reviewed By: William Reynish, Julian Eisel

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

5 months agoGPU: Add Image property to allow high bitdepth support on a per image basis
Clément Foucault [Tue, 25 Feb 2020 14:05:53 +0000 (15:05 +0100)]
GPU: Add Image property to allow high bitdepth support on a per image basis

This adds the `Half Float Precision` option in the image property panel.
This option is only available on float textures and is enabled by default.

Adding a flag inside the imbuf (IB_halffloat) on load is done for EXR and PSD formats that can store half floating point (16bits/channels).
The option is then not displayed in this case and forced.

Related task T73086

Reviewed By: brecht

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

5 months agoCleanup: clang-format
Brecht Van Lommel [Tue, 25 Feb 2020 14:11:33 +0000 (15:11 +0100)]
Cleanup: clang-format

5 months agoUI: fix wrong button padding on high DPI displays in a few places
Yevgeny Makarov [Tue, 25 Feb 2020 14:06:51 +0000 (15:06 +0100)]
UI: fix wrong button padding on high DPI displays in a few places

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

5 months agoOcean modifier: fix changes to resolution complete changing the shape
Phil Stopford [Tue, 25 Feb 2020 14:03:47 +0000 (15:03 +0100)]
Ocean modifier: fix changes to resolution complete changing the shape

This takes the idea from the aaOcean library to link the RNG seed to the
surface point, so that changing resolution only adds/remove surface detail.

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

5 months agoConstraints: added unit test for Child Of with bone target
Sybren A. Stüvel [Tue, 25 Feb 2020 13:28:33 +0000 (14:28 +0100)]
Constraints: added unit test for Child Of with bone target

No functional changes.

5 months agoEEVEE: Lookdev: Fix lookdev spheres positioning in viewport render
Clément Foucault [Tue, 25 Feb 2020 13:24:31 +0000 (14:24 +0100)]
EEVEE: Lookdev: Fix lookdev spheres positioning in viewport render

5 months agoEEVEE: Lookdev: Fix cubemap resolution change not refreshing lightcache
Clément Foucault [Tue, 25 Feb 2020 13:08:10 +0000 (14:08 +0100)]
EEVEE: Lookdev: Fix cubemap resolution change not refreshing lightcache

5 months agoOverlay: Fix overlays being washed out by render colors
Clément Foucault [Tue, 25 Feb 2020 12:58:28 +0000 (13:58 +0100)]
Overlay: Fix overlays being washed out by render colors

Clamping here might be a bit too much if output is expected to be HDR.
But we don't support HDR atm so clamping is fine.

5 months agoStart of unit test framework for constraints
Sybren A. Stüvel [Tue, 25 Feb 2020 11:16:34 +0000 (12:16 +0100)]
Start of unit test framework for constraints

Currently this only tests the Child Of constraint. My aim is to cover
constraints with tests before they are refactored/altered.

No functional changes.

5 months agoCleanup: fixed copy-paste error in Object Solver constraint message
Sybren A. Stüvel [Tue, 25 Feb 2020 11:00:24 +0000 (12:00 +0100)]
Cleanup: fixed copy-paste error in Object Solver constraint message

The message was clearly copied from the Child Of constraint, and never
changed to Object Solver.

No functional changes.

5 months agoEEVEE: Lookdev: Add support for partially blurred background
Clément Foucault [Tue, 25 Feb 2020 12:25:49 +0000 (13:25 +0100)]
EEVEE: Lookdev: Add support for partially blurred background

This is using the GGX probe as background. This has the drawback of
having the resolution choosed in the indirect lighting setting.
The blurring is not really high-quality.

The pros is that it has a simple implementation and is fast to evaluate.

This patch also fades the background alpha to make overlay engine draw the
default background color in the correct color space. Removing one colorspace
hack.

Reviewed By: jbakker

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

5 months agoCleanup: EEVEE: Use log2_floor_u
Clément Foucault [Tue, 25 Feb 2020 12:12:52 +0000 (13:12 +0100)]
Cleanup: EEVEE: Use log2_floor_u

5 months agoEEVEE: Fix seams in reflection cubemap on low roughness
Clément Foucault [Tue, 25 Feb 2020 12:12:29 +0000 (13:12 +0100)]
EEVEE: Fix seams in reflection cubemap on low roughness

This was caused by the texture size not being power of 2. Thus the
padding applied to the base LOD did not match the highest mipmaps.

5 months agoFix T74095: crash deleting all faces in edit mode with Cycles rendering
Brecht Van Lommel [Tue, 25 Feb 2020 10:52:32 +0000 (11:52 +0100)]
Fix T74095: crash deleting all faces in edit mode with Cycles rendering

5 months agoCycles: move sss and diffuse transmission into diffuse pass
Brecht Van Lommel [Fri, 14 Feb 2020 11:20:12 +0000 (12:20 +0100)]
Cycles: move sss and diffuse transmission into diffuse pass

This simplifies compositors setups and will be consistent with Eevee render
passes from D6331. There's a continuum between these passes and it's not clear
there is much advantage to having them available separately.

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

5 months agoCleanup: remove cddm_from_bmesh
Campbell Barton [Tue, 25 Feb 2020 10:30:23 +0000 (21:30 +1100)]
Cleanup: remove cddm_from_bmesh

Use BKE_mesh_from_bmesh_for_eval_nomain instead.

5 months agoCleanup: avoid Operator.customdata cast which could lead to errors
Campbell Barton [Tue, 25 Feb 2020 09:32:20 +0000 (20:32 +1100)]
Cleanup: avoid Operator.customdata cast which could lead to errors

Both save and save-as share utility functions which
cast from customdata in an error prone way.

Avoid this by passing image format data directly.

5 months agoFix memory leak saving images
Campbell Barton [Tue, 25 Feb 2020 07:26:26 +0000 (18:26 +1100)]
Fix memory leak saving images

5 months agoDrawEngine: Clean up
Jeroen Bakker [Tue, 25 Feb 2020 06:47:35 +0000 (07:47 +0100)]
DrawEngine: Clean up

Put DefaultFramebufferList and DefaultTextureList into an own header
file. These structs were private, but also used by the window manager
and gpu package. The previous implementation we needed to keep these
structs in sync.

5 months agoImage: support saving images in non-image spaces
Campbell Barton [Tue, 25 Feb 2020 06:05:10 +0000 (17:05 +1100)]
Image: support saving images in non-image spaces

Alternate fix for T74182, making changes to the save-as operator.

5 months agoFix T74182: Crash saving images from non-image spaces
Campbell Barton [Tue, 25 Feb 2020 05:59:57 +0000 (16:59 +1100)]
Fix T74182: Crash saving images from non-image spaces

5 months agoCleanup: move deprecated enum into versioning code
Campbell Barton [Tue, 25 Feb 2020 05:50:06 +0000 (16:50 +1100)]
Cleanup: move deprecated enum into versioning code

5 months agoCleanup: remove unused wmWindow.monitor
Campbell Barton [Mon, 24 Feb 2020 22:25:14 +0000 (09:25 +1100)]
Cleanup: remove unused wmWindow.monitor

5 months agoWM: move cursor refresh tag to the window
Campbell Barton [Mon, 24 Feb 2020 22:19:31 +0000 (09:19 +1100)]
WM: move cursor refresh tag to the window

Avoids having to check the current area is NULL.

5 months agoFix Cycles Embree hair + motion blur failing after recent Catmull-Rom change
Brecht Van Lommel [Mon, 24 Feb 2020 19:29:01 +0000 (20:29 +0100)]
Fix Cycles Embree hair + motion blur failing after recent Catmull-Rom change

Ref T73778

5 months agoFix make deps failing to build opencollada on Linux, due to line endings
Brecht Van Lommel [Mon, 24 Feb 2020 18:21:11 +0000 (19:21 +0100)]
Fix make deps failing to build opencollada on Linux, due to line endings

The OpenCOLLADA package contains a mix of files with unix and dos line endings.
Now we mark the diff as a binary file so that the patch also contains a mix of
line endings that matches the package.

5 months agoFix T74169: Vector Rotate Node - Euler modes not working as intended
Charlie Jolly [Mon, 24 Feb 2020 18:17:19 +0000 (18:17 +0000)]
Fix T74169: Vector Rotate Node - Euler modes not working as intended

Remove additional Euler modes for the time being, not working as intended, will add back if there is a need.

5 months agoFix unnecessary Cycles OptiX kernel loading
Patrick Mours [Mon, 24 Feb 2020 16:53:41 +0000 (17:53 +0100)]
Fix unnecessary Cycles OptiX kernel loading

With the OptiX viewport denoiser active, an OptiX device was added to the device list even when
rendering and denoising on different devices (e.g. CPU or CUDA) in background rendering. This
fixes it, so the OptiX device is only added when actually needed, as in only when OptiX denoising is
actually active in background rendering.

5 months agoFix T74099: Can`t apply modifier, if mesh have fake user.
Bastien Montagne [Mon, 24 Feb 2020 14:01:34 +0000 (15:01 +0100)]
Fix T74099: Can`t apply modifier, if mesh have fake user.

Also cleaned up code there, making a proper poll function for the apply
modifier operator, that way button is properly disabled in UI itself in
most invalid situations.

5 months agoFix unused variable warning on Linux
Julian Eisel [Mon, 24 Feb 2020 13:46:07 +0000 (14:46 +0100)]
Fix unused variable warning on Linux

5 months agoCleanup: Workbench: Remove checkerboard depth
Clément Foucault [Mon, 24 Feb 2020 00:23:55 +0000 (01:23 +0100)]
Cleanup: Workbench: Remove checkerboard depth

This is not needed anymore with the new overlay xray fading.

5 months agoOverlay: Remove Xray dithering noise
Clément Foucault [Mon, 24 Feb 2020 00:19:08 +0000 (01:19 +0100)]
Overlay: Remove Xray dithering noise

We now use a better smoother technique that uses correct alpha blending.
This is possible now that we render overlays in a separate buffer.

5 months agoMantaflow: Address precompiler warning and related cleanup
Julian Eisel [Mon, 24 Feb 2020 11:30:56 +0000 (12:30 +0100)]
Mantaflow: Address precompiler warning and related cleanup

* Address warning because of undefined OPENVDB usage
* Remove unused WITH_FLUID definitions

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

5 months agoFix T74003: Autocomplete bug with mesh.loop_triangles. in Blender Python Console.
Bastien Montagne [Mon, 24 Feb 2020 11:43:24 +0000 (12:43 +0100)]
Fix T74003: Autocomplete bug with mesh.loop_triangles. in Blender Python Console.

The collection property `loop_triangles` was given the RNA type
`MeshLoopTriangle` (the type of the collection's items), instead
of `MeshLoopTriangles` (the actual expected RNA collection/array type).

The cutest, tiniest typo mistake in RNA code, leading to some complete
non-sense... It's fairly amazing that this did not cause more severe
issues actually.

5 months agoBLF: Optimize text rendering and caching
Germano Cavalcante [Sun, 23 Feb 2020 20:30:27 +0000 (17:30 -0300)]
BLF: Optimize text rendering and caching

The current code allocates and transfers a lot of memory to the GPU,
but only a small portion of this memory is actually used.
In addition, the code calls many costly gl operations during the
caching process.

This commit significantly reduce the amount of memory by allocating
and transferring a flat array without pads to the GPU.
It also calls as little as possible the gl operations during the cache.

This code also simulate a billinear filter `GL_LINEAR` using a 1D texture.

**Average drawing time:**
|before:|0.00003184 sec
|now:|0.00001943 sec
|fac:|1.6385156675048407

**5 worst times:**
|before:|[0.001075, 0.001433, 0.002143, 0.002915, 0.003242]
|now:|[0.00094, 0.000993, 0.001502, 0.002284, 0.002328]

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

5 months agoFix T73912: Highlight selected face option causes faces to fade out
Campbell Barton [Mon, 24 Feb 2020 05:01:55 +0000 (16:01 +1100)]
Fix T73912: Highlight selected face option causes faces to fade out

Recent changes to color mixing require updates to the theme,
light overlays need to have their alpha reduced.

5 months agoOverlay: Edit Mode: Fix wireframes being brighter because of linear blend
Clément Foucault [Sun, 23 Feb 2020 23:00:10 +0000 (00:00 +0100)]
Overlay: Edit Mode: Fix wireframes being brighter because of linear blend

5 months agoUI: Remove Width/Percentage control from Bevel tool settings
William Reynish [Sun, 23 Feb 2020 15:52:43 +0000 (16:52 +0100)]
UI: Remove Width/Percentage control from Bevel tool settings

Since this control is set as you drag in the viewport anyway, this amount value is effectively useless.

It was only recently added by mistake with the Bevel GSOC.

5 months agoOverlay: Fix wireframes being brighter because of color management
Clément Foucault [Sun, 23 Feb 2020 13:32:34 +0000 (14:32 +0100)]
Overlay: Fix wireframes being brighter because of color management

Also change the blending factors to make wireframe a bit darker in
unselected cases.

5 months agoEEVEE: Fix memleak when G.is_break is set from another thread
Clément Foucault [Sat, 22 Feb 2020 16:08:37 +0000 (17:08 +0100)]
EEVEE: Fix memleak when G.is_break is set from another thread

5 months agoCleanup: EEVEE: Use interpf instead of custom lerp
Clément Foucault [Sat, 22 Feb 2020 15:48:16 +0000 (16:48 +0100)]
Cleanup: EEVEE: Use interpf instead of custom lerp

5 months agoFix crash when open default template
Antonio Vazquez [Sat, 22 Feb 2020 15:20:08 +0000 (16:20 +0100)]
Fix crash when open default template

As soon you select the default template, Blender crash on Winodws.

This was introduced in commit {0b626703}

5 months agoCleanup: internal changes to cursor resetting
Campbell Barton [Fri, 21 Feb 2020 23:41:19 +0000 (10:41 +1100)]
Cleanup: internal changes to cursor resetting

- Move gizmo cursor check into ED_region_cursor_set so the result of
  calling this function is the same as flagging for cursor update.

- Use tagging in ui_popup_block_remove which avoids adding a
  mouse-move event in case the cursor needs to be changed again.

5 months agoAudaspace: Various fixes
Sergey Sharybin [Thu, 20 Feb 2020 10:25:25 +0000 (11:25 +0100)]
Audaspace: Various fixes

- Fixed uninitialized result used in DynamicMusic::seek().

  The comment to this function says false is returned if the handle
  is invalid, while in practice non-initialized value will be returned.

- Spelling typos in comment.

- Silence -Wdelete-non-abstract-non-virtual-dtor warning.

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

5 months agoUI: Windows File Attributes and Hidden Items
Harley Acheson [Fri, 21 Feb 2020 16:18:29 +0000 (08:18 -0800)]
UI: Windows File Attributes and Hidden Items

File Browser using Windows file attributes for decorating and hiding items.

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

Reviewed by Campbell Barton

5 months agoCleanup: remove unused ScreenAnimData.refresh
Campbell Barton [Fri, 21 Feb 2020 16:00:23 +0000 (03:00 +1100)]
Cleanup: remove unused ScreenAnimData.refresh

5 months agoFix T73593: Drivers on hide_viewport and hide_render are unreliable
Sybren A. Stüvel [Fri, 21 Feb 2020 15:41:19 +0000 (16:41 +0100)]
Fix T73593: Drivers on hide_viewport and hide_render are unreliable

This fixes a threading issue (T73593) between drivers that write to the
same memory address. Driver nodes in the depsgraph now get relations to
each other in order to ensure serialisation.

These relations are only added between drivers that target the same
struct in RNA, which is determined by removing everything after the last
period. For example, a driver with data path
`pose.bones["Arm_L"].rotation_euler[2]` will be grouped with all other
drivers on that datablock with a data path that starts with
`pose.bones["Arm_L"]` to form a 'driver group'.

To find a suitable relation within such a driver group, say the relation
(from → to), a depth-first search is performed (turned out to be
marginally faster than a breadth-first in my test case) to see whether
this will create a cycle, and to see whether there already is such a
connection (direct or transitive). This is done by recursively
inspecting the incoming connections of the 'to' node and thereby walking
from it towards the 'from' node. This is an order of magnitde faster
than inspecting the outgoing connections of the 'from' node.

This approach generalises the special case for array properties, so the
code to support that special case has been removed from
`DepsgraphRelationBuilder::build_animdata_drivers()`.

A test on the Spring rig [1] shows that this process adds approximately
8% to the build time of the dependency graph. In my test case, it takes
28 ms for this process on a total 329 ms construction time. However,
since it also made some code obsolete, it only adds 24 ms (=8%) to the
construction time. I have experimented with a simple cache to keep track
of known-connected (from, to) node pairs, but this did not significantly
improve the timing.

Note that animation data and drivers are already connected by a
relation, which means that animating a field and also changing it with a
driver will not cause conflicts.

[1] https://cloud.blender.org/p/spring/5d30a1076249366fa1939cf1

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

Reviewed By: sergey, mont29

5 months agoCleanup: un-indent ED_screen_set_active_region
Campbell Barton [Fri, 21 Feb 2020 15:41:49 +0000 (02:41 +1100)]
Cleanup: un-indent ED_screen_set_active_region

Also remove redundant flag assignment from previous comment.

5 months agoFix regression in the orientation of transform Redo operations
Germano Cavalcante [Fri, 21 Feb 2020 15:19:55 +0000 (12:19 -0300)]
Fix regression in the orientation of transform Redo operations

Caused by rBb3abd2e102df

5 months agoCleanup: avoid looping over areas when refreshing the cursor
Campbell Barton [Fri, 21 Feb 2020 15:13:10 +0000 (02:13 +1100)]
Cleanup: avoid looping over areas when refreshing the cursor

These values are already known, pass in as arguments.

5 months agoFix T67805: Cursor doesn't update when switching tools via shortcuts
Campbell Barton [Fri, 21 Feb 2020 14:59:36 +0000 (01:59 +1100)]
Fix T67805: Cursor doesn't update when switching tools via shortcuts

5 months agoFluid: Fix typo in fluid RNA
Sebastián Barschkis [Fri, 21 Feb 2020 14:32:24 +0000 (15:32 +0100)]
Fluid: Fix typo in fluid RNA

Fix typo in fluid RNA.

5 months agoFluid: Cleanup in cache delete function
Sebastián Barschkis [Fri, 21 Feb 2020 14:30:52 +0000 (15:30 +0100)]
Fluid: Cleanup in cache delete function

Removed unneccessary calls to BLI_exists() as BLI_delete() does this implicitly.

5 months agoFluid: Updated manta pp files
Sebastián Barschkis [Fri, 21 Feb 2020 14:29:32 +0000 (15:29 +0100)]
Fluid: Updated manta pp files

Updates include:
- A fix from Jacques that changed the loop order in the mesh creation function (the fix speeds up the function significantly due to fewer cache misses).
- Some of the grid copy helper functions are now multithreaded.
- A fix for Windows file IO. Now it possible to load files with non ASCII characters on Windows too.

5 months agoCleanup: Move transform_mode_init to transform_mode API
Germano Cavalcante [Fri, 21 Feb 2020 13:42:56 +0000 (10:42 -0300)]
Cleanup: Move transform_mode_init to transform_mode API

5 months agoFix T74006: Alt+ clicking (assign to all selected) doesn not work for
Philipp Oeser [Thu, 20 Feb 2020 11:36:59 +0000 (12:36 +0100)]
Fix T74006: Alt+ clicking (assign to all selected) doesn not work for
bone constraints settings

'UI_context_copy_to_selected_list()' was working fine for constraints on
objects (would properly get the path and list of selected objects) and
also for bone settings (would properly get the path and list of bones).

There was no special case for constraints on bones though, so code would
work on selected objects (not selected bones).

So we now get the right bones and resolve the path to the constraint
setting _from the bones_.

Maniphest Tasks: T74006

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

5 months agoFix T74044: Switching from Edge Slide to Move and Cancelling causes crash
Germano Cavalcante [Fri, 21 Feb 2020 13:04:45 +0000 (10:04 -0300)]
Fix T74044: Switching from Edge Slide to Move and Cancelling causes crash

`TFM_TRANSLATION` was removed in rBa33b261473e9 but is still needed.

5 months agoTransform: Fix reinitialization of custom data correction
Germano Cavalcante [Fri, 21 Feb 2020 13:03:30 +0000 (10:03 -0300)]
Transform: Fix reinitialization of custom data correction

5 months agoFix: Drivers on hide_viewport and hide_render throw warnings
Sybren A. Stüvel [Fri, 21 Feb 2020 10:16:59 +0000 (11:16 +0100)]
Fix: Drivers on hide_viewport and hide_render throw warnings

This partially fixes T73593.

The `add_relation(driver_key, property_entry_key, ...);` call can fail
in the following situation:

- A collection is linked, and instanced into the scene by an Empty.
- The collection contains an object with a driver on its `hide_render` or
  `hide_viewport` property.

As the object doesn't exist as a real object in the scene, it's added with
`base_index=-1` to the depsgraph (see `DepsgraphNodeBuilder::build_collection()`).
As a result the node for syncing the restrictflags back to the base
isn't present in the depsgraph, and the `add_relation()` call failed.

This commit fixes the warning, simply by not attempting to add the
offending relation.

5 months agoEEVEE: Render Passes
Jeroen Bakker [Thu, 20 Feb 2020 13:53:53 +0000 (14:53 +0100)]
EEVEE: Render Passes

This patch adds new render passes to EEVEE. These passes include:

* Emission
* Diffuse Light
* Diffuse Color
* Glossy Light
* Glossy Color
* Environment
* Volume Scattering
* Volume Transmission
* Bloom
* Shadow

With these passes it will be possible to use EEVEE effectively for
compositing. During development we kept a close eye on how to get similar
results compared to cycles render passes there are some differences that
are related to how EEVEE works. For EEVEE we combined the passes to
`Diffuse` and `Specular`. There are no transmittance or sss passes anymore.
Cycles will be changed accordingly.

Cycles volume transmittance is added to multiple surface col passes. For
EEVEE we left the volume transmittance as a separate pass.

Known Limitations

* All materials that use alpha blending will not be rendered in the render
  passes. Other transparency modes are supported.
* More GPU memory is required to store the render passes. When rendering
  a HD image with all render passes enabled at max extra 570MB GPU memory is
  required.

Implementation Details

An overview of render passes have been described in
https://wiki.blender.org/wiki/Source/Render/EEVEE/RenderPasses

Future Developments

* In this implementation the materials are re-rendered for Diffuse/Glossy
  and Emission passes. We could use multi target rendering to improve the
  render speed.
* Other passes can be added later
* Don't render material based passes when only requesting AO or Shadow.
* Add more passes to the system. These could include Cryptomatte, AOV's, Vector,
  ObjectID, MaterialID, UV.

Reviewed By: Clément Foucault

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

5 months agoCodesign: Make file watcher robust for network errors
Sergey Sharybin [Fri, 21 Feb 2020 10:00:11 +0000 (11:00 +0100)]
Codesign: Make file watcher robust for network errors

5 months agoCleanup: Spelling in a comment
Sergey Sharybin [Fri, 21 Feb 2020 09:49:58 +0000 (10:49 +0100)]
Cleanup: Spelling in a comment

5 months agoCodesign: Remove archive with files after they were copied
Sergey Sharybin [Fri, 21 Feb 2020 08:31:24 +0000 (09:31 +0100)]
Codesign: Remove archive with files after they were copied