7 months agoFix: GPencil mask shows in view layer render
Falk David [Wed, 26 May 2021 14:07:03 +0000 (16:07 +0200)]
Fix: GPencil mask shows in view layer render

Currently when rendering the view layer of a grease pencil layer that has
a mask layer attached, the mask layer would show in the rendered image.
This is inconsistent with the default behaviour with no mask on the
grease pencil layer, because it would only render what's on that
particular layer and not anything from any other layer.

This patch makes the masks invisible in the render.

Note: This might seem like not the best solution, but because masks are
just regular grease pencil layers, it's tricky to pass this edge-case to the
drawing code. The way it is handled right now is the best I could come
up with, without making changes that could affect something else.

Reviewed By: antoniov

Maniphest Tasks: T88202

Differential Revision:

7 months agoFix T88250: crash when instancing object in disabled collection
Jacques Lucke [Wed, 26 May 2021 14:06:01 +0000 (16:06 +0200)]
Fix T88250: crash when instancing object in disabled collection

This issue was that `BKE_object_eval_uber_data` was not called for
the text object, because its geometry was not dependent upon
and its `is_directly_visible` tag was `false`. The crash happens in
rendering code, because the evaluated data is missing.

This not only affects text objects, but all object types that have a
geometry component that geometry nodes does not support yet.

The solution is to just add the missing dependencies.

Differential Revision:

7 months agoFix T88251: "Operator Cheat Sheet" Crash
Philipp Oeser [Tue, 25 May 2021 15:46:17 +0000 (17:46 +0200)]
Fix T88251: "Operator Cheat Sheet" Crash

Caused by {rB919558854d62}.

Same fix as in {rBdc8a43c8755a} -- let RNA enum item callbacks check
for NULL context.

The NULL context is used to extract items for document generation.

Maniphest Tasks: T88251

Differential Revision:

7 months agoFix T88551: Crash accessing uninitialized tool settings
Richard Antalik [Tue, 25 May 2021 13:02:31 +0000 (15:02 +0200)]
Fix T88551: Crash accessing uninitialized tool settings

Tool settings for sequencer were not initialized, which caused crash
when adding strips.

There was fix for same issue in versioning rB0f81dafe6cec, but
subversion was not bumped, so files with uninitialized tool settings
may still exist.

Add `SEQ_tool_settings_get()` accessor function that will initialize
tool settings if they are missing. Change operator code to use
`SEQ_tool_settings_fit_method_get()` function instead of accessing
tool settings directly

Reviewed By: campbellbarton

Differential Revision:

7 months agoFix T88478: Fallback to dolly not working when moving the camera in camera view
Germano Cavalcante [Mon, 24 May 2021 15:05:59 +0000 (12:05 -0300)]
Fix T88478: Fallback to dolly not working when moving the camera in camera view

This fallback is an old hack.

It is difficult to have an orientation convention when several random
factors determine which one should be used.

In this case, to "fix" the problem, a new behavior had to be implemented.
Now the redo when moving the camera in `Camera View` has the default
orientation as `View`.

7 months agoFix (unreported): Automatic transform contraint not being disabled
Germano Cavalcante [Mon, 24 May 2021 14:30:44 +0000 (11:30 -0300)]
Fix (unreported): Automatic transform contraint not being disabled

It does not make sense to maintain automatic constraint selection when
you manually set the constraint.

7 months agoCleanup: Rename transform enum items
Germano Cavalcante [Mon, 24 May 2021 14:35:33 +0000 (11:35 -0300)]
Cleanup: Rename transform enum items

Make them more descriptive.

7 months agoFix T87357: Missing update after removing socket
Jacques Lucke [Fri, 21 May 2021 18:43:26 +0000 (14:43 -0400)]
Fix T87357: Missing update after removing socket

The CoW copy of the node group was not updated correctly after it
changed. Arguably, tagging the node tree could also be part of
`ntreeUpdateTree` (which needs to be called after changes to the
node tree anyway). However, there are many instances where the
depsgraph is tagged explicitly after `ntreeUpdateTree` is called,
so it should be fine here as well. This is similar to what is done
in `snode_dag_update`.

Differential Revision:

7 months agoFix T88227: Eevee not working on AMD 535 cards.
Jeroen Bakker [Fri, 21 May 2021 05:44:25 +0000 (07:44 +0200)]
Fix T88227: Eevee not working on AMD 535 cards.

Enabled HQ normals workaround for this specific configuration.

7 months agoFix T87854: Add clamp option to Path Animation
Sebastian Parborg [Thu, 20 May 2021 18:41:10 +0000 (20:41 +0200)]
Fix T87854: Add clamp option to Path Animation

Previously, the "follow path constraint" and "follow parented curve"
were clamped.  This restriction was lifted in rBcf2baa585cc8

Add back an option to get the old behavior in the "Path animation" settings.

Reviewed By: Sybren

Differential Revision:

7 months agomacOS build: set minimum deployment target correctly
Ankit Meel [Thu, 20 May 2021 16:25:58 +0000 (21:55 +0530)]
macOS build: set minimum deployment target correctly

Make `CMAKE_OSX_DEPLOYMENT_TARGET` independent of buildbot settings and
always set to `OSX_MIN_DEPLOYMENT_TARGET`. That fixes the launch error
on OS older than buildbot's.

Fix T88419
Diff D11323

