16 months agoCleanup: add doxy sections for event queue handling
Campbell Barton [Thu, 21 May 2020 02:15:32 +0000 (12:15 +1000)]
Cleanup: add doxy sections for event queue handling

The main function to handle events didn't have it's own section.

16 months agoCleanup: add asserts for textview drawing
Campbell Barton [Thu, 21 May 2020 02:05:33 +0000 (12:05 +1000)]
Cleanup: add asserts for textview drawing

This would have prevented T74298.

16 months agoOverlay: Wireframe: Add visualization for Hairs in wireframe mode
Clément Foucault [Wed, 20 May 2020 19:47:42 +0000 (21:47 +0200)]
Overlay: Wireframe: Add visualization for Hairs in wireframe mode

This only works for particle systems for now.

Fix T61928 Wireframe mode hair not visible

16 months agoFix T76916: Cycles missing deform motion blur for shape key + subdiv modifier
Brecht Van Lommel [Wed, 20 May 2020 15:54:47 +0000 (17:54 +0200)]
Fix T76916: Cycles missing deform motion blur for shape key + subdiv modifier

16 months agoFix T76909 GPencil: Layers with mask(s) invisible when using "in front"
Clément Foucault [Wed, 20 May 2020 15:48:14 +0000 (17:48 +0200)]
Fix T76909 GPencil: Layers with mask(s) invisible when using "in front"

The gpSceneDepthTexture is using a dummy 1px texture which was generating
wrong values for uvs when sampling gpMaskTexture.

Use the max size of both since any of the 2 can use dummy texture.

16 months agoUI: Fix Wideline AA for timeline
Clément Foucault [Wed, 20 May 2020 15:03:06 +0000 (17:03 +0200)]
UI: Fix Wideline AA for timeline

16 months agoFix T75197: Eevee does not render instanced smoke
Jacques Lucke [Wed, 20 May 2020 14:55:43 +0000 (16:55 +0200)]
Fix T75197: Eevee does not render instanced smoke

This check was introduced in rBc8005703f298, but does not
seem necessary anymore.

Reviewers: fclem, sebbas, brecht

Differential Revision:

16 months agoCycles: Fix rendering instanced smoke domain.
Jacques Lucke [Wed, 20 May 2020 14:53:28 +0000 (16:53 +0200)]
Cycles: Fix rendering instanced smoke domain.

The problem was that Cycles would store a pointer to an object in
`DEGObjectIterData->templ_dupli_object`. This pointer was then accessed
when the iterator was already freed.

Reviewers: brecht

Differential Revision:

16 months agoFix T73979: Wrong location of fluid mesh when domain origin is not in center
Jacques Lucke [Wed, 20 May 2020 14:52:03 +0000 (16:52 +0200)]
Fix T73979: Wrong location of fluid mesh when domain origin is not in center

Reviewers: sebbas

Differential Revision:

16 months agoFluid: Fix for non-moving liquid particles
Sebastián Barschkis [Wed, 20 May 2020 14:37:29 +0000 (16:37 +0200)]
Fluid: Fix for non-moving liquid particles

Issue was introduced in 7bb3d9787ead with new Mantaflow files from 61280e5af3da.

16 months agoFix T70948: Library Override: Parenting library override objects does not save offset...
Bastien Montagne [Wed, 20 May 2020 13:30:28 +0000 (15:30 +0200)]
Fix T70948: Library Override: Parenting library override objects does not save offset from parent.

Parent inverse matrix needs to be overridable as well...

16 months agoFix T75457: Toggle brushes using same hotkey twice is broken
Philipp Oeser [Tue, 19 May 2020 07:47:13 +0000 (09:47 +0200)]
Fix T75457: Toggle brushes using same hotkey twice is broken

Caused by rB47da01a4db1d.

Above commit did not change the toolname it was setting when the brush
was actually toggled.

Maniphest Tasks: T75457

Differential Revision:

17 months agoFix T76794: Number button cursor overrides eyedropper cursor
Campbell Barton [Wed, 20 May 2020 12:04:59 +0000 (22:04 +1000)]
Fix T76794: Number button cursor overrides eyedropper cursor

Pressing 'E' over a number button to pick a distance was keeping
left-right arrows instead of using the eye-dropper cursor.

Workaround this by clearing the active button before setting the cursor.

17 months agoFix color picker being used for non-color buttons such as rotation
Campbell Barton [Wed, 20 May 2020 12:04:51 +0000 (22:04 +1000)]
Fix color picker being used for non-color buttons such as rotation

Issue raised in T76794

17 months agoFix T76883: Zero users scenes after undo.
Bastien Montagne [Wed, 20 May 2020 08:39:50 +0000 (10:39 +0200)]
Fix T76883: Zero users scenes after undo.

