Commit Graph

28690 Commits

Author SHA1 Message Date
Sean Kim
29de34fdab Fix: Potential read of uninitialized memory for Vertex#is_infinite_sharp
Pull Request: https://projects.blender.org/blender/blender/pulls/140510
2025-06-17 06:15:30 +02:00
Sean Kim
03f3f42984 Cleanup: Remove unused and extraneous size variables
Pull Request: https://projects.blender.org/blender/blender/pulls/140507
2025-06-17 04:28:42 +02:00
Sean Kim
a6d3fa40ca Refactor: Use container types instead of pointers in multires_reshape_smooth.cc
This commit switches all of the manually allocated and freed arrays of
data in `multires_reshape_smooth` for various core container types,
depending on the specific usecase. As a direct result, many of the
parameters which were previously tagged as `const` are no longer.

Additionally, this allows for removing some manually tracked `size`
values.

Pull Request: https://projects.blender.org/blender/blender/pulls/140446
2025-06-16 23:43:00 +02:00
Sean Kim
73fd422701 Cleanup: Use C++ math types for multires_inline.hh
* Use `float3x3` and `float3` for the resulting tangent matrix and
  constituent derivatives, respectively.

Pull Request: https://projects.blender.org/blender/blender/pulls/140442
2025-06-16 23:42:05 +02:00
Mattias Fredriksson
407dcb39d4 Tests: EXPECT_EQ_SPAN utility macro
Replaces pointer based EXPECT_EQ_ARRAY with EXPECT_EQ_SPAN in most cases
as they already used spans (or span compatible datastructures).
Currently EXPECT_EQ_ARRAY only takes in one size variable and doesn't
compare the  number of elements between arguments (requiring an
additional line to do so).

This should make the code cleaner and safer. Goal is also to promote
the use Spans in new test code.

Pull Request: https://projects.blender.org/blender/blender/pulls/140340
2025-06-16 20:31:00 +02:00
Bastien Montagne
9a41dc73f9 Merge branch 'blender-v4.5-release' 2025-06-16 18:49:45 +02:00
Bastien Montagne
2e5b4a120a Fix #140083: Nodes: Never attempt to read default value from custom socket.
Pull Request: https://projects.blender.org/blender/blender/pulls/140459
2025-06-16 18:48:19 +02:00
Pablo Vazquez
2ea3cd2188 UI: Theme: Make nodes use the exact theme color
Make node headers (or body when collapsed) use the exact theme color
set for that node type, instead of a hardcoded blend between it and the
node backdrop.

This can result in unreadable combinations, but allows more
flexibility and it is consistent with the rest of Blender.

Both dark and light theme defaults have been updated.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/140481
2025-06-16 18:34:29 +02:00
Nathan Vegdahl
9b1f4dc483 Merge branch 'blender-v4.5-release' 2025-06-16 17:33:09 +02:00
Nathan Vegdahl
33b712f909 Core: Always use current open file for blend_name variable
Previously `blend_name` was using the same path to get its file name
as `//` used. However, the choice of path for `//` seems to be
bespokely chosen at each call site.  There may be a logic to it, but
if so it's not immediately clear what it is.

This PR changes `blend_name` to instead always use the currently open
("global") file path, making it well-defined and predictable for
users.

This also prepares better for PR #139438 for 5.0, which adds
`blend_name_lib`, which always uses the blend file that the ID owning
the path is linked from. Over-all this should be much more predictable
and controllable for users.

Pull Request: https://projects.blender.org/blender/blender/pulls/140474
2025-06-16 17:32:11 +02:00
Hans Goudey
c48423256d Draw: Remove mode transfer overhead when inactive
Currently the mode transfer overlay has to check whether it should
draw for every single object. For scenes with many instances even
that small amount of work per object can be significant. I observed
the overlay taking 1.8% of the samples in a profile.