7 months agoFix T87316: No undo push for clicking on attribute name
Hans Goudey [Thu, 20 May 2021 16:17:54 +0000 (12:17 -0400)]
Fix T87316: No undo push for clicking on attribute name

Since there is a special callback for assigning the name from the
search box, and the callback doesn't call an operator or something
else that would do an undo push, I think the solution is to do it
manually here.

Another option would be adding the button flag "UI_BUT_UNDO", which
isn't set by default for search buttons, but that gives us ugly names for
the undo steps, so an explicit push is better in this case.

Differential Revision:

7 months agoFix T87947: Trasnform: Keyboard input uses view orientation
Germano Cavalcante [Wed, 12 May 2021 02:40:06 +0000 (23:40 -0300)]
Fix T87947: Trasnform: Keyboard input uses view orientation

When activated in modal, `translate`, `resize`, `rotate`, `shear` and
`edge_rotate_normal` use a different orientation than the set in scene.

This orientation needed to match since some of these modes can be switched
during operation.

The default orientation for these modes was `V3D_ORIENT_VIEW`.

And this changed when finishing the `translate` and `resize` to

But this could cause inconsistencies when inputting values from the

The solution now is to change the orientation when you change the mode.

Note: Although the user can expect the value entered to reflect the
orientation set in the scene, it would require a lot of changes and would
not be really useful.

7 months agoCleanup: Use enum to indicate the current orientation
Germano Cavalcante [Wed, 12 May 2021 01:40:56 +0000 (22:40 -0300)]
Cleanup: Use enum to indicate the current orientation

Improves readability.

7 months agoFix T88345: Blender crash on GPUFrameBuffer creation
Germano Cavalcante [Tue, 18 May 2021 12:39:31 +0000 (09:39 -0300)]
Fix T88345: Blender crash on GPUFrameBuffer creation

Misuse of indexes.

`color_attachements` has only color ones while `config` has color and depth.

7 months agoFix T88365: returning a buffer with wrong size
Germano Cavalcante [Tue, 18 May 2021 13:01:29 +0000 (10:01 -0300)]
Fix T88365: returning a buffer with wrong size

The pixel components were not being considered.

7 months agoFix T88313: GPencil reproject operator projecting on the wrong surface
Germano Cavalcante [Tue, 18 May 2021 20:31:10 +0000 (17:31 -0300)]
Fix T88313: GPencil reproject operator projecting on the wrong surface

`ray_start` must start at the position of the gpencil point.

7 months agoFix T86193: Bake Action, wrong rotation order for bones
dreamertooth [Thu, 20 May 2021 10:53:14 +0000 (12:53 +0200)]
Fix T86193: Bake Action, wrong rotation order for bones

Use bone rotation order to compute the baked rotation. This fixes a bug
introduced in rB0e85d701c654, where the object rotation order was
applied to the bone.

Maniphest Tasks: T88359, T86193

Reviewed By: sybren, GuiltyGhost, #animation_rigging

Differential Revision:

7 months agoFix T87793: Cycles OptiX crash hiding objects in viewport render
Brecht Van Lommel [Tue, 18 May 2021 22:55:22 +0000 (00:55 +0200)]
Fix T87793: Cycles OptiX crash hiding objects in viewport render

7 months agoCycles OpenCL: disable AO preview kernels
Brecht Van Lommel [Tue, 18 May 2021 22:14:23 +0000 (00:14 +0200)]
Cycles OpenCL: disable AO preview kernels

These seem to be causing some stability issues, and really are just not that
useful in practice. Compiling them is slow already, so it does not improve
the user experience much to show an AO preview if it's not nearly instant.

8 months agoBlender LTS: match download urls with latest changes in buildbot.
Jeroen Bakker [Wed, 19 May 2021 14:39:22 +0000 (16:39 +0200)]
Blender LTS: match download urls with latest changes in buildbot.

8 months agoFix T88167: Regression: no tooltip for syringe/picker, during picking object
Pratik Borhade [Wed, 19 May 2021 11:46:55 +0000 (13:46 +0200)]
Fix T88167: Regression: no tooltip for syringe/picker, during picking object

Fix T88167.

Caused by {rB97defd9cd79b6e3ed0e52481a7078107dbe0522b}

`(BLI_rcti_isect_pt` used here to confirm if cursor position is in between active region boundary.
Subtracting min region boundary from the mouse position before the check, fails the condition.

`mval[2]` introduced to hold the region relative mouse position.

Reviewed By: Severin

Maniphest Tasks: T88167

Differential Revision:

8 months agoEEVEE: Subsurface Node: Fix inverted texture blur input
Clément Foucault [Wed, 19 May 2021 10:27:38 +0000 (12:27 +0200)]
EEVEE: Subsurface Node: Fix inverted texture blur input

Fixes T86097 EEVEE Subsurface Node give blurry edges

8 months agoEEVEE: Geometry info -> tangent: Make consistent with Cycles for hair
Mikhail Matrosov [Wed, 19 May 2021 10:09:29 +0000 (12:09 +0200)]
EEVEE: Geometry info -> tangent: Make consistent with Cycles for hair

Changes output for geometry info node in Eevee to be consistent with Cycles (w/o osl)

Before this patch Eevee outputs Z-tangent even for hair. This patch changes it to output hair tangent (growth direction). Hair tangent is impossible to derive otherwise from normal or view direction.

Reviewed By: fclem, brecht
Differential Revision:

8 months agoFix T88362: Lineart countour rendering error
YimingWu [Wed, 19 May 2021 07:07:19 +0000 (15:07 +0800)]
Fix T88362: Lineart countour rendering error

