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'

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

4 months agoFix Sculpt tools showing the cursor of the previous active brush
Pablo Dobarro [Thu, 13 May 2021 22:44:23 +0000 (00:44 +0200)]
Fix Sculpt tools showing the cursor of the previous active brush

When using a tool that is not a brush, the previously used brush
preset will still be active in the tool settings, so the cursor will
draw its custom reviews.
This checks if the current active tool is a brush before drawing its
previews. If it is not a brush tools, it draws a default white cursor.

Reviewed By: sergey

Differential Revision:

4 months agoFix build after last commit
Hans Goudey [Thu, 13 May 2021 22:52:30 +0000 (17:52 -0500)]
Fix build after last commit

Part of a rename change in rBc5d38a2be8 was lost when committing.

4 months agoFunctions: Expose set_all method for generic virtual arrays
Hans Goudey [Thu, 13 May 2021 22:47:46 +0000 (17:47 -0500)]
Functions: Expose set_all method for generic virtual arrays

This is very similar to rB5613c61275fe6 and rB0061150e4c90d, basically
just exposing a `VMutableArray` method to its generic counterpart. This
is quite important for curve point attributes to avoid a lookup for
every point when there are multiple splines.

4 months agoCleanup: Clang format
Hans Goudey [Thu, 13 May 2021 22:37:51 +0000 (17:37 -0500)]
Cleanup: Clang format

4 months agoCollada import: connect Emission texture to Emission socket
Scurest [Thu, 13 May 2021 21:14:57 +0000 (23:14 +0200)]
Collada import: connect Emission texture to Emission socket

An emission texture is currently connected to the Base Color socket. It should connect to the Emission socket, like a constant does.

Reviewed By: gaiaclary

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Fabian Schempp [Thu, 13 May 2021 21:07:05 +0000 (23:07 +0200)]
Merge branch 'blender-v2.93-release'

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

4 months agoBLI: simplify supporting heterogeneous lookup for new types
Jacques Lucke [Thu, 13 May 2021 12:14:14 +0000 (14:14 +0200)]
BLI: simplify supporting heterogeneous lookup for new types

Heterogeneous lookup is useful when constructing a key in a
map/set is relatively expensive (e.g. `std::string`). When doing
lookups in the map/set, one usually does not want to construct
the type to avoid overhead. Instead, heterogeneous lookup
allows for using a different type (such as `StringRef`) as key.

This change makes it easier to implement heterogeneous
lookup for custom types. Before, one had to specialize
`blender::DefaultHash`. Now, one just has to implement
a `static uint64_t hash_as(value)` on the type itself.
One still has to provide the equality operator in addition
to the hash function of course.

4 months agoModifiers: allow usage of tbb
Jacques Lucke [Thu, 13 May 2021 11:45:05 +0000 (13:45 +0200)]
Modifiers: allow usage of tbb

Before, any usage of tbb wrappers used in modifier code would
just fall back to the non-threaded non-tbb version.

We ran into this issue a couple of times in patches.

4 months agoNodes: add utility method to get input/output of a DNode
Jacques Lucke [Thu, 13 May 2021 11:42:38 +0000 (13:42 +0200)]
Nodes: add utility method to get input/output of a DNode

This is a fairly common operation, so there should be a method
that does it to avoid unnecessary complexity at the caller site.

4 months agoBLI: support looking up a key stored in Map or VectorSet
Jacques Lucke [Thu, 13 May 2021 11:39:23 +0000 (13:39 +0200)]
BLI: support looking up a key stored in Map or VectorSet

Sometimes it is useful to find the key that compares equal
to a known key. Typically that happens when the key itself
has additional data attached that is not part of its hash.

Note that the returned key reference/pointer is const, because
the caller must not change the key in a way that changes its
hash or how it compares to other keys.

4 months agoFunctions: simplify adding a single input to a multi-function
Jacques Lucke [Thu, 13 May 2021 11:23:53 +0000 (13:23 +0200)]
Functions: simplify adding a single input to a multi-function

This is used by the upcoming new geometry nodes evaluator.

4 months agoBLI: add initial wrapper for tbb::enumerable_thread_specific
Jacques Lucke [Thu, 13 May 2021 11:20:16 +0000 (13:20 +0200)]
BLI: add initial wrapper for tbb::enumerable_thread_specific

