4 months agoMerge branch 'blender-v2.93-release'
Antonio Vazquez [Tue, 18 May 2021 13:43:06 +0000 (15:43 +0200)]
Merge branch 'blender-v2.93-release'

4 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.

4 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.

4 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

4 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.

4 months agoWM: check missing space-data & constraints in poll functions
Campbell Barton [Tue, 18 May 2021 10:00:51 +0000 (20:00 +1000)]
WM: check missing space-data & constraints in poll functions

Without this, menu search prints many errors in some contexts.

4 months agoMerge branch 'blender-v2.93-release'
Sebastián Barschkis [Tue, 18 May 2021 10:52:29 +0000 (12:52 +0200)]
Merge branch 'blender-v2.93-release'

4 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.

4 months agoTests: Remove threshold param from physics ocean mesh test
Sebastián Barschkis [Tue, 18 May 2021 10:44:53 +0000 (12:44 +0200)]
Tests: Remove threshold param from physics ocean mesh test

This was not the reason for the test failure on macOS arm64.

4 months agoMerge branch 'blender-v2.93-release'
Campbell Barton [Tue, 18 May 2021 09:59:20 +0000 (19:59 +1000)]
Merge branch 'blender-v2.93-release'

4 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

4 months agoCycles: Avoid unnecessary data updates in viewport
Sergey Sharybin [Mon, 17 May 2021 16:23:44 +0000 (18:23 +0200)]
Cycles: Avoid unnecessary data updates in viewport

The BlenderSync will do quite a bit of work on every sync_data() call
even if there is nothing changed in the scene. There will be early
outputs done deeper in the call graph, but this is not really enough to
ensure best performance during viewport navigation.

This change makes it so sync_data() is only used when dependency graph
has any update tags: if something changed in the scene the dependency
graph will know it. If nothing changed there will be no IDs tagged for an
update in the dependency graph.

There are two weak parts in the current change:

- With the persistent data there is a special call to ignore the check
  of the dependency graph tags. This is more of a safety, because it is
  not immediately clear what the correct state of recalc flags is.

- Deletion of objects is detected indirectly, via tags of scene and

It might not be bad for the first version of the change.

The test file used: {F10117322}