This is caused by lacking of consideration of
OB_DUPLICOLLECTION in updateDepsgraph() in the

Reviewed by: Antonio Vazquez (antoniov)

8 months agoFluid: Updated Mantaflow source files
Sebastián Barschkis [Tue, 18 May 2021 20:32:54 +0000 (22:32 +0200)]
Fluid: Updated Mantaflow source files

Includes update for OpenVDB file IO, i.e. fixes an issue with
compression flag combination that resulted in random segfaults.

Other changes: Cleanup and formatting.

8 months agoFix build warning
Richard Antalik [Tue, 18 May 2021 14:15:08 +0000 (16:15 +0200)]
Fix build warning

Value of the size argument in `strncat` is too large, might lead to a
buffer overflow.

Change the argument to be the free space in the destination buffer
minus the terminating null byte.

Introduced in 5368859a669d

Reviewed By: Sergey

Differential Revision:

8 months agoFix T88370: GPencil render crash when use viewlayer and masking
Antonio Vazquez [Tue, 18 May 2021 13:42:26 +0000 (15:42 +0200)]
Fix T88370: GPencil render crash when use viewlayer and masking

When filtering the render using view layer, could be possible the mask is NULL and just need to be ignored.

8 months agoFix ocean modifier giving different result on Arm than x86
Brecht Van Lommel [Tue, 18 May 2021 12:02:41 +0000 (14:02 +0200)]
Fix ocean modifier giving different result on Arm than x86

And re-enable the test on macOS Arm.

Ref T78710

8 months agoTests: Disabled physics ocean test on macOS arm64
Sebastián Barschkis [Tue, 18 May 2021 10:48:35 +0000 (12:48 +0200)]
Tests: Disabled physics ocean test on macOS arm64

Test is failing and needs further investigation.

8 months agoFix error calling select-camera without a 3D view
Campbell Barton [Tue, 18 May 2021 09:58:11 +0000 (19:58 +1000)]
Fix error calling select-camera without a 3D view

8 months agoFix error in grease pencil flip color operator
Campbell Barton [Tue, 18 May 2021 07:38:54 +0000 (17:38 +1000)]
Fix error in grease pencil flip color operator

- Used try/except instead of a poll function.
- The error case referenced a non-existent error handling module.

Prefer poll functions over exception handling where possible,
also having an operators logic in a try block isn't good practice
as it can hide more serious errors in the code.

Note that duplicate pencil settings access should be moved into a
utility function. This can be part of a separate cleanup.

8 months agoFix T88026: Repeated switch to rendered viewport crashes
Campbell Barton [Tue, 18 May 2021 02:53:28 +0000 (12:53 +1000)]
Fix T88026: Repeated switch to rendered viewport crashes

Resolve ownership ambiguity with shared physics pointers.

Previously, LIB_ID_CREATE_NO_MAIN allowed pointer sharing with
the source ID so physics caches can be shared between original and
evaluated data: (Object.soft.shared & Object.rigidbody_object.shared).

This only worked properly for LIB_TAG_COPIED_ON_WRITE ID's,
as LIB_TAG_NO_MAIN can be used in situations where the original ID's
lifetime limited by it's original data.

This commit adds `LIB_ID_COPY_SET_COPIED_ON_WRITE` so ID's only share
memory with original data for ID's evaluated in the depsgraph.

For all other uses, a full copy of physics data is made.

Ref D11228#287094

8 months agoCleanup: clang-format
Campbell Barton [Tue, 18 May 2021 02:53:27 +0000 (12:53 +1000)]
Cleanup: clang-format

8 months agoFix T88230: Properly handle Face Set visibility in Expand Face Sets editing
Pablo Dobarro [Thu, 13 May 2021 00:40:10 +0000 (02:40 +0200)]
Fix T88230: Properly handle Face Set visibility in Expand Face Sets editing

Expand is not expected to update the visibility state of the PBVH, only
the Face Sets IDs. If visibility updates are made accidentally, PBVH
rendering breaks.

In order for this to work properly, the following fixes are needed:

- Expand should always check for active component before attempting to
 modify a Face Set ID

- Expand should always check the visibility state on original_face_sets, as
it is the array that contains the visiblilty state that corresponds with the
current state used for PBVH rendering. This implies that after any modification
done by Expand, the visibility state of ss->face_sets and
expand_cache->original_face_sets should match (like in any other tool that
does not modify visibility).

- Expand should never modify the Face Set ID of a poly that is hidden in

- When deleting an ID, hidden Face Sets should be skipped when picking IDs for
content filling. This avoids introducing hidden IDs back into the visible
geometry even after updating its visibility state.

Reviewed By: JulienKaspar, JacquesLucke

Maniphest Tasks: T88230

Differential Revision:

8 months agoFix T86278: vertex color baking not working with modifiers
Brecht Van Lommel [Wed, 12 May 2021 21:14:58 +0000 (23:14 +0200)]
Fix T86278: vertex color baking not working with modifiers

As in the old Blender Internal baking code, this still relies on there being a
good mapping to the original vertices.

8 months agoFix T85892: disable progressive refine when using adaptive sampling
Brecht Van Lommel [Mon, 17 May 2021 17:24:51 +0000 (19:24 +0200)]
Fix T85892: disable progressive refine when using adaptive sampling