The wrapper is necessary to support building without TBB.
This class is used by the upcoming new evaluator for
geometry nodes.

4 months agoNodes: ignore unavailable sockets in logically linked sockets iterator
Jacques Lucke [Thu, 13 May 2021 11:11:28 +0000 (13:11 +0200)]
Nodes: ignore unavailable sockets in logically linked sockets iterator

Unavailable sockets should generally be ignored during evaluation.
They mainly exist because we don't have a better mechanism to turn
some sockets on/off depending on node parameters.

Currently, it is still possible that a link connects an available with an
unavailable socket. This link is not displayed in the ui and should
generally be ignored.

4 months agoCleanup: inconsistent parameter name
Jacques Lucke [Thu, 13 May 2021 11:06:42 +0000 (13:06 +0200)]
Cleanup: inconsistent parameter name

4 months agoCleanup: missing override
Jacques Lucke [Thu, 13 May 2021 11:06:28 +0000 (13:06 +0200)]
Cleanup: missing override

4 months agoGeometry Nodes: add mutex for node ui storage
Jacques Lucke [Thu, 13 May 2021 11:06:09 +0000 (13:06 +0200)]
Geometry Nodes: add mutex for node ui storage

Previously, multiple threads adding information to node ui storage
at the same time resulted in memory corruption. The lock prevents
that, but might potentially become a bottleneck in the future.
For now favour correctness over a potential performance bottleneck.

4 months agoBLI: add LinearAllocator.construct_array method
Jacques Lucke [Thu, 13 May 2021 10:58:02 +0000 (12:58 +0200)]
BLI: add LinearAllocator.construct_array method

Previously, one could allocate an array, but not construct its
elements directly. This method just adds some convenience.

4 months agoCleanup: use boolean argument
Campbell Barton [Thu, 13 May 2021 02:44:58 +0000 (12:44 +1000)]
Cleanup: use boolean argument

4 months agoCleanup: clang format
Campbell Barton [Thu, 13 May 2021 02:44:11 +0000 (12:44 +1000)]
Cleanup: clang format

4 months agoUI: Use term 'Preferences' instead of 'User Prefs'
Aaron Carlisle [Thu, 13 May 2021 00:40:16 +0000 (20:40 -0400)]
UI: Use term 'Preferences' instead of 'User Prefs'

'Preferences' is the term used elsewhere in Blender so this commit makes
the option more consistent.

In the future, the "default" target could be changed to something more

4 months agoPyAPI Docs: Cleanup Formatting
Aaron Carlisle [Thu, 13 May 2021 00:29:32 +0000 (20:29 -0400)]
PyAPI Docs: Cleanup Formatting

4 months agoUI: Improved "Area Close" Neighbor Selection
Harley Acheson [Wed, 12 May 2021 23:52:43 +0000 (16:52 -0700)]
UI: Improved "Area Close" Neighbor Selection

The new "Close Area" operator can let any neighbor replace the area to
be closed. This patch improves the selection of the best, and most-
aligned, neighbor.  It maximizes the ratio of the shared edge lengths,
rather than minimize the absolute amount of misalignment. This follows
our expectations closer because it takes into account the relative
sizes of the areas and their edges.

see D11143 for details and examples.

Differential Revision:

Reviewed by Campbell Barton

4 months agoMerge branch 'blender-v2.93-release'
Richard Antalik [Wed, 12 May 2021 18:25:16 +0000 (20:25 +0200)]
Merge branch 'blender-v2.93-release'

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

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

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

4 months agoCleanup: Simplify public/private specifiers
Hans Goudey [Wed, 12 May 2021 16:50:35 +0000 (11:50 -0500)]
Cleanup: Simplify public/private specifiers

By rearranging a few variables we can remove redundant specifiers

4 months agoCleanup: Splines: Add accessors to spline vector
Hans Goudey [Wed, 12 May 2021 16:46:13 +0000 (11:46 -0500)]
Cleanup: Splines: Add accessors to spline vector

Not allowing external direct access to the vector of splines in the
curve will help for things like reallocating custom data when a spline
is added or removed.

4 months agoUI: Colors for Texture/Material node sockets and small tweaks
Pablo Vazquez [Wed, 12 May 2021 15:55:07 +0000 (17:55 +0200)]
UI: Colors for Texture/Material node sockets and small tweaks