This commit removes the mode transfer timer and stores it in a
global map instead. Besides the benefit of removing 8 bytes per
object, the main improvement is that it's now trivial to check
whether the overlay can be completely disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/140374
2025-06-16 17:02:25 +02:00
Omar Emara
efc2fd16a9 Compositor: Remove Map Range node
This patch removes the Map Range node that was deprecated in 4.5 and was
planned for removal in 5.0. The common Shader Map Range node should be
used instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/140476
2025-06-16 17:00:43 +02:00
Omar Emara
961fdb9a86 Compositor: Remove Mix Color node
This patch removes the Mix Color node that was deprecated in 4.5 and was
planned for removal in 5.0. The common Shader Mix Color node should be
used instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/140468
2025-06-16 15:59:11 +02:00
Hans Goudey
c16ee2c939 Refactor: Use C++ bounds corners function
Remove the last uses of `BKE_boundbox_init_from_minmax` in
favor of the newer `bounds::corners`. Besides clearer naming
and better ergonomics, it's also inline-able which seems to be a
good thing for such a simple function.

In order to get the same behavior as before I changed the
C++ bounds function to give the same vertex order as the
older function.

Pull Request: https://projects.blender.org/blender/blender/pulls/140401
2025-06-16 15:49:14 +02:00
Hans Goudey
84212bae4b Attributes: Remove AttributeStorage legacy compatibility option
Remove the `use_attribute_storage_write` experimental option and always
write in the new format, which is supported by 4.5. The new format is
only used at runtime by point clouds currently but there is no reason
for it to be an option at this point.

Pull Request: https://projects.blender.org/blender/blender/pulls/140284
2025-06-16 15:48:23 +02:00
Omar Emara
0bac721763 Compositor: Remove Color Ramp node
This patch removes the Color Ramp node that was deprecated in 4.5 and
was planned for removal in 5.0. The common Shader Color Ramp node should
be used instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/140462
2025-06-16 14:56:22 +02:00
Omar Emara
27b83c5fdc Compositor: Remove Value node
This patch removes the Value node that was deprecated in 4.5 and was
planned for removal in 5.0. The common Shader Value node should be used
instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/140460
2025-06-16 13:47:34 +02:00
Clément Foucault
decd88f67e Python: Remove deprecated BGL API
The API was in a deprecation state for many years now.
This API was not compatible with Metal nor Vulkan.

This also remove `Image.bindcode`.

Pull Request: https://projects.blender.org/blender/blender/pulls/140370
2025-06-16 12:50:50 +02:00
Omar Emara
35d21bd9d7 Compositor: Remove forward compatibility code
This patch removes the forward compatibility code for the compositor
that was introduced in 4.x and planned for removal in 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/140458
2025-06-16 12:38:45 +02:00
Brecht Van Lommel
b920f6f1a7 Shaders: Remove point density texture node
This is replaced by geometry nodes, where volumes can now be generated from
point clouds and meshes with more control, and more efficient rendering as a
sparse volume.

No backwareds compatibility is provided, as this would be complicated, and
probably this feature was not used much in the past few years.

This node was supported in Cycles only, not by EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/140292
2025-06-16 12:06:02 +02:00
Pratik Borhade
a93ab6446d Merge branch 'blender-v4.5-release' 2025-06-16 09:57:57 +05:30
Sean Kim
005ce385d4 Cleanup: Add missing explicit dependency on header
All of the modified files were  pulling in `BLI_math_vector.h` via
`BLI_multires.hh` and subsequently `multires_inline.hh`

Pull Request: https://projects.blender.org/blender/blender/pulls/140441
2025-06-16 01:00:29 +02:00
Sean Kim
716653d22b Cleanup: Use blender::Array instead of raw pointer for PolyCornerIndex
Changes `MultiresDisplacementData` to use a `blender::Array` instead of
a manually allocated pointer to allow for using `Span`s and avoid
further manual memory management.

Note that `MultiresDisplacementData` is already handled via C++ style
`new` & `delete` and does not need to be converted as a prerequisite.

Pull Request: https://projects.blender.org/blender/blender/pulls/140328
2025-06-16 00:56:12 +02:00
Sean Kim
23cc842319 Cleanup: C++ changes for subdiv_displacement_multires.cc
* Uses references where possible
* Adds const where appropriate

This commit only modifies the internal methods, and does not touch any
of the function signatures or areas that interface with other parts of
the codebase.