This is giving too bright pixel values, as the sample scaling and random number
sample are wrong. The proper fix for this is complicated. It will be solved in
Cycles X, for now we disable this combination.

8 months agoFix T88216: Cycles persistent data fails with animated object transform in instance
Brecht Van Lommel [Mon, 17 May 2021 13:43:42 +0000 (15:43 +0200)]
Fix T88216: Cycles persistent data fails with animated object transform in instance

8 months agoFix T88210: Cycles persistent data failing with image sequences
Brecht Van Lommel [Mon, 17 May 2021 13:36:50 +0000 (15:36 +0200)]
Fix T88210: Cycles persistent data failing with image sequences

8 months agoFix OpenCL group size performance issue on Intel GPUs
Brecht Van Lommel [Mon, 17 May 2021 11:32:50 +0000 (13:32 +0200)]
Fix OpenCL group size performance issue on Intel GPUs

Contributed by Intel. On some scenes like classroom with particular integrated
GPUs this speeds up rendering 1.97x. With other benchmarks and GPUs it's
between 0.99-1.14x.

8 months agoGPencil: Fix unreported error exporting to PDF/SVG with animated camera
Antonio Vazquez [Mon, 17 May 2021 11:04:30 +0000 (13:04 +0200)]
GPencil: Fix unreported error exporting to PDF/SVG  with animated camera

Before, the camera parameters were calculated only for first frame.

If the camera is animated, these values need to be recalculated in order to get the new camera view position and export the strokes as expected.

Also fixed the export of PDF when the view is not in camera view. PDF export, needs to be done in camera view.

8 months agoFix PyAPI doc generation error in 43369ca80e62aa80b951823d1c78abef58852014
Campbell Barton [Mon, 17 May 2021 07:56:18 +0000 (17:56 +1000)]
Fix PyAPI doc generation error in 43369ca80e62aa80b951823d1c78abef58852014

Files without doc-strings were not included.

8 months agoFix T88204 EEVEE: Animated world light doesnt work during render
Clément Foucault [Sat, 15 May 2021 16:29:14 +0000 (18:29 +0200)]
Fix T88204 EEVEE: Animated world light doesnt work during render

This was a bug uncovered by rB50782df42586.

Previously, the lightcache was always discarded between redraw and forced
to be updated again.

Now we check for update inside the render loop making it compatible with
accumulation motion blur and long exposure.

8 months agoEEVEE: Depth of Field: Fix tile artifacts in mixed focus regions
Clément Foucault [Sat, 15 May 2021 15:48:26 +0000 (17:48 +0200)]
EEVEE: Depth of Field: Fix tile artifacts in mixed focus regions

This was caused by the slight focus gather not being wide enough
for small radii. Now the cast to int will properly round the radius to
the nearest integer.

This is related to T86244 Black Artefacts in EEVEE on Transparent BSDF

8 months agoFix T85845 EEVEE: Depth Of Field: Artifacts with slight out of focus
Clément Foucault [Fri, 14 May 2021 14:18:12 +0000 (16:18 +0200)]
Fix T85845 EEVEE: Depth Of Field: Artifacts with slight out of focus

This was caused by the bokeh LUT being sampled outside the valid range.
But `texelFetch` is only valid if the sample actually exists. This lead to
undefined behavior.

The fix is to increase `DOF_MAX_SLIGHT_FOCUS_RADIUS` (which just offsets the
LUT along the X=Y axis) to avoid any sample outside the defined range.

8 months agoRigidBodies: Clarify usage of the custom density in the calculate mass
Philipp Oeser [Mon, 10 May 2021 08:30:28 +0000 (10:30 +0200)]
RigidBodies: Clarify usage of the custom density in the calculate mass

This is only used when the preset is set to 'Custom', make that clear in
the tooltip and disable editing the value if another preset is used.

Issue came up in T88155.

Maniphest Tasks: T88155

Differential Revision:

8 months agoFix T88188: Keyframing Vertex Mass in Cloth Simulation doesn't have any
Philipp Oeser [Tue, 11 May 2021 10:54:18 +0000 (12:54 +0200)]
Fix T88188: Keyframing Vertex Mass in Cloth Simulation doesn't have any

The way it is now, `ClothVertex->mass` is setup once for the clothObject
and then reused if it already exists [so does not change across frames/
steps] which happens in`cloth_from_object` / `do_init_cloth`, where
`SIM_cloth_solver_init` / `SIM_mass_spring_set_vertex_mass` are called
and set up masses in `Implicit_Data`.

Seems possible to update `ClothVertex->mass` every step in
`do_step_cloth`, however it seems more involved to update the masses in
`Implicit_Data` there as well. The masses from `Implicit_Data` are
accessed in many places, so it would be mandatory to have these masses
kept up-to-date (and even then it is unclear if the solver was designed
to work with these animated or if there are assumptions about this being
stable across the sim).

So propose to remove the (broken/not implemented) animation capabilities
on the property instead.

Maniphest Tasks: T88188

Differential Revision:

8 months agoFix T87715: Eevee: Holdout options not available in Outliner Collection context menu
Philipp Oeser [Tue, 11 May 2021 16:34:33 +0000 (18:34 +0200)]
Fix T87715: Eevee: Holdout options not available in Outliner Collection context menu

Collection holdouts are now supported by eevee.

Maniphest Tasks: T87715

Differential Revision:

8 months agoFix T88234: Crash with Eevee when shader displacement socket connection is muted
Philipp Oeser [Fri, 14 May 2021 13:42:07 +0000 (15:42 +0200)]
Fix T88234: Crash with Eevee when shader displacement socket connection is muted