* Set colors for the new texture and material sockets
  * Material uses the same color used for shading icons
  * Texture uses a plum color desaturated enough to not be confused with Vector's violet
* Image socket adjusted to be closer to Texture sockets but darker
* Integer socket toned down in saturation to not stand out so much
  (and be closer to float sockets which are gray)

Making this change now during bcon1 to gather feedback from the community,
and because Geometry Nodes needs to use the new texture/material sockets.

4 months agoGeometry Nodes Curves: Expose first builtin point attributes
Hans Goudey [Wed, 12 May 2021 15:21:12 +0000 (10:21 -0500)]
Geometry Nodes Curves: Expose first builtin point attributes

This commit exposes the first spline control point attributes. The
implementation incorporates the attributes into the virtual array
system, providing efficient methods to flatten the data into a
contiguous array and to apply changes from a flattened array. This
is only part of the eventual goal, which includes changes to run
attribute nodes separately for each spline to completely avoid copying.

So far `tilt` and `radius`, the two generic attributes common to
all spline types, are implemented. The more complex `position`
attribute is also added. It requires some special handling for Bezier
splines, where the control point handles need to be moved along with
the control points. To make that work I also added automatic handle
recalculation to the Bezier spline.

Differential Revision:

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

4 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

4 months agoMerge branch 'blender-v2.93-release'
Campbell Barton [Wed, 12 May 2021 12:20:51 +0000 (22:20 +1000)]
Merge branch 'blender-v2.93-release'

4 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

4 months agoPyAPI: remove deprecated & unused BMesh.from_object deform argument
Campbell Barton [Wed, 12 May 2021 12:04:06 +0000 (22:04 +1000)]
PyAPI: remove deprecated & unused BMesh.from_object deform argument

Ref T85675

4 months agoPyAPI: remove context.active_base
Campbell Barton [Wed, 12 May 2021 12:01:55 +0000 (22:01 +1000)]
PyAPI: remove context.active_base

All other access to the Base structure from Python was removed,
it seems this was left in by accident.

Ref T85675

4 months agoPyAPI: remove deprecated 'wiki_url' for add-ons 'bl_info'
Campbell Barton [Wed, 12 May 2021 12:01:50 +0000 (22:01 +1000)]
PyAPI: remove deprecated 'wiki_url' for add-ons 'bl_info'

This was only kept for compatibility with older add-ons and has been
deprecated since 2.83.

Ref T85675

4 months agoCleanup: use our own code style for doxy-gen comment blocks
Campbell Barton [Wed, 12 May 2021 11:55:25 +0000 (21:55 +1000)]
Cleanup: use our own code style for doxy-gen comment blocks

4 months agoBuilder: updated download urls with upcoming naming scheme.
Jeroen Bakker [Wed, 12 May 2021 11:17:06 +0000 (13:17 +0200)]
Builder: updated download urls with upcoming naming scheme.

4 months agoFix custom bone shape scale affecting normal bone display
Sebastian Parborg [Wed, 12 May 2021 10:55:47 +0000 (12:55 +0200)]
Fix custom bone shape scale affecting normal bone display

Also some clang-format changes.

4 months agoNodes: add boilerplate for texture and material sockets
Jacques Lucke [Wed, 12 May 2021 10:41:21 +0000 (12:41 +0200)]
Nodes: add boilerplate for texture and material sockets

The sockets are not exposed in any nodes yet.
They work similar to the Object/Collection sockets, which also
just reference a data block.

This is part of D11222.

4 months agoMerge branch 'blender-v2.93-release'
Charlie Jolly [Wed, 12 May 2021 10:18:43 +0000 (11:18 +0100)]
Merge branch 'blender-v2.93-release'

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

4 months agoMerge branch 'blender-v2.93-release'
Sergey Sharybin [Wed, 12 May 2021 08:16:01 +0000 (10:16 +0200)]
Merge branch 'blender-v2.93-release'

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

4 months agoMerge branch 'blender-v2.93-release'
Sergey Sharybin [Wed, 12 May 2021 08:01:14 +0000 (10:01 +0200)]
Merge branch 'blender-v2.93-release'

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