Some tags need to be preserved when we reuse existing ID entirely.
AFAICT, currently this is only the EXTRAUSER one.

17 months agoFix T74298: Incorrect cursor position in Python console
Campbell Barton [Wed, 20 May 2020 08:05:09 +0000 (18:05 +1000)]
Fix T74298: Incorrect cursor position in Python console

17 months agoFix the current pixelsize impacting thumbnails
Campbell Barton [Wed, 20 May 2020 04:58:57 +0000 (14:58 +1000)]
Fix the current pixelsize impacting thumbnails

17 months agoCorrect invalid limits in last commit
Campbell Barton [Wed, 20 May 2020 03:48:25 +0000 (13:48 +1000)]
Correct invalid limits in last commit

17 months agoFix T75977: Lower the merge limit in the bisect/mirror operation in symmetrize
Pablo Dobarro [Mon, 18 May 2020 22:12:05 +0000 (00:12 +0200)]
Fix T75977: Lower the merge limit in the bisect/mirror operation in symmetrize

This operation is using the code of the mirror modifier, so no default
is guaranteed to work in all cases. This value matches the defaults of
the mirror modifier.

Reviewed By: jbakker

Maniphest Tasks: T75977

Differential Revision:

17 months agoCleanup: compiler warning
Brecht Van Lommel [Tue, 19 May 2020 23:15:08 +0000 (01:15 +0200)]
Cleanup: compiler warning

17 months agoFix Cycles viewport render fully restarting after undo
Brecht Van Lommel [Tue, 19 May 2020 23:11:42 +0000 (01:11 +0200)]
Fix Cycles viewport render fully restarting after undo

With the optimized undo datablock pointers remain the same, so Cycles can now
update just the parts that changed.

17 months agoFix T76858: non-thread safe sculpt memory allocation when using --debug-memory
Brecht Van Lommel [Tue, 19 May 2020 22:31:21 +0000 (00:31 +0200)]
Fix T76858: non-thread safe sculpt memory allocation when using --debug-memory

By default the guarded memory allocator is not thread safe, that needs to be

17 months agoFix PBVH parallel range not initializing user data correctly in some cases
Brecht Van Lommel [Tue, 19 May 2020 20:44:51 +0000 (22:44 +0200)]
Fix PBVH parallel range not initializing user data correctly in some cases

This was already changed for the TBB-based BLI_task_parallel_range in master.
This task local storage should always be initialized from the template, not
copied from another task which may be executing at the time the copy happens.

This may not fix any actual bug, we only use this user data for parallel reduce
and it's not clear that TBB ever calls the copy constructor for that case.

Ref T76858

17 months agoFix unnecessary buffer reallocation in sculpt mode, causing an assert
Brecht Van Lommel [Tue, 19 May 2020 19:27:10 +0000 (21:27 +0200)]
Fix unnecessary buffer reallocation in sculpt mode, causing an assert

Probably did not cause an actual, the assert is a performance warning.

Ref T76858

17 months agoFix T75383:Bevel weird behaviour when using bevel weights
Hans Goudey [Tue, 19 May 2020 20:40:40 +0000 (16:40 -0400)]
Fix T75383:Bevel weird behaviour when using bevel weights

Don't use the cube corner special case when the offsets are different
for the three edges involved. The generic VMesh for this situation isn't
perfect, but it's much better than a failed cube corner VMesh.

Tests pass.

17 months agoUI: Make timeline vertical bars thickness work on OSX
Clément Foucault [Tue, 19 May 2020 20:41:04 +0000 (22:41 +0200)]
UI: Make timeline vertical bars thickness work on OSX

Make use of Polyline shader.

17 months agoGPU: Attempt to fix Crash on startup with Intel HD Graphics 620/630
Clément Foucault [Tue, 19 May 2020 20:24:03 +0000 (22:24 +0200)]
GPU: Attempt to fix Crash on startup with Intel HD Graphics 620/630

This only enables the workarounds that we know have effects on intels.
We could add the other workarounds if needed.

Related task T72098

17 months agoFix T76080 Workbench: Background Glitches caused by Screen Cavity effect
Clément Foucault [Tue, 19 May 2020 19:37:33 +0000 (21:37 +0200)]
Fix T76080 Workbench: Background Glitches caused by Screen Cavity effect

17 months agoFix T73594: Scale Cage sometimes has incorrect center in edit mode
Germano Cavalcante [Tue, 19 May 2020 19:29:31 +0000 (16:29 -0300)]
Fix T73594: Scale Cage sometimes has incorrect center in edit mode

Differential Revision:

17 months agoFix T66916 UI: Wrong information in Status bar after cancelling a render
Clément Foucault [Tue, 19 May 2020 19:15:41 +0000 (21:15 +0200)]
Fix T66916 UI: Wrong information in Status bar after cancelling a render