In {rB266cd7bb82ce}, support for muting links was added. It might be
debatable if we define a shader as "having" displacement even if the link
is muted, but after said commit, shader_has_displacement() would return
true but still leave the returned node as NULL.

Now also return false if the link is muted (otherwise the caller would
need to additionally check the returned node as well.)

Maniphest Tasks: T88234

Differential Revision:

8 months agoGPencil: fix separate points/strokes freezing with empty selection
Philipp Oeser [Fri, 14 May 2021 11:21:10 +0000 (13:21 +0200)]
GPencil: fix separate points/strokes freezing with empty selection

Code would still create an object (without setting up materials), code
for removing unused material slots would then freeze.

Now return/cancel early in case of empty selection.

This came up in T88269 [which is still not fully fixed, transforming
curve edit points clear their GP_STROKE_SELECT flag which now results in
the early exit, should be looked at separately]

Maniphest Tasks: T88269

Differential Revision:

8 months agoLineArt: Custom UI for adding GP object.
YimingWu [Fri, 14 May 2021 14:40:47 +0000 (22:40 +0800)]
LineArt: Custom UI for adding GP object.

This allows extra options (in-front and stroke order) to be shown when adding line art kind of grease pencil object.

Reviewed by: Antonio Vazquez (antoniov)


8 months agoFix T87417: crash when evaluating geo nodes without window manager
Pratik Borhade [Fri, 14 May 2021 11:43:30 +0000 (13:43 +0200)]
Fix T87417: crash when evaluating geo nodes without window manager

Differential Revision:

8 months agoFix memory leak in IDPropertyGroup.pop()
Campbell Barton [Fri, 14 May 2021 09:18:50 +0000 (19:18 +1000)]
Fix memory leak in IDPropertyGroup.pop()

When popping ID-property groups/arrays,
ID-property was removed but not freed.

Now the value is converted to a native Python type and freed.

8 months agoFix T87929: Cycles, missing update when visibility is modified
Kévin Dietrich [Mon, 10 May 2021 16:23:32 +0000 (18:23 +0200)]
Fix T87929: Cycles, missing update when visibility is modified

This issue originates from a missing BVH packing for visibility data
when it is modified.

To fix this, this adds update flags to the managers to carry the
modified visibility information from the Objects' modified flag to the

Another set of flags is added to determine which data need to be packed:
geometry, vertices, or visibility. Those flags are then used when
packing the primivites.

Reviewed By: brecht

Maniphest Tasks: T87929

Differential Revision:

8 months agoFix T87360 Multi input links aren't placed correctly when created with python
Fabian Schempp [Thu, 13 May 2021 21:05:38 +0000 (23:05 +0200)]
Fix T87360 Multi input links aren't placed correctly when created with python

link->multi_input_socket_index, which is used to calculate the links
position on the multi-input socket, was not set.
Now it is set to the sockets current link count.

Review: Jacques Lucke (JacquesLucke)
Differential Revision:

8 months agoVSE: Fix disk cache potentially overwriting blend file
Richard Antalik [Tue, 11 May 2021 10:49:49 +0000 (12:49 +0200)]
VSE: Fix disk cache potentially overwriting blend file

When disk cache path is same as blend file path, with Unix-like systems
blend file can be overwritten by disk cache directory.
This was caused by `BLI_delete(path, false, true)` when path points to
file. On Windows this would result in error message and file would not
be deleted. On Linux, file is deleted and then overwritten with cache

To further minimize chance of removing blend file, append disk cache
path with `_seq_cache` suffix.

Reviewed By: sergey

Differential Revision:

8 months agoFix T88194: Animation player displays washed out colors
Richard Antalik [Tue, 11 May 2021 10:47:25 +0000 (12:47 +0200)]
Fix T88194: Animation player displays washed out colors

Byte images used `ibuf->float_colorspace` as source colorspace.
This was oversight - `ibuf->rect_colorspace` should be used as source

Reviewed By: sergey

Differential Revision:

8 months agoVSE: Fix meta strip boundary can not be changed
Richard Antalik [Tue, 11 May 2021 10:25:54 +0000 (12:25 +0200)]
VSE: Fix meta strip boundary can not be changed

In e1f3996d740c, logic for changing metastrip start and end frame based
on contained strips was removed. This was done intentionally and
incorrect functionality wasn't noticed as drawing code reflected
seemingly correct state.

Original code was mostly correct, because meta strip doesn't store its
internal start and end points. This code was restored with minor
modifications so function `SEQ_time_update_sequence()` is fully self
contained as it is used not only by transform operator.

In addition, drawing glitches that happen when meta content is outside
of meta boundaries were fixed. These glitches were not caused by

Reviewed By: sergey

Differential Revision:

8 months agoFix T87851 EEVEE: Performance regression with baked lighting & transparency
Clément Foucault [Wed, 12 May 2021 15:20:08 +0000 (17:20 +0200)]
Fix T87851 EEVEE: Performance regression with baked lighting & transparency

This was caused by the drivers not optimizing the shader enough to remove
the samplers and data used by closure eval. Removing the lighting loops
from the depth shader fixes the perf regression.

8 months agoFix T81247: Constrain selected UVs to correct UDIM
Siddhartha Jejurkar [Wed, 12 May 2021 14:08:16 +0000 (00:08 +1000)]
Fix T81247: Constrain selected UVs to correct UDIM