4 months agoCleanup: rename 'rt' to '_pad#' in DNA structs
Campbell Barton [Wed, 12 May 2021 06:44:59 +0000 (16:44 +1000)]
Cleanup: rename 'rt' to '_pad#' in DNA structs

4 months agoCycles: fix inconsistent-missing-override warnings
Ankit Meel [Wed, 12 May 2021 04:57:37 +0000 (10:27 +0530)]
Cycles: fix inconsistent-missing-override warnings
LLVM Clang 13, macOS.

Reviewed By: brecht
Differential Revision:

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

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

4 months agoNLA: Extract ..get_inverted_upper_snapshot()
Wayde Moss [Tue, 11 May 2021 20:04:18 +0000 (16:04 -0400)]
NLA: Extract ..get_inverted_upper_snapshot()

Extracts `nlasnapshot_blend_get_inverted_upper_snapshot()` from

This introduces a new struct member:
`NlaEvalChannelSnapshot->remap_domain` and marks which values of
`blended_snapshot` are processed for remapping/used-for-inverting.
Effectively, it marks which values have successfully been remapped and
can be further used for remapping.

output snapshot `r_upper_snapshot` has each channel's `remap_domain`
written to which effectively marks the successfully remapped values.
The only reason a value is not in the remap domain is if inversion
failed or it wasn't marked to be remapped.

`..get_inverted_upper_snapshot()` has a variant `nlasnapshot_blend()`
from {D10220}, but this patch doesn't depend on it at all. A third
variant will later be added `..get_inverted_lower_snapshot()`.
Altogether, these three functions allow solving for any of
(lower_snapshot, upper_snapshot, blended_snapshot) given the other two.
The function `..get_inverted_lower_snapshot()` will also similarly
process the remap domain of the blended and lower snapshot.

added assertions within `nlasnapshot_blend()` and
`..get_inverted_upper_snapshot()` to future proof branches dealing with
blendmode and mixmodes. (suggested by sybren)

No user functional changes

Reviewed By: sybren

Differential Revision:

4 months agoGeometry Nodes: Link error when implicit conversion isn't possible
Wannes Malfait [Tue, 11 May 2021 21:46:02 +0000 (16:46 -0500)]
Geometry Nodes: Link error when implicit conversion isn't possible

This turns links red if no implicit conversion can be made between the
from socket and the to socket. For geometry nodes this happens with
object, geometry, collection, and string sockets that are connected to
a different type. The change is simply implementing a callback that is
already implemented for other node tree types.

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Pablo Dobarro [Tue, 11 May 2021 21:35:49 +0000 (23:35 +0200)]
Merge branch 'blender-v2.93-release'

4 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

4 months agoMerge branch 'blender-v2.93-release'
Brecht Van Lommel [Tue, 11 May 2021 21:05:57 +0000 (23:05 +0200)]
Merge branch 'blender-v2.93-release'

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

4 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

4 months agoCleanup: unused variable warning
Charlie Jolly [Tue, 11 May 2021 13:03:40 +0000 (14:03 +0100)]
Cleanup: unused variable warning

4 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

4 months agoGeometry Nodes: Add Attribute Vector Rotate node
Charlie Jolly [Tue, 11 May 2021 09:53:13 +0000 (10:53 +0100)]
Geometry Nodes: Add Attribute Vector Rotate node

Port vector rotate node to geo attributes.

Request by @simonthommes

Reviewed By: simonthommes, HooglyBoogly

4 months agoRigging: Add transform for custom bone shapes
Yuki Shirakawa [Tue, 11 May 2021 09:22:41 +0000 (11:22 +0200)]
Rigging: Add transform for custom bone shapes

Add translation/rotation/scale parameters for custom bones shapes. The
new scale is a 3D vector `custom_shape_scale_xyz`, and replaces the
`custom_shape_scale` float.

Reviewed By: #animation_rigging, sybren, zeddb

Differential Revision:

4 months agoMerge branch 'blender-v2.93-release'
Antonio Vazquez [Tue, 11 May 2021 08:25:12 +0000 (10:25 +0200)]
Merge branch 'blender-v2.93-release'

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

4 months agoCleanup: unnecessary extra lines for doxy sections
Campbell Barton [Tue, 11 May 2021 06:04:03 +0000 (16:04 +1000)]
Cleanup: unnecessary extra lines for doxy sections