Pull Request: https://projects.blender.org/blender/blender/pulls/140326
2025-06-15 23:09:18 +02:00
YimingWu
6756982f07 Fix #139873: Grease Pencil: Auto normalization on assign/remove operator
Auto normalization used to not work on assign/remove vertex group
operator, this was due to `BKE_object_defgroup_validmap_get` and
`vgroup_parray_alloc` did not handle grease pencil type objects. Now
added grease pencil cases in them and auto normalization works as
expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/139912
2025-06-15 12:50:13 +02:00
Campbell Barton
bb9d491ca5 Merge branch 'blender-v4.5-release' 2025-06-14 16:02:07 +10:00
Campbell Barton
c482c52346 Cleanup: sort CMake file lists 2025-06-14 15:57:33 +10:00
Sean Kim
5c4748f8fc Cleanup: Use C++ math types for BKE_subdiv_eval.hh and related functions
The remaining function, `eval_vertex_data` is left as a raw array for
now, as the format is not cleanly defined, and is either 3 floats or 6
floats, depending on different settings enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/140315
2025-06-14 00:13:22 +02:00
Sean Kim
3ef4a106b8 Cleanup: Convert parameter comment into docstring
Pull Request: https://projects.blender.org/blender/blender/pulls/140318
2025-06-13 23:41:04 +02:00
Sean Kim
9bc98f304a Cleanup: Remove unnecessary const for function parameters
Pull Request: https://projects.blender.org/blender/blender/pulls/140317
2025-06-13 23:30:46 +02:00
Sean Kim
6e32b7a115 Cleanup: Convert eAverageWith to enum class
Pull Request: https://projects.blender.org/blender/blender/pulls/140327
2025-06-13 23:29:29 +02:00
Miguel Pozo
f4e6ad4d24 Core: Use VectorList for duplilists
Replace Listbase with a VectorList for duplist generation.

Performing one heap allocation for each dupli becomes very costly on
scenes with many instances.
Using a VectorList can make playback up to 15% faster.

Most scenes will have lower performance improvements,
but none of the ones I tested were slower.

VectorLists also have the advantage of being able to query the size of
the duplilist.

Pull Request: https://projects.blender.org/blender/blender/pulls/138947
2025-06-13 16:28:54 +02:00
Clément Foucault
af291eecce Cleanup: ViewLayer: Move defaults to DNA defaults 2025-06-13 16:00:53 +02:00
Mattias Fredriksson
9e2e90e8ce Cleanup: Inline NURBS methods for computing length of knots/points vector
Inlines knots_num() and adds an inlined utility function for computing
the total number of points in a nurbs curve. This should avoid potential
code duplication and allows behavior to be searched for.

Named function 'control_points_num()' to differentiate from the
'points_num' variable (referencing the number of unique points).

Pull Request: https://projects.blender.org/blender/blender/pulls/140248
2025-06-13 15:59:13 +02:00
Clément Foucault
a353fb3527 GPU: Remove use_select_pick_depth option
This option does nothing since 4.4. This commit
just remove it from the API, and clear the bit inside the DNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/140338
2025-06-13 15:38:15 +02:00
Clément Foucault
1c29a2e2e5 EEVEE: Rename and move old gtao properties
- Move `gtao_distance` to view layer and rename to
  `ambient_occlusion_distance` (API change).
- Remove `gtao_quality` from the RNA (API change).
- Remove `use_gtao` (unused) from the RNA (API change).
- Rename `gtao_focus` to `fast_gi_bias` in the DNA (no API
  change).
- Rename `gtao_resolution` to `fast_gi_resolution` in the
  DNA (no API change).

Pull Request: https://projects.blender.org/blender/blender/pulls/140298
2025-06-13 15:36:17 +02:00
Clément Foucault
4fe75da973 EEVEE: Remove all remaining reference of EEVEE next
This changes the engine identifier back to `BLENDER_EEVEE`.

We keep the `BLENDER_EEVEE_NEXT` identifier around for
versioning reasons (have to detect when it is the active
engine of a older file).

This also rename a bunch of pannels that were using `next`
in their name.

This is a breaking change for Addons compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/140282
2025-06-13 12:36:14 +02:00
Omar Emara
cf9c419fba Merge branch 'blender-v4.5-release' 2025-06-13 12:17:33 +03:00
Omar Emara
b62ef2cdd6 Compositor: Add forward compatibility for removed storage
This patch removes node init functions that currently exist only for
forward compatibility and moves the logic to the forward compatibility
section of node writing. This is to avoid allocating unused data
throughout the 5.x series.

Pull Request: https://projects.blender.org/blender/blender/pulls/140273
2025-06-13 11:15:51 +02:00
Bastien Montagne
a91dbf1d41 Cleanup: Warnings in non-debug builds. 2025-06-13 09:49:40 +02:00
Campbell Barton
63600f806b Cleanup: spelling in comments (make check_spelling_*) 2025-06-13 11:23:28 +10:00
Sean Kim
0b3e4a221c Cleanup: Convert SubdivCCGAdjacencyType to enum class
Pull Request: https://projects.blender.org/blender/blender/pulls/140255
2025-06-12 20:26:50 +02:00
Pablo Vazquez
7818082d02 UI: Theme: Add global style for panel colors
Move panel header, panel background, and sub-panel background color
settings to be global, under `User Interface`, like other widgets.

Remove per-editor panel styling. This way users can edit the panel
colors once, and affect all panels.

See pull request for screenshots and details.

Pull Request: https://projects.blender.org/blender/blender/pulls/140295
2025-06-12 20:05:34 +02:00
Hans Goudey
913918a16e Merge branch 'blender-v4.5-release' 2025-06-12 12:25:21 -04:00
Hans Goudey
9b80f8dc36 Fix #140130: Crash with shared edit mode mesh with subdivision modifier
This assert added by 321ec72c74 notes that changing the mesh
wrapper type from subdivision to normal mesh data just discards the
potentially-subdivided geometry and doesn't make sense, and possibly
breaks other assumptions.

This wrapper type change was done years ago by 0f89bcdbeb to
fix issues with shared object data during evaluation. It noted that
the mesh drawing data extraction didn't handle BMesh wrappers correctly
when the object isn't in edit mode, but that doesn't seem to be the
case after two trivial changes. The other bugs mentioned by that commit
are still solved after this change.

Pull Request: https://projects.blender.org/blender/blender/pulls/140290
2025-06-12 18:24:52 +02:00
Hans Goudey
33a8b99efc Geometry Nodes: Preserve shape keys in node tools
Currently every node tool operation removes all shape keys. This PR
temporarily convert shape keys to attributes for the node group
execution, instead of removing them afterwards.

Fixes #113662.

Pull Request: https://projects.blender.org/blender/blender/pulls/139732
2025-06-12 18:12:17 +02:00
Julian Eisel
3f9c943243 Refactor: Assets: Avoid hacky asset handle context query
The `AssetRepresentation` should now be available directly in context
where previously the `AssetHandle` type was required.

By adding an `"asset"` context member to the file browser, this should
avoid any behavior change. (Previously we would get the asset from
context by constructing a asset handle from the "active_file" context
member. So make sure "asset" is available wherever "active_file" is.)

This is another important step towards removing `AssetHandle`, see
blender/blender#108806.
2025-06-12 17:01:01 +02:00
Julian Eisel
85878cf541 Assets: Remove asset handle RNA type
The `AssetHandle` RNA type was added to enable the asset view template,
which was removed in ae9ca35e3b. The type itself was hacky and always
considered a temporary design, as suggested in the type's RNA
description. It has by now been superseded by the `AssetRepresentation`
type.

This is another important step towards removing `AssetHandle`, see
blender/blender#108806.
2025-06-12 16:48:37 +02:00
Laurynas Duburas
3c407ebeaa Curves: Enhance tesselation of NURBS with corners
Current NURBS evaluation handles corners or sharp angles poorly. Sharp
edges appear when a knot vector value is repeated `order - 1` times.
Users can make sharp corners by creating NURBS curve with `Bezier` knot
mode or by setting `order` to 2 for legacy curves. The problem occurs
because current algorithm takes all the curve's definition interval,
divides it into equal parts and evaluates at those points, but corners
are exactly on repeated knot's. To hit those, the resolution has to be
increased higher than required for the rest of the curve.

The new algorithm divides non zero length intervals between two adjacent
knots into equal parts. This way corners are hit with a resolution of 1.
This does change the evaluated points of NURBS curves, which is why some
test results have to be updated in this commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/138565
2025-06-12 16:22:21 +02:00
Hans Goudey
037121c261 Mesh: Use names to store active/default UV status
Required for the transition to `AttributeStorage`, because this
information was previously stored in `CustomDataLayer` flags.
This is already the way we store the active/default color attribute status.
Migrating runtime usage to use the names isn't done here, just like
we still use `CustomData` everywhere at runtime for `Mesh`.

Pull Request: https://projects.blender.org/blender/blender/pulls/140137
2025-06-12 14:54:32 +02:00