With Constrain to Image Bounds selected, UVs will be constrained to the
correct/closest UDIM if the image is tiled.
UVs will be constrained to the 0-1 UV space if the image is not tiled.
This will override the present behavior of always constraining selected
UVs to the 0-1 UV space (UDIM 1001).

Reviewed By: campbellbarton

Ref D11202

8 months agoFix: IC keymap V-key view pie doesn't work in Weight Paint mode
Campbell Barton [Wed, 12 May 2021 12:19:01 +0000 (22:19 +1000)]
Fix: IC keymap V-key view pie doesn't work in Weight Paint mode

Remove the V key for switching to vertex mode in Weight Paint mode
as it caused a key-conflict.

Ref D11192

8 months agoFix incorrect labels for math node wrap function
Charlie Jolly [Wed, 12 May 2021 10:15:56 +0000 (11:15 +0100)]
Fix incorrect labels for math node wrap function

Found in T88151, labels are swapped. Vector math node is not affected.

8 months agoFix non-finite tangent in Cycles with missing UV map
Sergey Sharybin [Tue, 11 May 2021 18:36:15 +0000 (20:36 +0200)]
Fix non-finite tangent in Cycles with missing UV map

Was causing calculation issues later on in the kernel.

This change catches the most obvious case: missing attribute. The old
code was trying to set tangent to 0, but because it was transformed as
a normal it got converted to non-finite value. This change makes it so
that no transform is involved and 0 is written directly to the SVM

To cover all cases it will require using safe_normalize() in this node
and in the normal transform function. This is more involved change from
performance point of view, would be nice to verify whether we really want
to go this route.

I've left asserts in the BSDF allocation functions. Don't have strong
connection to them, but think they are handy and are not different from
having an assert in the path radiance checks.

Differential Revision:

8 months agoCycles X: Fix possible use of uninitialized ShaderClosure
Sergey Sharybin [Tue, 11 May 2021 15:53:09 +0000 (17:53 +0200)]
Cycles X: Fix possible use of uninitialized ShaderClosure

It is possible that BSDF allocation will advance pointer in the
allocation "pool" but will return null pointer if the weight is
too small.

One artist-measurable issue this change fixes is random issues
with denoising: normal pass for denoising could have accessed
non-initialized normal of a closure.

Differential Revision:

8 months agoFix wrong loop count in Sculpt Expand code
Pablo Dobarro [Tue, 11 May 2021 21:31:43 +0000 (23:31 +0200)]
Fix wrong loop count in Sculpt Expand code

Introduced when refactoring the function in

8 months agoFix T72791: Cycles wrong results when mixing multiple random walk BSSRDFs
Chris Eveleigh [Tue, 11 May 2021 20:06:10 +0000 (22:06 +0200)]
Fix T72791: Cycles wrong results when mixing multiple random walk BSSRDFs

Take into account the closure sample weight for the throughput.

Differential Revision:

8 months agoFix T88093: persistent data and particle object instancing not working
Brecht Van Lommel [Tue, 11 May 2021 15:17:00 +0000 (17:17 +0200)]
Fix T88093: persistent data and particle object instancing not working

8 months agoFix T88099: error with persistent data and motion blur
Brecht Van Lommel [Tue, 11 May 2021 12:22:40 +0000 (14:22 +0200)]
Fix T88099: error with persistent data and motion blur

8 months agoFix T88160: GPencil Remove `B` key to create Blank Keyframe in Drawing mode
Antonio Vazquez [Mon, 10 May 2021 14:34:27 +0000 (16:34 +0200)]
Fix T88160: GPencil Remove `B` key to create Blank Keyframe in Drawing mode

Now, we have the new `I` menu for that. The `B`keymap  was part of the old code.

8 months agoCleanup: remove unused BPy_IDProperty struct member
Campbell Barton [Tue, 11 May 2021 02:30:06 +0000 (12:30 +1000)]
Cleanup: remove unused BPy_IDProperty struct member

8 months agoFix T88190: Freed memory use when iterating over id-properties
Campbell Barton [Tue, 11 May 2021 02:08:26 +0000 (12:08 +1000)]
Fix T88190: Freed memory use when iterating over id-properties

The id-property iterator referenced a PyObject pointer without
increasing it's user count - allowing for errors if the value
goes out of scope during iteration.

8 months agoFix memory leak in Python IDproperty iterator
Campbell Barton [Tue, 11 May 2021 01:13:28 +0000 (11:13 +1000)]
Fix memory leak in Python IDproperty iterator

Looping over IDProperty keys or calling iteritems leaked memory.

Error in original Python idproperty support from

8 months agoFix T82155: Fade inactive geometry overlay not working with instanced geometry
Pablo Dobarro [Mon, 10 May 2021 17:29:52 +0000 (19:29 +0200)]
Fix T82155: Fade inactive geometry overlay not working with instanced geometry

This enables the overlay for instanced geometry.

After this change, objects that are an instance of the current active
object (which are also being modified in the current active mode) won't
fade, which is different from the previous behavior.

Reviewed By: fclem

Maniphest Tasks: T82155

Differential Revision:

8 months agoFix T88060: Expand freezing when deleting a Face Set with multiple loose parts
Pablo Dobarro [Wed, 5 May 2021 15:27:32 +0000 (17:27 +0200)]
Fix T88060: Expand freezing when deleting a Face Set with multiple loose parts

