Commit Graph

120055 Commits

Author SHA1 Message Date
Iliya Katueshenock
c428b5871c Fix #116614: Empty Point Cloud crash Points to Curves
Offset accumulation cause crash for empty domain. Simple fix as early return for is empty curve offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/116640
2023-12-30 01:20:00 +01:00
Habib Gahbiche
d0c53b58bc Cleanup: Make format
Pull Request: https://projects.blender.org/blender/blender/pulls/116643
2023-12-30 01:01:15 +01:00
Clément Foucault
7d6b8737bf Fix #116623: GL/VK: Specialization constant error
Using defines leads to syntax errors. Use global
constants instead.
2023-12-30 11:09:15 +13:00
laurynas
719d1176f8 Fix #116019: Solidify Crease Inner not working with edge crease attribute
Prevents creation of redundant edge layer "crease_edge.001"

Pull Request: https://projects.blender.org/blender/blender/pulls/116491
2023-12-29 21:16:49 +01:00
Hans Goudey
2396d07f4e Fix #115857: UV project modifier crash with invalid name
Caused by 2a1ac6145a

If the attribute creation failed, the modifier would try to fill in a
null UV map. The combination of CustomData and attribute API functions
was a bit confusing, so restore the old behavior more explicitly using
just the attribute API (including the slightly weird "Float2" default
name. That could be changed later.)
2023-12-29 15:08:59 -05:00
Hans Goudey
7ed172336f Cleanup: Return attribute unique name string by value
Simplifies the code in this area, makes it work better with other C++
code. The max length argument isn't used anymore. But at that point we
wouldn't necessarily have a unique name anyway, which opens up for other
failures.
2023-12-29 15:08:59 -05:00
Habib Gahbiche
898c44bca1 Fullframe compositor: unify size inference with GPU compositor part 2
Followup to #114755. Initialize operation results explicitly if the input is constant. This patch unifies the size inference behavior of the following nodes/operation:
- Flip node
- Kuwahara (classic)
- Lens distortion
- Tonemap node

Pull Request: https://projects.blender.org/blender/blender/pulls/115733
2023-12-29 18:09:57 +01:00
Hans Goudey
8555c22ced Cleanup: Slightly improve virtual array docs 2023-12-29 10:51:26 -05:00
Pratik Borhade
6b0ecd9601 Fix #116581: DoF Aperture Ratio for Camera has incorrect softmin value
Horizotal blur is achieved when ratio is `< 1` but it's not possible
to slide below 1. So make softmin=hardmin (0.01) to give more control
in user interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/116625
2023-12-29 13:09:35 +01:00
Alexander Gavrilov
34b04b625c Anim: fix bone collection custom property copying on armature join
The armature join operation should preserve custom properties,
as described in the comment in the code. Previously this was
achieved by reusing the collection instances from the armature
being joined, but it was changed to create a new instance. However,
property copying was not implemented, which breaks Rigify.

This fix adds property copying behavior back.

Pull Request: https://projects.blender.org/blender/blender/pulls/116626
2023-12-29 12:30:01 +01:00
Clément Foucault
b7a7c2ac00 EEVEE-Next: Add lightweight deferred indirect lighting
This adds option to bypass the raytracing pipeline
entirely and use a cheaper evaluation option.

This reuse the same evaluation as the Blended materials.

This exhibits some artifacts on Apple hardware due to
synchronization issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/116622
2023-12-29 08:34:19 +01:00
Hans Goudey
bd51bb7623 Sculpt: Avoid expensive mask access in remaining cases
In the last couple places, avoid retrieving the mask attribute per
vertex. Use existing attribute data pointers instead. This also avoids
function calls and branches for every vertex, since there is no PBVH
type switch at the lowest level of the loop anymore.
2023-12-28 16:49:31 -05:00
Hans Goudey
27582ddb93 Fix #116532: Cloth filter performance issue from mask attribute access
The cloth filter accesses the vertex mask for every length constraint.
Previously that used a cached pointer, but that was removed, and then
the access was changed to use the attribute API, which is slower since
it isn't designed to be accessed for every element. The solution is
to just let the PBVH type abstraction "leak" when accessing mask data.
2023-12-28 16:49:31 -05:00
Hans Goudey
70ae6f5d41 Cleanup: Sculpt: Add utility to duplicate mask data
Avoid the `PBVHVertRef` abstraction which is unnecesarily costly for
such a simple thing as copying data. Instead we can use abstractions
specific to each PBVH type (currently only `VArray` for meshes).
2023-12-28 16:49:31 -05:00
Hans Goudey
a52887abb0 Cleanup: Improve sculpt variable name 2023-12-28 16:49:31 -05:00
Hans Goudey
ac15db443f Cleanup: Sculpt: Split mask and position smooth brushes
Previously they shared the same implementation with a check per vertex
for whether to smooth the mask or the positions. Though it adds a bit
of duplication for now, everything else becomes simpler if the brush
implementations are split.
2023-12-28 16:49:31 -05:00
Hans Goudey
97d0b52779 Cleanup: Move sculpt cloth simulation struct to sculpt header
This didn't need to be publicly available. Also rename the structs
and enums to avoid redundancy with the C++ namespace.
2023-12-28 16:49:31 -05:00
Hans Goudey
9daa6d8115 Cleanup: Remove unnecessary namespace specification 2023-12-28 16:49:31 -05:00
Clément Foucault
d206907d76 EEVEE-Next: Add debug scopes
Allows selectively capturing section of the
render process. More scopes can be added later.
2023-12-29 10:44:13 +13:00
Michael Kowalski
ea89e11e01 USD: import scenegraph instances.
Added support for importing USD instanceable primitives into Blender
as collection instances.

Added a new USDInstanceReader class for importing USD
instances as Blender objects that instance collections containing
prototype data.

Extended the USDStageReader to read USD prototype prims into
collections that are instanced on the objects created by the instance
readers.

Removed the "Import Instance Proxies" import option.

Importing instances is enabled with a new "Scene Instancing" import
option, which is true by default.  If this option is off, instances will be
imported as copies (which is the functionality previously enabled by
the "Import Instance Proxies" option).

Removed calls to UsdSkelBindingAPI::Apply() in the skeleton and
blend shape import code, as these calls were unnecessary and were
generating errors when importing instance prototypes with UsdSkel
data.

Nested instancing and animated prototypes are supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/115076
2023-12-28 19:08:23 +01:00
Sybren A. Stüvel
d1923eeadc Anim: remove debug print
Remove accidentally-committed debug print.

No actual functional changes.
2023-12-28 18:49:23 +01:00
Sybren A. Stüvel
129fb2eab8 Anim: make bone collections hierarchical
Make it possible to nest bone collections. The data structure on the
armature is still a flat array. It is organised as follows:

- Sibling collections (i.e. ones with the same parent) are stored
  sequentially in the array.
- Each bone collection keep track of the number of children, and the
  index of the first child.
- Root collections (i.e. ones without parent) are stored as the first
  elements in the array.
- The number of root collections is stored on the Armature.

This commit also contains the following:

- Replaced the flat UIList of bone collections with a tree view.
- Updated the M/Shift+M operators (move/assign to collection) to work
  with hierarchical bone collections.
- Updated RNA interface to expose only root collections at
  `armature.collections`. All collections are available on
  `armature.collections.all`, and children at `bonecollection.children`.
- Library override support. Only new roots + their subtrees can be added
  via overrides.

See https://projects.blender.org/blender/blender/issues/115934

Co-authored with @nathanvegdahl and @nrupsis.

Pull Request: https://projects.blender.org/blender/blender/pulls/115945
2023-12-28 18:14:55 +01:00
Sybren A. Stüvel
423ddac25f Cleanup: Anim, clarify comment in rna_def_armature
Instead of `Collections`, describe a section as `Collection Properties`.
Otherwise it's ambiguous whether it's about that or specifically bone
collections.

No functional changes.
2023-12-28 15:58:04 +01:00
Sybren A. Stüvel
a582755321 Anim: Remove OPTYPE_REGISTER flag from some bone collection operators
Remove the `OPTYPE_REGISTER` flag, to ensure the operators do not pop up
their redo panel. The flag is removed where the operator properties are
set by Python code, instead of chosen by the user. For example, it doesn't
make much sense to change which bone collection is used by the operator by
typing the name of another bone collection.

This could be revisited when Blender supports "nested enum" properties,
to make it possible to choose an item in an entire hierarchy.
2023-12-28 15:57:43 +01:00
Sybren A. Stüvel
c019ad2cfe Refactor: rename bonecoll_find_index and move to namespace
Rename `bonecoll_find_index` to `armature_bonecoll_find_index` (because
it takes a `bArmature*` parameter), and move it from a static function into
the `blender::animrig` namespace. It will be used externally in upcoming
commits.

No functional changes.
2023-12-28 15:57:41 +01:00
Sybren A. Stüvel
00efe024fd Cleanup: Anim, document ANIM_armature_bonecoll_move_to_index more
Just some added documentation for `ANIM_armature_bonecoll_move_to_index()`.

No functional changes.
2023-12-28 14:39:54 +01:00
Sybren A. Stüvel
33576de0f6 Cleanup: Anim, reformatting
Just some code reformatting.

No functional changes.
2023-12-28 14:38:51 +01:00
Sybren A. Stüvel
1ff3b546f5 Cleanup: Anim, document bonecoll_ensure_name_unique
Document an assumption of the `bonecoll_ensure_name_unique()` function.

No functional changes.
2023-12-28 14:37:31 +01:00
Sybren A. Stüvel
6aa1a869c6 Refactor: Anim, move refresh of active bone collection to own function
Move some of the functionality of `ANIM_armature_runtime_refresh()` into
a function of its own (`ANIM_armature_bonecoll_active_runtime_refresh()`).
It will be called from another place as well in upcoming commits.

No functional changes.
2023-12-28 14:36:05 +01:00
Clément Foucault
553b1b6f1f Cleanup: EEVEE-Next: Change bind_resource syntax
This is just for making it clearer we bind to what
pass we are binding.

Pull Request: https://projects.blender.org/blender/blender/pulls/116597
2023-12-28 10:19:20 +01:00
Omar Emara
dc082f432a Fix #116522: Compositor incorrectly extrapolates values
The GPU compositor incorrectly extrapolates values of RGBA curves node.
That's because the code introduces a half-pixel offset to the color
values since they will be used to sample the curve maps. Those same
values are then used for extrapolation, which shouldn't take the
half-pixel value into account.

This patch fixes that by computing sampler coordinate in a separate
step.

Pull Request: https://projects.blender.org/blender/blender/pulls/116586
2023-12-28 09:25:11 +01:00
Jason Fielder
335d3a1b75 GPU: Add Shader specialization constant API
Adds API to allow usage of specialization constants in shaders.
Specialization constants are dynamic runtime constants which can
be compiled into a shader pipeline state object (PSO) to improve
runtime performance by reducing shader complexity through
shader compiler constant-folding.

This API allows specialization constant values to be specified
along with a default value if no constant value has been declared.
Each GPU backend is then responsible for caching PSO permutations
against the current specialization configuration.

This patch adds support for specialization constants in the
Metal backend and provides a generalised high-level solution
which can be adopted by other graphics APIs supporting
this feature.

Authored by Apple: Michael Parkin-White
Authored by Blender: Clément Foucault (files in gpu/test folder)

Pull Request: https://projects.blender.org/blender/blender/pulls/115193
2023-12-28 05:34:38 +01:00
Jesse Yurkovich
eb99895c97 Fix #116546: Disable openexr core
The new 2.5.x version of OIIO came with the OpenEXR Core library enabled
by default. Unfortunately it's not quite ready to be used so disable it
for now.

The current issue will prevent DWA-A/B from loading correctly. There may
also be a potential ZIPS compression related quirk that upstream is
still working through as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/116591
2023-12-28 00:48:25 +01:00
Hans Goudey
7d44065f73 Cleanup: Revert replacement of GSQueue with std::queue
There are some tragic design flaws with the Microsoft STL
implementation of `std::dequeue`. Unless we implement our
own similar data structure or use an implementation from
another library, the change isn't worth it.

This reverts commit b26cd6a4b9.
This reverts commit cc11ba33d9.
This reverts commit c929d75054.
This reverts commit bd3d5a750d.
2023-12-27 12:34:49 -05:00
Hans Goudey
06eda2a484 Cleanup: Remove most indirect includes of BKE_customdata.hh
Some common headers were including this. Separating the includes
will ideally lead to better conceptual separation between CustomData
and the attribute API too. Mostly the change is adding the file to
places where it was included indirectly before. But some code is
shuffled around to hopefully better places as well.
2023-12-26 23:59:44 -05:00
Hans Goudey
dcbc5a3641 Cleanup: Correct and improve comments in DNA_customdata_types.h 2023-12-26 23:26:32 -05:00
Hans Goudey
d54b24c55a Cleanup: Remove unnecessary/indirect includes in sculpt headers
The main goal is removing bmesh.hh from BKE_paint.hh, since that
includes it in many more files than necessary. Also remove more
includes from sculpt_intern.hh.
2023-12-26 23:26:32 -05:00
Hans Goudey
a683d1b0c6 Cleanup: Use BitVector instead of BLI_bitmap in sculpt code 2023-12-26 23:26:32 -05:00
Hans Goudey
b26cd6a4b9 Cleanup: Remove unused GSQueue container
GSQueue dates back over 21 years, past the initial git commit. Nowadays
we generally prefer to use data structures from the C++ standard library
or our own C++ data structures. Previous commits replaced this container
with `std::queue` in a few areas. Now it is unused and can be removed.
2023-12-26 23:26:32 -05:00
Hans Goudey
cc11ba33d9 Cleanup: Use std::queue instead of GSQueue for thread queue
Similar to previous commits.
2023-12-26 23:26:32 -05:00
Hans Goudey
c929d75054 Cleanup: Use std::queue instead of GSQueue in depsgraph scheduling
Similar to previous commits.
2023-12-26 23:26:32 -05:00
Hans Goudey
bd3d5a750d Cleanup: Use std::queue instead of GSQueue in multires_unsubdivide 2023-12-26 23:26:32 -05:00
Hans Goudey
dca81dc3df Cleanup: Use std::queue instead of GSQueue in sculpt code
This improves type safety, simplifies memory management,
and is a step towards removing the GSQueue container.
2023-12-26 23:26:32 -05:00
Germano Cavalcante
2824e45678 Fix #115510: Poly Build does not update snapped geometry
Commit 91b27ab637 reveals the error.

The Poly Build code was using the wrong mesh to access the evaluated
coordinates.

It was accessing the original mesh, which wasn't affected by modifiers
or editing.

The most ideal meshes would be either the cage or even the deform, as
these better correspond to the geometry seen by the user.
2023-12-26 10:48:49 -03:00
Habib Gahbiche
57df35c8f9 Fullframe compositor: unify scaling behavior with realtime compositor
This patch unifies the behavior of the scale node by removing the arbitrary limit of scaling images. The change applies to scale and transform nodes.

Note: with this change, Blender can crash for large resizing factors (around 10 000 x 10 000 relative factors). We think it's very unlikely users will run into this issue, so we agreed errors coming from failed memory allocation won't be handled, as is the case for GPU compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/114764
2023-12-26 12:58:46 +01:00
Omar Emara
92a0dfed94 Fix: Bokeh images missing write usage flag
Bokeh images are written from shaders without a write usage flag, which
causes assertions on Metal.
2023-12-26 12:59:35 +02:00
Aras Pranckevicius
140f5f619d Fix #116520: OBJ exporter does not add leading zeros in frame filenames
When exporting animation (one .obj file per animation frame), the old
Python OBJ exporter used to emit frame number with leading zeros, e.g.
"000012" which made sorting files by frame easier. The new C++ OBJ
exporter does not do that.

Fix that by reintroducing leading zeros. However, use 4 digits
("0012") since that matches 4 digits used in many other places, and
also it's very unlikely that someone would export more than several
thousand frames into OBJ. If that happens, it all works correctly
anyway, just without leading zeroes.

Fixes #116520
2023-12-25 21:48:07 +02:00
Casey Bianco-Davis
72a74ae8cc Fix: #116349: Connected Only not working for proportional editing
The problem was created in 78d9267a56

The problem was that `return` would skip the rest of the segment.

Pull Request: https://projects.blender.org/blender/blender/pulls/116523
2023-12-25 11:38:55 +01:00
Jason Fielder
6692390501 EEVEE: Metal: Enable attachmentless FB support for VSM update FB
Utilise attachmentless framebuffer for atomic shadow update
Path.

Authored by Apple: Michael Parkin-White.

Pull Request: https://projects.blender.org/blender/blender/pulls/116396
2023-12-24 12:19:18 +01:00
Clément Foucault
258ba00a03 Fix: EEVEE-Next: Wrong function declaration order 2023-12-25 00:06:10 +13:00