Fixed thanks to @manowii

17 months agoFix T76812: [Mantaflow] Inflow particles not continuous
Sebastián Barschkis [Tue, 19 May 2020 19:12:22 +0000 (21:12 +0200)]
Fix T76812: [Mantaflow] Inflow particles not continuous

Makes use of the new particle skipping option introduced in f25a882955cb.

17 months agoFluid: Updated Mantaflow source files
Sebastián Barschkis [Tue, 19 May 2020 19:09:43 +0000 (21:09 +0200)]
Fluid: Updated Mantaflow source files

Includes changes for particle skipping during advection.

17 months agoFix T76564 Curve: Missing orco cause mesh to not render
Clément Foucault [Tue, 19 May 2020 19:00:55 +0000 (21:00 +0200)]
Fix T76564 Curve: Missing orco cause mesh to not render

17 months agoFix T73847 Overlay: Camera orthographic scale moves background image
Clément Foucault [Tue, 19 May 2020 14:29:13 +0000 (16:29 +0200)]
Fix T73847 Overlay: Camera orthographic scale moves background image

17 months agoClarify autokeyframe tootip
Philipp Oeser [Tue, 19 May 2020 11:48:17 +0000 (13:48 +0200)]
Clarify autokeyframe tootip

This applies to masks as well.

Spotted while looking into T76872.

Differential Revision:

17 months agoFix: build error due to missing definitions
Jacques Lucke [Tue, 19 May 2020 15:36:40 +0000 (17:36 +0200)]
Fix: build error due to missing definitions

Reviewers: sergey, brecht

Differential Revision:

17 months agoFix T74577: world_to_camera_view broken for off-axis projection
Sebastian Parborg [Tue, 19 May 2020 14:23:44 +0000 (16:23 +0200)]
Fix T74577: world_to_camera_view broken for off-axis projection

The issue was that the projection would be inverted.
So if you shifted 0.1 along the y axis, world_to_camera_view would act
as if you had shited it -0.1 along the y axis.

17 months agoFix T76697: [Mantaflow] mesh generation does not account for some particles
Sebastián Barschkis [Tue, 19 May 2020 14:02:38 +0000 (16:02 +0200)]
Fix T76697: [Mantaflow] mesh generation does not account for some particles

Adapted mesh generation to account for domains with disabled fractionstoo.

17 months agoFix T72889: Cycles camera motion blur not usng more than 2 steps
Josh Belanich [Tue, 19 May 2020 00:51:27 +0000 (02:51 +0200)]
Fix T72889: Cycles camera motion blur not usng more than 2 steps

Differential Revision:

17 months agoAnimation: Make dopesheet filter labels consistent
Sybren A. Stüvel [Tue, 19 May 2020 12:58:24 +0000 (14:58 +0200)]
Animation: Make dopesheet filter labels consistent

There are three different label styles for the three Dopesheet filter

- "Display Hidden", which uses "Display" rather than "Show" as the other
  two options.
- "Show Errors", which does not use the word "only" to indicate it will
  hide all the non-error channels.
- "Only Selected", so no "show" or "display" in the label at all.

This commit changes:
- Always use the word "Show", not "Display".
- Always use the word "Only" when enabling the filter hides everything

Reviewed By: billreynish

Differential Revision:

17 months agoFix T76375: UDIM Rectangular Tiled Image EEVEE freezes Blender
Jeroen Bakker [Tue, 19 May 2020 13:20:09 +0000 (15:20 +0200)]
Fix T76375: UDIM Rectangular Tiled Image EEVEE freezes Blender

When packing the image the height of the tile was checked to the width
of the packing area. This resulted that the tile was ignored.

Reviewed By: Clément Foucault

Differential Revision:

17 months agoFix T76881: Changing "Use Speed Vectors" deletes all existing cache
Jacques Lucke [Tue, 19 May 2020 13:17:54 +0000 (15:17 +0200)]
Fix T76881: Changing "Use Speed Vectors" deletes all existing cache

Reviewers: sebbas

17 months agoFix build error after 30cbbccc6002
Philipp Oeser [Tue, 19 May 2020 13:14:05 +0000 (15:14 +0200)]
Fix build error after 30cbbccc6002

That part only applies to master, sorry for the noise

17 months agoFix T76694: Fluid cache is deleted when changing Upres Factor
Jacques Lucke [Tue, 19 May 2020 13:12:07 +0000 (15:12 +0200)]
Fix T76694: Fluid cache is deleted when changing Upres Factor

Reviewers: sebbas

17 months agoFix (unreported) UV shadow not drawing smooth
Philipp Oeser [Mon, 18 May 2020 08:41:02 +0000 (10:41 +0200)]
Fix (unreported) UV shadow not drawing smooth