When checking if the mesh has only one Face Set only the current active
component for expand needs to be checked. Otherwhise other components
that won't be modified by Expand that contain other IDs will be taken
into account, making the Face Set deletion go into an infinite loop.

Reviewed By: JacquesLucke

Maniphest Tasks: T88060

Differential Revision:

8 months agoFix T88180: Enable HQ normal workaround for RX 580X cards.
Jeroen Bakker [Mon, 10 May 2021 14:49:26 +0000 (16:49 +0200)]
Fix T88180: Enable HQ normal workaround for RX 580X cards.

This needs to be backported to 2.83.

8 months agoFix T54339: Shapekey Max value doesn't clamp existing value
Pratik Borhade [Mon, 10 May 2021 13:47:32 +0000 (15:47 +0200)]
Fix T54339: Shapekey Max value doesn't clamp existing value

Update the "current value" of the Shape Key blend amount when value is
not within the min/max range. New function `rna_ShapeKey_update_minmax`
used to update and clamp the current value.

Reviewed By: mano-wii, lichtwerk, #animation_rigging, sybren

Maniphest Tasks: T54339

Differential Revision:

8 months agoFix T87764: Mem-leak during viewport rendering.
Jeroen Bakker [Mon, 10 May 2021 10:51:44 +0000 (12:51 +0200)]
Fix T87764: Mem-leak during viewport rendering.

When a scene uses cryptomatte the viewport rendering would lead to a
memory leak. The reason was that all image renders (viewport+final)
activated cryptomatte. But is only used for final rendering.

This patch only activates cryptomatte when doing final rendering.

8 months agoAnimation: move Cycle-Aware Keying to the Keying popover.
Alexander Gavrilov [Sun, 2 May 2021 21:03:00 +0000 (00:03 +0300)]
Animation: move Cycle-Aware Keying to the Keying popover.

The Cycle-Aware Keying option was added in 2.8 and is used
to allow keyframing over cyclic F-Curves without disturbing
the cycle (e.g. overwriting an end keyframe updates both ends).

This effect is not limited to auto keyframing and is applied
to any key insertion, but when the popovers were rearranged
it was put in the Auto-Keyframing related one for some reason.

This is misleading, especially since because of that the
option is incorrectly greyed out when auto keyframing is
disabled, so move it to the generic Keyframing popover.

Differential Revision:

8 months agoFix T88145: Dynamic Paint initial color using vertex color not working as expected
Philipp Oeser [Mon, 10 May 2021 09:33:01 +0000 (11:33 +0200)]
Fix T88145: Dynamic Paint initial color using vertex color not working as expected

Mistake in {rBe48c4d73d378}.

Was using the vertex index as a lookup for the loop color (instead of
the loop index).
(Issue was not present in original D1429 btw).

Maniphest Tasks: T88145

Differential Revision:

8 months agoGPencil: Sort Line Art modifier alphabetically
Pablo Vazquez [Sat, 8 May 2021 23:52:00 +0000 (01:52 +0200)]
GPencil: Sort Line Art modifier alphabetically

8 months agoGPencil: Name Scene Line Art objects "Line Art"
Pablo Vazquez [Sat, 8 May 2021 23:51:12 +0000 (01:51 +0200)]
GPencil: Name Scene Line Art objects "Line Art"

Matching Object and Collection line art type objects.

8 months agoFix PlayAnim cache size increasing when playing multiple animations
Campbell Barton [Sat, 8 May 2021 06:10:07 +0000 (16:10 +1000)]
Fix PlayAnim cache size increasing when playing multiple animations

Error in 0499dbc5c16fe6b276da81d65cade4f5da92a308

8 months agoFix PlayAnim X/Y flipping
Campbell Barton [Sat, 8 May 2021 04:27:28 +0000 (14:27 +1000)]
Fix PlayAnim X/Y flipping

This functionality was missed in recent GLSL drawing update

8 months agoFix: No sound is exported with ffmpeg 4.4
Sebastian Parborg [Fri, 7 May 2021 14:51:28 +0000 (16:51 +0200)]
Fix: No sound is exported with ffmpeg 4.4

We were not assigning the amount of sound channels to the output frames.
Newer ffmpeg releases has sanity checks in place and doesn't fall back
to two channels anymore.

8 months agoLibOverride: more tweaking to handling of obsolete overrides during resync.
Bastien Montagne [Fri, 7 May 2021 14:07:37 +0000 (16:07 +0200)]
LibOverride: more tweaking to handling of obsolete overrides during resync.

this is a followup to rB2bd85d9cc623, we cannot forcefully delete
obsolete overrides of object data (meshes etc.), as this implies also
deleting their user object, which might still be a perfectly valid
override, albeit in conflict regarding its obdata ID pointer...

8 months agoCleanup: make format (clang-format)
Dalai Felinto [Fri, 7 May 2021 13:41:42 +0000 (15:41 +0200)]
Cleanup: make format (clang-format)

8 months agoLibOverride: Fix many 'obsolete' overrides not being properly deleted.
Bastien Montagne [Fri, 7 May 2021 10:52:34 +0000 (12:52 +0200)]
LibOverride: Fix many 'obsolete' overrides not being properly deleted.

Code detecting overrides which reference linked data is missing was
actually missing many cases, leading to too much garbage data being kept
around after resync process.

8 months agoFix PlayAnim issue with images gradually loading into cache
Campbell Barton [Fri, 7 May 2021 07:54:52 +0000 (17:54 +1000)]
Fix PlayAnim issue with images gradually loading into cache