Simply open the file, start viewport render, and navigate the viewport.
On my computer this avoids 0.2sec spend on data_sync() on every
up[date of viewport navigation.

We can do way more granular updates in the future: for example, avoid
heavy objects sync when it is only camera object which changed. This
will need an extended support from the dependency graph API. Doing
nothing if nothing is changed is something we would want to do anyway.

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Campbell Barton [Tue, 18 May 2021 07:48:14 +0000 (17:48 +1000)]
Merge branch 'blender-v2.93-release'

4 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.

4 months agoCleanup: use const casts in mathutils API
Campbell Barton [Tue, 18 May 2021 04:13:20 +0000 (14:13 +1000)]
Cleanup: use const casts in mathutils API

4 months agoPyAPI: allow any vector sequence for poly_3d_calc(..)
Campbell Barton [Tue, 18 May 2021 04:09:03 +0000 (14:09 +1000)]
PyAPI: allow any vector sequence for poly_3d_calc(..)

Previously only vectors were accepted for the second point argument:

4 months agoCleanup: format
Kévin Dietrich [Tue, 18 May 2021 04:09:28 +0000 (06:09 +0200)]
Cleanup: format

4 months agoMerge branch 'blender-v2.93-release'
Campbell Barton [Tue, 18 May 2021 03:39:39 +0000 (13:39 +1000)]
Merge branch 'blender-v2.93-release'

4 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

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

4 months agoAlembic procedural: fix wrong property used as base for attribute
Kévin Dietrich [Mon, 17 May 2021 22:59:29 +0000 (00:59 +0200)]
Alembic procedural: fix wrong property used as base for attribute

We use the schema so that we can access top level attributes as well.
This is already done for polygon meshes and curves, so this only
modifies the behavior for subdivision objects.

4 months agoAlembic procedural: fix crash accessing invalid ICompoundProperties
Kévin Dietrich [Mon, 17 May 2021 22:56:45 +0000 (00:56 +0200)]
Alembic procedural: fix crash accessing invalid ICompoundProperties

Although it is not a pointer, accessing an ICompoundProperty
dereferences a pointer under the hood, so check for validity.

4 months agoAdd comment regarding Fade Inactive Geometry property in overlays popover
Pablo Dobarro [Mon, 17 May 2021 22:51:11 +0000 (00:51 +0200)]
Add comment regarding Fade Inactive Geometry property in overlays popover

Reviewed By: campbellbarton

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Pablo Dobarro [Mon, 17 May 2021 22:32:48 +0000 (00:32 +0200)]
Merge branch 'blender-v2.93-release'

4 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:

4 months agoTests: Increased threshold param for physics_ocean test
Sebastián Barschkis [Mon, 17 May 2021 21:21:16 +0000 (23:21 +0200)]
Tests: Increased threshold param for physics_ocean test

Adjusting threshold to see what the buildbot will make of this.

4 months agoTests: Added threshold to physics ocean mesh test
Sebastián Barschkis [Mon, 17 May 2021 19:13:35 +0000 (21:13 +0200)]
Tests: Added threshold to physics ocean mesh test

The physics_ocean test is currently failing on macOS arm.
This is one attempt to fix this issue.

4 months agoCollada import: use black for Base Color when missing <diffuse>
Gaia Clary [Mon, 17 May 2021 19:05:20 +0000 (21:05 +0200)]
Collada import: use black for Base Color when missing <diffuse>

Treat a missing <diffuse> the same as a black diffuse color.

The easiest way to see this bug is with a Collada shader like

              <color sid="emission">1 0 0 1</color>

The Collada spec says this should be just

color = <emission>

ie. red everywhere. The importer slots the red into the Principled Emission socket, but since it leaves the Base Color as the default off-white, this is added to red, and the material looks white-pink in the light and red only in the shadows.

Putting black in the Base Color makes it look red everywhere.

D10939 will also eliminate the much-less-noticeable specular term for this case.

Reviewed By: gaiaclary

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Brecht Van Lommel [Mon, 17 May 2021 18:18:39 +0000 (20:18 +0200)]
Merge branch 'blender-v2.93-release'

4 months agorefactor: minor changes to previous commit
Gaia Clary [Mon, 17 May 2021 18:04:56 +0000 (20:04 +0200)]
refactor: minor changes to previous commit
- rename boolean is_zero by more descriptive has_specularity
- add some clarifying comments (and TODO)

4 months agoCollada import: respect zero-specularity
Scurest [Mon, 17 May 2021 17:49:15 +0000 (19:49 +0200)]
Collada import: respect zero-specularity

Collada shaders with black <specular> should import with Specular=0.
(A missing <specular> is the same as black.)

The general specular conversion is hard, but this case is common and easy.
Fixes the specular for all <constant>/<lambert> shaders, and <blinn>/<phong>
shaders with black/omitted <specular>. Before this they all looked too "shiny".

Reviewed By: gaiaclary

Differential Revision:

4 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.

4 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.

4 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

4 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

4 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.

4 months agoMathutils: add a Matrix.LocRotScale constructor for combining channels.
Alexander Gavrilov [Fri, 14 May 2021 16:46:19 +0000 (19:46 +0300)]
Mathutils: add a Matrix.LocRotScale constructor for combining channels.

Combining location, rotation and scale channels into a matrix is
a standard task, so while it is easily accomplished by constructing
and multiplying 3 matrices, having a standard utility allows for
more clear code.

The new constructor builds a 4x4 matrix from separate location,
rotation and scale values. Rotation can be represented as a 3x3
Matrix, Quaternion or Euler value, while the other two inputs
are vectors. Unneeded inputs can be replaced with None.

Differential Revision:

4 months agoFile List: micro optimization in the icon preview
Germano Cavalcante [Mon, 17 May 2021 12:09:12 +0000 (09:09 -0300)]
File List: micro optimization in the icon preview

No real functional changes.

When `i` is zero, `filelist_cache_previews_push` was called twice with
the same icon.

This caused the preview to be computed twice when only once is needed.

4 months agoCleanup: reduce indentation in filelist_cache_previews_push
Germano Cavalcante [Mon, 17 May 2021 11:54:53 +0000 (08:54 -0300)]
Cleanup: reduce indentation in filelist_cache_previews_push

4 months agoMerge branch 'blender-v2.93-release'
Antonio Vazquez [Mon, 17 May 2021 11:06:59 +0000 (13:06 +0200)]
Merge branch 'blender-v2.93-release'

4 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.

4 months agoGeometry Nodes: update callbacks with 2 new socket types
Wannes Malfait [Mon, 17 May 2021 09:11:25 +0000 (11:11 +0200)]
Geometry Nodes: update callbacks with 2 new socket types

4 months agoMerge branch 'blender-v2.93-release'
Campbell Barton [Mon, 17 May 2021 08:04:22 +0000 (18:04 +1000)]
Merge branch 'blender-v2.93-release'

4 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.

4 months agoUI: use non-linear sliders
Henrik Dick [Mon, 17 May 2021 07:33:00 +0000 (17:33 +1000)]
UI: use non-linear sliders

* Boolean Modifier > Fast > Overlap Threshold (Logarithmic).
* Remesh Modifier > Voxel > Voxel Size (Logarithmic).
* Sculpt > Dyntopo > Detail Size (Cubic).

Ref D9074

4 months agoUI: add non-linear slider support
Henrik Dick [Mon, 17 May 2021 07:28:12 +0000 (17:28 +1000)]
UI: add non-linear slider support

This patch introduces non linear sliders. That means, that the movement
of the mouse doesn't map linearly to the value of the slider.

The following changes have been made.

- Free logarithmic sliders with maximum range of (`0 <= x < inf`)
- Logarithmic sliders with correct value indication bar.
- Free cubic sliders with maximum range of (`-inf < x < inf`)
- Cubic sliders with correct value indication bar.

Cubic mapping has been added as well, because it's used for brush sizes
in other applications (Krita for e.g.).

To make a slider have a different scale type use following line in RNA:
 `RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOGARITHMIC);`
 `RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);`

Test the precision, step size and soft-min if you change the scale type
of a property as it will feel very different and may need tweaking.

Ref D9074

4 months agoCleanup: remove commented code, use function to access header region
Campbell Barton [Mon, 17 May 2021 05:55:00 +0000 (15:55 +1000)]
Cleanup: remove commented code, use function to access header region

4 months agoCleanup: missing declaration warning
Campbell Barton [Mon, 17 May 2021 05:22:19 +0000 (15:22 +1000)]
Cleanup: missing declaration warning

4 months agoCleanup: clang-format
Campbell Barton [Mon, 17 May 2021 05:12:41 +0000 (15:12 +1000)]
Cleanup: clang-format

4 months agoCleanup: Fix missing-braces warning on Linux / GCC
Campbell Barton [Mon, 17 May 2021 05:04:10 +0000 (15:04 +1000)]
Cleanup: Fix missing-braces warning on Linux / GCC

4 months agoCleanup: Fix missing-braces warning on macOS Clang
Ankit Meel [Sun, 16 May 2021 05:49:21 +0000 (11:19 +0530)]
Cleanup: Fix missing-braces warning on macOS Clang

4 months agoCleanup: Fix inconsistent-missing-override warning
Ankit Meel [Sun, 16 May 2021 05:49:04 +0000 (11:19 +0530)]
Cleanup: Fix inconsistent-missing-override warning
macOS Clang

4 months agoCleanup: Improve comments
Hans Goudey [Sat, 15 May 2021 23:00:20 +0000 (18:00 -0500)]
Cleanup: Improve comments

4 months agoCleanup: Use helper function
Hans Goudey [Sat, 15 May 2021 22:50:29 +0000 (17:50 -0500)]
Cleanup: Use helper function

Use the `CurveEval` function introduced in the last commit.

4 months agoSplines: Convenience methods for point offsets of multiple splines
Hans Goudey [Sat, 15 May 2021 22:44:33 +0000 (17:44 -0500)]
Splines: Convenience methods for point offsets of multiple splines

Since spline data is stored separately for each spline, the data often
needs to be flattened into a separate array. It's helpful to have the
necessarily-sequential part of that split off into a separate method.
I've found myself using functions like these in quite a few places.

4 months agoXR Controller Support Step 1: Internal Abstractions for OpenXR Actions
Peter Kim [Sat, 15 May 2021 18:33:10 +0000 (03:33 +0900)]
XR Controller Support Step 1: Internal Abstractions for OpenXR Actions

Adds internal API for creating and managing OpenXR actions at the
GHOST and WM layers. Does not bring about any changes for users since
XR action functionality is not yet exposed in the Python API (will be
added in a subsequent patch).

OpenXR actions are a means to communicate with XR input devices and
can be used to retrieve button/pose states or apply haptic feedback.
Actions are bound to device inputs via a semantic path binding
which serves as an XR version of keymaps.

Main features:

- Abstraction of OpenXR action management functions to GHOST-XR,
- New "xr_session_start_pre" callback for creating actions at
  appropriate point in the XR session.
- Creation of name-identifiable action sets/actions.
- Binding of actions to controller inputs.
- Acquisition of controller button states.
- Acquisition of controller poses.
- Application of controller haptic feedback.
- Carefully designed error handling and useful error reporting
  (e.g. action set/action name included in error message).

Reviewed By: Julian Eisel

Differential Revision:

4 months agoCleanup: silence unused parameter warnings
Germano Cavalcante [Sat, 15 May 2021 17:13:22 +0000 (14:13 -0300)]
Cleanup: silence unused parameter warnings

Introduced in rB48fa029dd11b.

4 months agoMerge branch 'blender-v2.93-release'
Clément Foucault [Sat, 15 May 2021 16:34:28 +0000 (18:34 +0200)]
Merge branch 'blender-v2.93-release'

4 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.

4 months agoMerge branch 'blender-v2.93-release'
Clément Foucault [Sat, 15 May 2021 15:52:26 +0000 (17:52 +0200)]
Merge branch 'blender-v2.93-release'

4 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

4 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.

4 months agoGPencil: Add parameter removed by error in previous commit
Antonio Vazquez [Sat, 15 May 2021 13:53:13 +0000 (15:53 +0200)]
GPencil: Add parameter removed by error in previous commit

This fix the compiler warning too.

4 months agoMerge branch 'blender-v2.93-release'
Philipp Oeser [Sat, 15 May 2021 00:55:25 +0000 (02:55 +0200)]
Merge branch 'blender-v2.93-release'

4 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:

4 months agoMerge branch 'blender-v2.93-release'
Philipp Oeser [Sat, 15 May 2021 00:34:47 +0000 (02:34 +0200)]
Merge branch 'blender-v2.93-release'

4 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:

4 months agoMerge branch 'blender-v2.93-release'
Philipp Oeser [Sat, 15 May 2021 00:06:02 +0000 (02:06 +0200)]
Merge branch 'blender-v2.93-release'

4 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:

4 months agoCleanup: Update / improve comments
Hans Goudey [Fri, 14 May 2021 21:37:05 +0000 (16:37 -0500)]
Cleanup: Update / improve comments

4 months agoDocs: PyAPI: Replace use of the bgl module in the RenderEngine example
Germano Cavalcante [Sun, 2 May 2021 19:30:23 +0000 (16:30 -0300)]
Docs: PyAPI: Replace use of the bgl module in the RenderEngine example

The bgl module will be discontinued.

This example is seen at: uses it.

Differential Revision:

4 months agoCleanup: Move attribute code to attribute header
Hans Goudey [Fri, 14 May 2021 20:53:43 +0000 (15:53 -0500)]
Cleanup: Move attribute code to attribute header

This code in the geometry set header was not directly related to
geometry sets, it makes more sense in the attribute access header.
This makes it clearer that code for geometry components uses attribute
code, rather than the other way around. It also allows adding more
functionality to `BKE_attribute_access.hh` that depends on these things
without including `BKE_geometry_set.hh` there.

4 months agoFix T88262: Curve to mesh crash with vector last segment
Hans Goudey [Fri, 14 May 2021 16:26:42 +0000 (11:26 -0500)]
Fix T88262: Curve to mesh crash with vector last segment

The code incorrectly used the size of the second to last segment rather
than the last segment's size. That was a problem when the last segment
is a vector segment but the second to last isn't.

I also used the opportunity to slightly refactor the control point
offsets cache, making it one longer so it also contains information
about the size of the last segment, simplifying other code.

4 months agoMerge branch 'blender-v2.93-release'
Philipp Oeser [Fri, 14 May 2021 16:18:24 +0000 (18:18 +0200)]
Merge branch 'blender-v2.93-release'

4 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:

4 months agoMerge branch 'blender-v2.93-release'
Philipp Oeser [Fri, 14 May 2021 16:10:12 +0000 (18:10 +0200)]
Merge branch 'blender-v2.93-release'


4 months agoGPencil: Refactor Append operators
Antonio Vazquez [Fri, 14 May 2021 15:59:16 +0000 (17:59 +0200)]
GPencil: Refactor Append operators

Now the operators work like other areas of Blender using the list of selected objects.

Also, the name has been changed to:

- Copy Layer to Selected
- Copy All Layers to Selected

- Copy Material to Selected
- Copy All Materials to Selected```

Reviewed By: mendio, pablovazquez, pepeland

Differential Revision:

4 months agoCLOG: Fix memleak in own recent improvement to CLOG filter.
Bastien Montagne [Fri, 14 May 2021 15:45:14 +0000 (17:45 +0200)]
CLOG: Fix memleak in own recent improvement to CLOG filter.

Mistake in rBef5782e29744.

4 months agoPython GPU: Replace part of the code that uses 'bgl' with 'gpu'
Germano Cavalcante [Fri, 14 May 2021 14:15:00 +0000 (11:15 -0300)]
Python GPU: Replace part of the code that uses 'bgl' with 'gpu'

This is part of the process described in T80730.

The aim is to deprecate the bgl module.

Reviewed By: fclem, brecht, campbellbarton

Revision: D11147

4 months agoPython GPU: New 'platform' module
Germano Cavalcante [Fri, 14 May 2021 14:15:00 +0000 (11:15 -0300)]
Python GPU: New 'platform' module

This module exposes the platform utils defined in the GPU module in C.

This will be useful for porting existing code with `bgl` to `gpu`.

Reviewed By: fclem, brecht, campbellbarton

Maniphest Tasks: T80730

Part of D11147

4 months agoPython GPU: New 'capabilities' module
Germano Cavalcante [Fri, 14 May 2021 14:15:00 +0000 (11:15 -0300)]
Python GPU: New 'capabilities' module

This module exposes the capabilities defined in the GPU module in C.

This will be useful for porting existing code in `bgl` to `gpu`.

Reviewed By: fclem, brecht, campbellbarton

Maniphest Tasks: T80730

Part of D11147

4 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:

4 months agoCleanup: use enum types for screen direction variables
Campbell Barton [Thu, 13 May 2021 05:43:53 +0000 (15:43 +1000)]
Cleanup: use enum types for screen direction variables

The term direction was used in 3 different ways in screen editing code,
making it hard to follow:

- 0-3 for as magic numbers mapped to [west,north,east,south].
- `h`, `v` characters for [horizontal,vertical] axes.

The following changes have been made:

- Add `eScreenDir` for [west,north,east,south], use variable name `dir`.
- Add `eScreenAxis` for [horizontal,vertical] values, use variable name
- Add `eScreenCycle` for existing enum `SPACE_CONTEXT_CYCLE_{PREV/NEXT}`.
- Add macros `SCREEN_DIR_IS_VERTICAL(dir)`,
  Replacing `ELEM(dir, 1, 3)`, `ELEM(dir, 0, 2)`.
- Move `ED_screen_draw_join_highlight`, `ED_screen_draw_split_preview`
  to `screen_intern.h`.

Reviewed By: Severin

Ref D11245

4 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)


4 months agoPyAPI: use iterators for ID property methods (keys, values & items)
Campbell Barton [Mon, 10 May 2021 23:40:41 +0000 (09:40 +1000)]
PyAPI: use iterators for ID property methods (keys, values & items)

- Matches changes in Python 3.x dictionary methods.

- Iterating now raises a run-time error if the property-group changes
  size during iteration.

- IDPropertyGroup.iteritems() has been removed.

- IDPropertyGroup View & Iterator types have been added.

- Some set functionality from dict_keys/values/items aren't yet
  supported (isdisjoint method and boolean set style operations).

Proposed as part of T85675.

4 months agoNodes: fix connecting wrong sockets when inserting node
Jacques Lucke [Fri, 14 May 2021 14:01:55 +0000 (16:01 +0200)]
Nodes: fix connecting wrong sockets when inserting node

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Jacques Lucke [Fri, 14 May 2021 11:45:48 +0000 (13:45 +0200)]
Merge branch 'blender-v2.93-release'

4 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:

4 months agoMerge branch 'blender-v2.93-release'
Campbell Barton [Fri, 14 May 2021 09:27:30 +0000 (19:27 +1000)]
Merge branch 'blender-v2.93-release'

4 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.

4 months agoGeometry Nodes: use texture socket in Attribute Sample Texture node
Jacques Lucke [Fri, 14 May 2021 09:22:02 +0000 (11:22 +0200)]
Geometry Nodes: use texture socket in Attribute Sample Texture node

There is a new Texture data-block socket that we can use in Geometry
Nodes now. This commit replaces the texture property of a node and
gives it a texture input socket instead. That increases flexibility.

The texture socket still has some limitations that will be lifted in the
next couple of days (e.g. it's not supported by the switch node and
cannot be exposed the a modifier yet).

Differential Revision:

4 months agoCleanup: sort include dirs in CMakeLists.txt
Sybren A. Stüvel [Fri, 14 May 2021 09:12:35 +0000 (11:12 +0200)]
Cleanup: sort include dirs in CMakeLists.txt

Sort include dirs in just one file, not a big change

No functional changes.

4 months agoGeometry Nodes: remove some unnecessary updates
Jacques Lucke [Fri, 14 May 2021 08:58:08 +0000 (10:58 +0200)]
Geometry Nodes: remove some unnecessary updates

This fixes a few "obvious" places where we do unnecessary updates.
Those special cases were added in the early days of geometry nodes
when many updates were missing and we tried to get it to work at all.
There is a fairly high risk that with this change some required updates
will be missing again. Those can be fixed when we find thme.
Some of the update issues might have been fixed by rB58818cba40794905f9323080e60884e090f2d388
and similar changes we added over time.

Differential Revision:

4 months agoAnimation: Pose sliding tools improvements
Christoph Lendenfeld [Fri, 14 May 2021 08:46:19 +0000 (10:46 +0200)]
Animation: Pose sliding tools improvements

Improve the "In Betweens" tools:
- Push Pose from Rest Pose
- Relax Pose to Rest Pose
- Push Pose from Breakdown
- Relax Pose to Breakdown
- Pose Breakdowner

These all now use the same new sliding tool:
- Actual visual indication of the blending/pushing percentage applied.
- Mouse wrapping to allow for extrapolation without having to worry
  about the initial placement of the mouse. This also means these tools
  are actually usable when chosen from the menu.
- Precision mode by holding {key Shift}.
- Snapping to 10% increments by holding {key Ctrl}.
- Overshoot protection; by default the tool doesn't allow overshoot
  (lower than 0% or higher than 100%), and it can be enabled by pressing
  {key E}.
- Bones are hidden while sliding, so the pose itself can be seen more
  clearly. This can be toggled by pressing {key H} while using the tool.

Reviewed By: #animation_rigging, zeddb, sybren, #user_interface, brecht, Severin, looch

Maniphest Tasks: T81836

Differential Revision:

4 months agoCleanup: spelling, rename metas to meta-strips / meta-balls
Campbell Barton [Fri, 14 May 2021 07:35:22 +0000 (17:35 +1000)]
Cleanup: spelling, rename metas to meta-strips / meta-balls

4 months agoCleanup: clang-format
Campbell Barton [Fri, 14 May 2021 07:35:08 +0000 (17:35 +1000)]
Cleanup: clang-format

4 months agoDrawTest: Make setup method public.
Jeroen Bakker [Fri, 14 May 2021 06:34:13 +0000 (08:34 +0200)]
DrawTest: Make setup method public.

This allows other tests to override it.

4 months agoDraw: Put DrawTest in its own compile unit.
Jeroen Bakker [Fri, 14 May 2021 05:55:01 +0000 (07:55 +0200)]
Draw: Put DrawTest in its own compile unit.

DrawTest will be used by other tests as well.

4 months agoFix sculpt neighbor iterator not taking visibility into account
Pablo Dobarro [Fri, 14 May 2021 01:07:18 +0000 (03:07 +0200)]
Fix sculpt neighbor iterator not taking visibility into account

Sculpting tools are designed to ignore hidden geometry and behave like
hidden geometry does not exist.
When getting the neighbors of a vertex, now this takes into account
hidden geometry to avoid returing neighbors which connected edge is not
visible. This should make corner cases of a lot of tools work properly,
especially when working in low poly meshes when is common to have a
single face loop hidden.

Reviewed By: JacquesLucke

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Kévin Dietrich [Fri, 14 May 2021 00:42:19 +0000 (02:42 +0200)]
Merge branch 'blender-v2.93-release'