When showing UV edges after modifiers [draw_uvs_shadow], these were never
drawn anti-aliased [in contrast to the 'main' UVs].

Also: they did not respect the new 'UV Opacity' setting.

Differential Revision:

17 months agoFix T75694: Compositor Backdrop boundbox missing updates
Philipp Oeser [Mon, 18 May 2020 14:37:00 +0000 (16:37 +0200)]
Fix T75694: Compositor Backdrop boundbox missing updates

This adds notifiers for backimage_move & backimage_fit.

Maniphest Tasks: T75694

Differential Revision:

17 months agoFix T76541: OpenGl Depth Picking not selecting frontmost object
Sebastian Parborg [Thu, 14 May 2020 11:43:09 +0000 (13:43 +0200)]
Fix T76541: OpenGl Depth Picking not selecting frontmost object

The issue was that we used GL_ALWAYS for depth checking here which would
lead to the depth information from objects being messed up.

It would not represent which object was closest to the camera.

Reviewed By: Clément Foucault, Jeroen Bakker, Campbell Barton

Differential Revision:

17 months agoFix T76717: Set Rotation Mode Incorrectly Recalculates Bone Rotation In Pose Mode
Sebastian Parborg [Wed, 13 May 2020 14:27:05 +0000 (16:27 +0200)]
Fix T76717: Set Rotation Mode Incorrectly Recalculates Bone Rotation In Pose Mode

The issue was that we didn't convert the current rotational values.
We simply just switched mode without doing any data conversions.

17 months agoFix Frame Dropping not dropping the correct amount of frames
Sebastian Parborg [Tue, 12 May 2020 11:19:20 +0000 (13:19 +0200)]
Fix Frame Dropping not dropping the correct amount of frames

Previously the playback mode "Frame Dropping" would not drop the correct
number of frames which would lead to slow playback.

For example, the playback target is 60fps.  However we can only muster
around 32 fps.

The delta frames from the last step is in this case ~1.98 or so.

With the previous code, we would floor this.  That would lead us to step
forward one frame each time, effectively playing back the animation at
half the speed as we will try to render every frame.

To fix this we simply save the remaining fraction from the previous
frame and use it to compute the current frame step.

Reviewed By: Sybren

Differential Revision:

17 months agoMade pose push/relax to breakdown behave smooth on rotations
Sebastian Parborg [Thu, 23 Apr 2020 12:11:15 +0000 (14:11 +0200)]
Made pose push/relax to breakdown behave smooth on rotations

A follow up to T67212. I missed that the rotation interpolation had its
own code path.

The previous rotation push code was actually wrong (but smooth).

Now all of the actions behave correctly and is smoothly interpolated.

17 months agoFix T72729: Mask Modifier Loose Edges Not Shown
Jeroen Bakker [Mon, 18 May 2020 09:11:13 +0000 (11:11 +0200)]
Fix T72729: Mask Modifier Loose Edges Not Shown

When using the mask modifier loose edges could be added to the mesh.
These edges weren't marked as loose edges and wasn't picked up by other
areas of blender.

This fix recalculates the loose edges so they have the correct flag

Reviewed By: Sybren Stüvel

Differential Revision:

17 months agoFix T76865: Vertex paint draws hidden but cannot be painted onto
Campbell Barton [Tue, 19 May 2020 07:53:26 +0000 (17:53 +1000)]
Fix T76865: Vertex paint draws hidden but cannot be painted onto

17 months agoCMake: Enable WITH_USD by default
Sybren A. Stüvel [Tue, 19 May 2020 07:39:03 +0000 (09:39 +0200)]
CMake: Enable WITH_USD by default

Having USD disabled by default was an oversight, and could have been
corrected earlier. It's already enabled by default in the
`blender_release.cmake` and `blender_full.cmake`.

17 months agoFix T76689: Armature layers not indicating the existence of bones
Sybren A. Stüvel [Tue, 12 May 2020 16:22:14 +0000 (18:22 +0200)]
Fix T76689: Armature layers not indicating the existence of bones

From what I can see, there are two issues at play in {T76689} and its merged-in report {T76590}:

- In Blender ≤ 2.79 the bone layer dots were updated in the draw code. This ensured the info was up to date before drawing. This is no longer possible, as the drawing code uses evaluated objects, and those should not be written to. This has been addressed in rB709f126e8143 by calling the update function explicitly in various places in the code. The problem is that this wasn't added to all necessary spots.
- When in edit mode, changes are made to the edit bones but not to the 'actual' bones (this is synced when exiting edit mode). This causes undo to mess up the layer indicators.

I think both issues can be addressed by having the dependency graph update the used layer info as part of the armature evaluation. This will make the undo system work properly, and allows the removal of some `BKE_armature_refresh_layer_used()` from various places.

There is still the issue that there are two functions (`BKE_armature_refresh_layer_used()` and `ED_armature_edit_refresh_layer_used()`) that are both responsible for updating `bArmature::layer_used`. This is a trickier thing to solve, though, as the definition of the `EditBone` struct resides in the armature editor module. This means that blenkernel can't iterate over edit bones, but on the other hand the dependency graph shouldn't call any editor functions either. This is why I left the `ED_armature_edit_refresh_layer_used()` calls untouched.

The downside of recalculating `layer_used` from the dependency graph (at least in the way that I did it now) is that it is called every time a user moves a bone in pose mode. This frequency of updates is not necessary.

Differential Revision:

17 months agoFix T76780: Freestyle pass for one scene not accessible in compositor in other scenes
Jeroen Bakker [Mon, 18 May 2020 13:06:03 +0000 (15:06 +0200)]
Fix T76780: Freestyle pass for one scene not accessible in compositor in other scenes

Current implementation would update the nodetree of the freestyle scene not the composite scene.

Reviewed By: Dalai Felinto

Differential Revision:

17 months agoFix T73169: Side by Side Stereo Rendering Glitches
Jeroen Bakker [Mon, 18 May 2020 14:23:33 +0000 (16:23 +0200)]
Fix T73169: Side by Side Stereo Rendering Glitches

Side by side and top down views were rendered using an unset matrix.
This fix will reset the matrix just before copying the views to the

Reviewed By: Clément Foucault, Dalai Felinto

Differential Revision:

17 months agoCleanup: Creator Args Spelling
Aaron Carlisle [Tue, 19 May 2020 04:54:37 +0000 (00:54 -0400)]
Cleanup: Creator Args Spelling

Differential Revision:

17 months agoFix T76821: Generalize Use Flow Tooltip
Aaron Carlisle [Tue, 19 May 2020 04:53:59 +0000 (00:53 -0400)]
Fix T76821: Generalize Use Flow Tooltip

17 months agoFix switching to particle edit-mode from editmode
Campbell Barton [Tue, 19 May 2020 03:26:21 +0000 (13:26 +1000)]
Fix switching to particle edit-mode from editmode

Similar to T76859

17 months agoFix T76859: Cannot switch from editmode to texturepaint mode
Philipp Oeser [Tue, 19 May 2020 03:17:26 +0000 (13:17 +1000)]
Fix T76859: Cannot switch from editmode to texturepaint mode

Caused by 5159b8e1eadb.

17 months agoFix sculpt mask interpolation in subdivisions
Pablo Dobarro [Mon, 18 May 2020 23:31:26 +0000 (01:31 +0200)]
Fix sculpt mask interpolation in subdivisions

The interpolation function of the datalayer was misssing so the sculpt
mask data was corrupted every time a subdivision surface modifier was

Reviewed By: jbakker

Differential Revision:

17 months agoFix T76397: Missing value property on Clear Mask pie menu
Pablo Dobarro [Tue, 12 May 2020 01:39:10 +0000 (03:39 +0200)]
Fix T76397: Missing value property on Clear Mask pie menu

Without this value defined it was reusing the same 1.0 value after using
fill mask, so it was not working.

Reviewed By: jbakker

Maniphest Tasks: T76397

Differential Revision:

17 months agoFix: T71040 / T58983 Ocean Modifier crashes at high resolutions
Ray Molenkamp [Mon, 18 May 2020 22:35:53 +0000 (16:35 -0600)]
Fix: T71040 / T58983 Ocean Modifier crashes at high resolutions

This is not as much a fix as a work around, but given the real
involves replacing how we build fftw, it is not eligible for 2.83
which is in BCON3 already.

The root of the issue lies with (how we build) fftw3

The first issue is: fftw does not build with MSVC, there are other
dependencies that are not compatible with MSVC and for those we
build the libraries required with mingw64, same for fftw

The second issue is: for reasons unknown we really really really
liked all deps to link statically so wherever possible we did so.

Now during the building of the fftw it linked a few symbols from
libgcc (which we do not ship) like __chkstk_ms, for which we passed
some flags to stop generating calls to it. Problem solved! There
is no way this could possibly turn around and bite us in the rear.

fast forward to today mystery crashes that look like a race condition.

What is happening is, we tell the linker that each thread will require
a 2-megabyte stack, now if every thread immediately allocated 2 megs,
that be 'rough' on the memory usage. So, what happens is (for all apps
not just blender), 2 megs are reserved but not backed by any real memory
and the first page is allocated for use by the stack, now as the stack
grows, it will eventually grow out of that first page, and end up in
an area that has not been allocated yet, to deal with that the allocated
page is followed by a guard page, someone touches the guard page it's
time to grow the stack!

Meanwhile in FFTW is it's doing substantial allocation using alloca
(up to 64 kb) on the stack, jumping over the guard page, and ending
up in reserved but not yet committed memory, causing an access violation.

Now if you think, that doesn't sound right! something should have
protected us from that! You are correct! That thing was __chkstk_ms
which we disabled.

Given we do not want a dependency on libgcc while building with MSVC
the proper solution is to build fftw as a shared library which will
statically link any bits and pieces it needs, however that change
is a little bit too big to be doing in BCON3.

So as a work around, we change the size the stack grows from 8k to
68k which gives fftw a little bit more wiggle room to keep it out
of trouble most of the time.

Note this only sidesteps the issue, this may come up again if the
conditions are just right, and a proper solution will need to be
implemented for 2.90.

17 months agoFix invalid bit shift when GPU shader attribute is not found
Brecht Van Lommel [Mon, 18 May 2020 19:22:02 +0000 (21:22 +0200)]
Fix invalid bit shift when GPU shader attribute is not found

17 months agoFix NULL pointer access reported by ASAN (harmless in practice but still weak)
Brecht Van Lommel [Mon, 18 May 2020 19:18:33 +0000 (21:18 +0200)]
Fix NULL pointer access reported by ASAN (harmless in practice but still weak)

17 months agoFix potential crash due to dyntopo GPU buffer invalid memory access
Brecht Van Lommel [Mon, 18 May 2020 16:07:09 +0000 (18:07 +0200)]
Fix potential crash due to dyntopo GPU buffer invalid memory access

When the number of triangles in a node became zero, the wireframe batch was
not freed along with the triangles batch and could still reference a freed
vertex buffer.

Ref T76858

17 months agoOutliner: Fix (unreported) more data-changing operators missing undo.
Bastien Montagne [Mon, 18 May 2020 15:12:53 +0000 (17:12 +0200)]
Outliner: Fix (unreported) more data-changing operators missing undo.

17 months agoFix part of T76544: dyntopo sculpt undo stack memory leak
Brecht Van Lommel [Mon, 18 May 2020 15:22:55 +0000 (17:22 +0200)]
Fix part of T76544: dyntopo sculpt undo stack memory leak

17 months agoFix T76814: [Mantaflow] Surface Tension always works
Sebastián Barschkis [Mon, 18 May 2020 15:19:43 +0000 (17:19 +0200)]
Fix T76814: [Mantaflow] Surface Tension always works

Initialize the curvature grid and compute the laplacian only if the diffusion flag is set.

17 months agoFix T76795: Missing node tree update after remove-on-cancel
Jacques Lucke [Mon, 18 May 2020 15:08:57 +0000 (17:08 +0200)]
Fix T76795: Missing node tree update after remove-on-cancel

Reviewers: brecht

Differential Revision:

17 months agoFix T76851: GPencil brush is reset after change mode
Antonio Vazquez [Mon, 18 May 2020 15:04:00 +0000 (17:04 +0200)]
Fix T76851: GPencil brush is reset after change mode

This was introduced by commit rBe58525706328

Now, the brush is not changed when change mode.

Thanks @Alaska for helping with this bug.

17 months agoFix T76730 DRW: Sorting of empty shading groups.
Clément Foucault [Mon, 18 May 2020 14:59:04 +0000 (16:59 +0200)]
Fix T76730 DRW: Sorting of empty shading groups.

This is to fix an assert in EEVEE caused by a transparent shading group
that is create but not populated by any drawcall.

17 months agoFix T76828 Grease Pencil: Toggle Caps doesn't work
Clément Foucault [Mon, 18 May 2020 13:51:19 +0000 (15:51 +0200)]
Fix T76828 Grease Pencil: Toggle Caps doesn't work

This was a logic error.

17 months agoCleanup: GPencil: Fix float double promotion
Clément Foucault [Mon, 18 May 2020 13:50:28 +0000 (15:50 +0200)]
Cleanup: GPencil: Fix float double promotion

17 months agoFix T76799: Crash from undoing the copy-pasting of multiple data blocks.
Bastien Montagne [Mon, 18 May 2020 13:47:03 +0000 (15:47 +0200)]
Fix T76799: Crash from undoing the copy-pasting of multiple data blocks.

Bug was actually in outliner code, paste operator would not generate any
undo step...

This was not correct ever, but with new undo code this has become a
critical issue, it cannot survive a situation where current main data
has been changed without a proper undo push.

This illustrates again how much of a catastrophic mess the 'tools'
callbacks of the outliner are currently, it has already caused us quiet
some pain in the past, and will keep doing so until this is fully
sanitized am afraid.

Would strongly suggest getting rid of thosw nasty mix of custom
callbacks requiring manual undo pushes, I do not see the added value of
this compared to regular menus calling regular operators. It only adds
confusion and extra code for nothing...

17 months agoFix T76593: Coordinate limit of 10,000 units
Campbell Barton [Mon, 18 May 2020 11:14:36 +0000 (21:14 +1000)]
Fix T76593: Coordinate limit of 10,000 units

This is no longer needed for number button dragging to work properly.

17 months agoFix T75292: File-select events not handled while modal handler is active
Jacques Lucke [Mon, 18 May 2020 09:59:02 +0000 (11:59 +0200)]
Fix T75292: File-select events not handled while modal handler is active

Reviewers: Severin

Differential Revision:

17 months agoFix T76852: Breakdowner remembers limits last used
Campbell Barton [Mon, 18 May 2020 08:47:50 +0000 (18:47 +1000)]
Fix T76852: Breakdowner remembers limits last used

17 months agoFix T76573: Make links with Multires leading to crash
Sergey Sharybin [Mon, 18 May 2020 08:48:45 +0000 (10:48 +0200)]
Fix T76573: Make links with Multires leading to crash

17 months agoFix T76849: Duplicate templates show in the New menu
Campbell Barton [Mon, 18 May 2020 07:59:52 +0000 (17:59 +1000)]
Fix T76849: Duplicate templates show in the New menu

17 months agoCleanup: unused warning in last commit
Campbell Barton [Mon, 18 May 2020 07:11:48 +0000 (17:11 +1000)]
Cleanup: unused warning in last commit

17 months agoCleanup: remove NULL checks from object mode switching take #2
Campbell Barton [Mon, 18 May 2020 07:04:48 +0000 (17:04 +1000)]
Cleanup: remove NULL checks from object mode switching take #2

Re-apply changes from 54ea3562406c633dc69f59697cca3cd1cded3bcd,
with a poll function that uses the same active object as the operator,
matching other mode switching functions.

17 months agoRevert "Cleanup: remove redundant active object NULL check & poll"
Jeroen Bakker [Mon, 18 May 2020 06:31:09 +0000 (08:31 +0200)]
Revert "Cleanup: remove redundant active object NULL check & poll"

This reverts commit 54ea3562406c633dc69f59697cca3cd1cded3bcd it
introduced crashes when trying to go to edit mode when the active
object was hidden.

Fix T76837

17 months agoFix error mixing incompatible enums when generating the proxy name
Campbell Barton [Mon, 18 May 2020 06:12:17 +0000 (16:12 +1000)]
Fix error mixing incompatible enums when generating the proxy name

17 months agoCleanup: quiet enum conversion warning
Campbell Barton [Mon, 18 May 2020 04:36:02 +0000 (14:36 +1000)]
Cleanup: quiet enum conversion warning

17 months agoFix T76734: Changing Envelope FModifier controlpoints missing update
Philipp Oeser [Thu, 14 May 2020 11:59:19 +0000 (13:59 +0200)]
Fix T76734: Changing Envelope FModifier controlpoints missing update

Issue is that update functions defined in
`rna_def_fmodifier_envelope_ctrl` (namely `rna_FModifier_update`) are
actually never called.

This is because UI code for FCurve modifiers often does not use RNA
buttons but uses custom update functions (or non at all). For example,
rB9a88bd55903a did this for the generators, envelope control points did
not have this at all.

This is now changed to use RNA buttons for the envelope control points,
this could done for other non-RNA buttons as well to get rid of

Maniphest Tasks: T76734

Differential Revision:

17 months agoFix T76698: Movie clip stabilize display ignore footage colorspace
Philipp Oeser [Tue, 12 May 2020 21:21:24 +0000 (23:21 +0200)]
Fix T76698: Movie clip stabilize display ignore footage colorspace

Stabilized ImBuf just needs to use the same colorspace and alpha
settings as the original one.

Maniphest Tasks: T76698

Differential Revision:

17 months agoFix T76277: Remove wrong cast in rna_NodeTree_update
Robert Guetzkow [Fri, 15 May 2020 16:17:38 +0000 (18:17 +0200)]
Fix T76277: Remove wrong cast in rna_NodeTree_update

This patch fixes T76277 by removing the incorrect cast from
`ptr->data` to `bNode`. The address of `ptr->owner_id` and
`ptr->data` both point to the node tree. Passing the node tree
incorrectly as a node into the `ED_node_tag_update_nodetree`
corrupts the data, because it attempts to set flags on the

Reviewed By: sergey

Differential Revision:

17 months agoFix embedded IDs not being enough/properly initialized.
Bastien Montagne [Fri, 15 May 2020 15:57:13 +0000 (17:57 +0200)]
Fix embedded IDs not being enough/properly initialized.

Among other things, they were missing library pointer, session uuid
initialization, etc.

Fix T74546: Corrupted nodegroups crash blender when copy pasting or
appending them.

Fix (unreported) asserts when undoing some production scenes (from
coffee run e.g.).

Initialy caused by rB0aac74f18f2d.

17 months agoCleanup: rename readfile utils dealing with embedded IDs to proper name.
Bastien Montagne [Fri, 15 May 2020 14:53:24 +0000 (16:53 +0200)]
Cleanup: rename readfile utils dealing with embedded IDs to proper name.

17 months agoGPencil: Fix unreported missing Sculpt/Vertex/Weight paint brushes
Antonio Vazquez [Fri, 15 May 2020 14:43:50 +0000 (16:43 +0200)]
GPencil: Fix unreported missing Sculpt/Vertex/Weight paint brushes

This error was introduced wit the change in commit

As the brushes were not created, all modes except Edit were broken.

Now, the brushes and palette are not created when load the file in versioning code, but when the mode is enabled.

Also, if the brush already exist, the parameters are not reset as it was done in the versioning code in order to keep user settings.

The same logic is used for the default palette.

17 months agoCleanup: clang format
Philipp Oeser [Fri, 15 May 2020 14:31:18 +0000 (16:31 +0200)]
Cleanup: clang format

Sorry for the noise, somehow missed that in rB0a32f6c8686c.

17 months agoFix T76755: texture paint on udims crash
Philipp Oeser [Fri, 15 May 2020 10:32:54 +0000 (12:32 +0200)]
Fix T76755: texture paint on udims crash

Caused by rB5593efec01c2.

Use first texture if we dont have an ImageUser (instead of multiview
one). Same fix as in rB9ace7e243978 / T74925.

Maniphest Tasks: T76755

Differential Revision:

17 months agoFix T76563: Transforming an auto-aligned point won't set it aligned
Campbell Barton [Fri, 15 May 2020 12:48:00 +0000 (22:48 +1000)]
Fix T76563: Transforming an auto-aligned point won't set it aligned

When local origins are used or a single control point is selected,
change the handle types from auto to aligned.

17 months agoFix T76710: objects get lost in linked/overridden collections
Philipp Oeser [Wed, 13 May 2020 15:30:39 +0000 (17:30 +0200)]
Fix T76710: objects get lost in linked/overridden collections

Right now:
- drag-drop in the Outliner prevents dropping inside linked collections
- drag-drop in the Outliner allows dropping inside overridden
collections (should not be the case)
- `Object Properties` > `Collections` panel allows to add to overridden
collection (should not be the case)
- `Object Properties` > `Collections` panel filters out non-local
collections (so adding to linked collections is forbidden)
- `bpy` allows to add to linked collections
(should not be the case)
- `bpy` allows to add to overridden
collections (should not be the case)

While this might be supported in the future for overriden collections,
these cases should not be allowed atm. since objects get lost on file

Note: for the case of the `Object Properties` > `Collections` panel,
this could be improved further to filter out overridden collections as

Reviewers: mont29, brecht


17 months agoFix T76695: Not exporting normals properly in Alembic format
Sybren A. Stüvel [Fri, 15 May 2020 10:58:48 +0000 (12:58 +0200)]
Fix T76695: Not exporting normals properly in Alembic format

When auto-smooth enabled, but no custom normals layer present, the Alembic
exporter would incorrectly assume the mesh was shaded smooth. This is now
corrected, and normals are always written when auto-smooth is enabled.

17 months agoFix T76778: Dopesheet "Show Errors" affects timeline
Sybren A. Stüvel [Fri, 15 May 2020 09:54:17 +0000 (11:54 +0200)]
Fix T76778: Dopesheet "Show Errors" affects timeline

Since the timeline is a variation of the dopesheet, it also respects
some of the dopesheet settings.

The "Selected Only" setting is overridden from a scene property (since
rB4904eadc0f38) and the "Display Hidden" dopesheet setting seems to be

This commit adds the remaining "Show Errors" setting to the menu,
allowing it to be updated from the timeline.

17 months agoFix T76740: Static Override - Library Override Crash
Bastien Montagne [Fri, 15 May 2020 08:46:55 +0000 (10:46 +0200)]
Fix T76740: Static Override - Library Override Crash

Missing proper tagging of 'backward' pointer from fcurve to its group in
RNA would lead to infinite loop...

Issue was triggered by override, but crash could be generated from other
places as well (like from py console), on any action actually...

17 months agoFix T76738: Duplicate brushes cause assertion on undo
Campbell Barton [Fri, 15 May 2020 07:45:41 +0000 (17:45 +1000)]
Fix T76738: Duplicate brushes cause assertion on undo

17 months agoFix duplicate ID's being created when appending/linking
Campbell Barton [Fri, 15 May 2020 06:53:43 +0000 (16:53 +1000)]
Fix duplicate ID's being created when appending/linking

This removes grease pencil brush creation/dat-block delete on load,
since this causes duplicate data-blocks.

Add assert to prevent this happening in the future
since the error is isn't obvious.