Instead of only drawing images on first start, load them into cache.

This resolves a logical problem when images don't load fast enough,
where the animation would load some frames each time until all images
loaded into cache.

In practice this could play back with severe frame skipping many times
times before all images were loaded making playback smooth.

Part of a fix for T81751.

8 months agoCleanup: move frame caching into functions
Campbell Barton [Fri, 7 May 2021 07:53:27 +0000 (17:53 +1000)]
Cleanup: move frame caching into functions

8 months agoCleanup: extract image loading into it's own function
Campbell Barton [Fri, 7 May 2021 07:49:14 +0000 (17:49 +1000)]
Cleanup: extract image loading into it's own function

8 months agoFix use of imbuf that was never valid in animation player
Campbell Barton [Fri, 7 May 2021 07:25:06 +0000 (17:25 +1000)]
Fix use of imbuf that was never valid in animation player

Resizing the window would always draw the image with an empty imbuf.

8 months agoCleanup: minor changes from master to avoid merge conflicts
Campbell Barton [Fri, 7 May 2021 07:12:41 +0000 (17:12 +1000)]
Cleanup: minor changes from master to avoid merge conflicts

8 months agoVSE: Fix freeing display buffer cache before use
Richard Antalik [Fri, 7 May 2021 07:57:09 +0000 (09:57 +0200)]
VSE: Fix freeing display buffer cache before use

`IMB_display_buffer_release()` was called before `display_buffer` was
used by drawing code. This should not be done as it may cause problems.

8 months agoFix T81751: Use GLSL for better anim player performance
Richard Antalik [Fri, 7 May 2021 07:43:26 +0000 (09:43 +0200)]
Fix T81751: Use GLSL for better anim player performance

Originally colorspace of float images was converted using CPU.
GLSL will render images much faster.

Originally image was converted to `global_role_default_byte` space,
disregarding view transform and also display device, which now is
possible to specify. These parameters could be set via commandline to
settings used in Blender, however if they are to be set by users, these
needs to be sanitized.
Right now defaults are assumed for device given for
`COLOR_ROLE_DEFAULT_BYTE`. This should produce same behavior as
implemented before.

Together with D11167 animation player performance should be much better.

This code was mostly copy-pasted from sequencer.

Reviewed By: sergey

Differential Revision:

8 months agoFix inconsistency setting particle edit-mode
Campbell Barton [Fri, 7 May 2021 00:44:13 +0000 (10:44 +1000)]
Fix inconsistency setting particle edit-mode

The check to include particle edit mode in the object-mode drop-down
didn't match the poll function to edit particle edit mode.

Share the check between both functions.

8 months agoFix T83398: Fade inactive geometry overlay option not visible depending on the mode
Pablo Dobarro [Thu, 6 May 2021 17:16:10 +0000 (19:16 +0200)]
Fix T83398: Fade inactive geometry overlay option not visible depending on the mode

This option should always be available. Even if it does not affect the
current object depending on its mode, it affects the rest of the geometry
of the scene.

The rest of the options also work this way. For example, a grease pencil
object does not have face orientation, but the ovelay option is still
there for the rest of the scene.

Reviewed By: JulienKaspar, HooglyBoogly

Maniphest Tasks: T83398

Differential Revision:

8 months agoFix T88065: Spline-IK bone position calculation fails in some cases
Sebastian Parborg [Thu, 6 May 2021 16:55:22 +0000 (18:55 +0200)]
Fix T88065: Spline-IK bone position calculation fails in some cases

Fix trying to use cross product on parallel vectors.

Fix intersection checks failing because we run into floating point
issues with very small numbers.

8 months agoLibOverride: Better handling of 'orphaned' Objects in override creation.
Bastien Montagne [Thu, 6 May 2021 15:45:40 +0000 (17:45 +0200)]
LibOverride: Better handling of 'orphaned' Objects in override creation.

One of current annoying limitations of Blender re Collections/Objects is
that objects are forbidden to not be instantiated in at least one

Code ensuring that as a pst-processing step of override creation/resync
operations would be a bit too eager to add those objects to an external
'ad-hoc' collection, which poses several issues (both in term of keeping
the scene well organized, and related to override hierarchy handling).

So now be very conservative and only generate and use  external 'storage'
collection for those objects when it is absolutely mandatory.

In pratice, it means this should never happen anymore on any decently
organized data source.

8 months agoFix T88030: operator showing options it shouldnt
Philipp Oeser [Wed, 5 May 2021 16:42:41 +0000 (18:42 +0200)]
Fix T88030: operator showing options it shouldnt

Caused by {rB0d9f79b163ee}.

IDP_SyncGroupTypes was now syncing from src to src (leading to
unexpected operator properties).

Assume this is rather critical, dont know the part of the code well, but
above commit clearly shows a change from 'dest->' to 'src-
>' which shouldnt be there.

Maniphest Tasks: T88030

Differential Revision:

8 months agoFix T87983: Motion tracker button tooltips identical
Falk David [Thu, 6 May 2021 08:59:41 +0000 (10:59 +0200)]
Fix T87983: Motion tracker button tooltips identical

The tooltips for the tracker buttons were all equal (because they all
use the same operator).

This adds the `get_description` operator callback to the
`CLIP_OT_track_markers` operator and returns a more descriptive
tooltip for the different buttons.

Reviewed By: mont29

Maniphest Tasks: T87983

Differential Revision: