Commit Graph

134918 Commits

Author SHA1 Message Date
Jaume Bellet acfa7b7a93 deleting patches file 2024-04-04 20:18:23 +02:00
Jaume Bellet 16fcefc3c6 BKE_scene.h has been renamed to .hh 2024-04-04 19:23:16 +02:00
Jaume Bellet 9dc1ec1a2b Merge branch 'bf-blender' into mb-0018-ucs
Conflicts:
	source/blender/editors/include/ED_view3d.hh
	source/blender/editors/object/object_add.cc

source/blender/draw/intern/draw_shader_shared.h renamed to .hh
2024-04-04 19:00:37 +02:00
Jaume Bellet 023ef4deb9 Merge branch 'main' of https://projects.blender.org/blender/blender into bf-blender 2024-04-04 18:38:09 +02:00
Nate Rupsis 298c9276e9 Anim: Update NLA "make single user" popup dialog
Update the `NLA_OT_make_single_user` dialogue and confirmation modal to make explicitly clear what's happening for the selected strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/120082
2024-04-04 18:34:08 +02:00
Hans Goudey 7ba8fc1768 Fix: Duplicate auto smooth modifier added by versioning in one case
When an object uses linked mesh data and the object and the modifier
node group are made local after versioning runs for the first time,
a new modifier is added every time the file is opened. An obvious
fix is to check whether there is already a modifier with the versioning
node group. In that case we can skip the object.

This doesn't fully fix the scenario from #120030; it requires that
the node group is made local so it doesn't leave a reference to
a non-existent library data-block.
2024-04-04 11:57:27 -04:00
YimingWu 11556bb994 Fix #120152: Clear mesh runtime after validation
The cache for triangles and other runtime caches could
be out of date after `mesh.validate()` is called.

Pull Request: https://projects.blender.org/blender/blender/pulls/120159
2024-04-04 17:21:21 +02:00
Sebastian Parborg a9fff1f22f Fix: Missing include in BLI_implicit_sharing.hh 2024-04-04 17:13:31 +02:00
Germano Cavalcante 1180a25c23 Fix #120245: Grid snap not working when constraining axis before moving
`sctx->grid.size` was only updated while the constraint was not
enabled.

This was causing division by zero.
2024-04-04 11:42:27 -03:00
Christoph Lendenfeld ed2408400d Fix #117927: Limit rotation constraint flipping
The issue from the bug report mentions that the `Limit Rotation` constraint snaps
back to 0 when reaching 180 degrees with a min and max of 0 / 180.

The root cause of this goes a bit deeper though. Because the following also snaps back to 0.
* min max of 0 / 360
* angle of 185

The reason for this is that the clamping logic in the constraint was very simple.
It just took the matrix, decomposed it to euler and clamped the values directly.
However in that process, the euler angles are bound to a range of -180 / 180,
which means that any angle >= 180 would snap back to the min.

Pull Request: https://projects.blender.org/blender/blender/pulls/118502
2024-04-04 16:30:51 +02:00
Jason Fielder 93cc55889c EEVEE Next: Horizon scan Metal compiler tuning
Tune Metal compilation parameters for horizon scan
shaders for optimal performance. Selectively unrolling
loops and modifying compilation heuristics results in a
~25% uplift in tracing shader performance, due to
improved latency management.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119737
2024-04-04 16:24:20 +02:00
Xavier Hallade cbc7962a73 Cycles: Tune kernel sizes for oneAPI device
This brings a 1-3% performance improvement depending on the scenes, on
the Arc A770.
2024-04-04 16:04:13 +02:00
YimingWu 022e46a7e2 Fix #120213: GPv3: Tint modifier not working correctly
The GPv3 tint modifier will give incorrect result in fill tint due to
two reasons: 1) The material index being wrong; 2) The default value
for `fill_color` attribute needs to be explicitly assigned as
`ColorGeometry4f(float4(0.0f))` to ensure correct color mixing and
switching between fill/material color in the tint modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/120249
2024-04-04 15:08:10 +02:00
Omar Emara b0bebd6265 Fix #119911: Compositor saved in 4.2 does not work in 4.1
Blend files with compositor node trees saves in 4.2 do not work in older
version. This is because 4.2 removed the chunk size property of the node
tree, so it is set to zero, which is invalid in older versions. To fix
this, we add it again as a deprecated DNA member, and set it to default
value upon write.

Pull Request: https://projects.blender.org/blender/blender/pulls/120246
2024-04-04 13:14:10 +02:00
Campbell Barton 6956a609c9 Cleanup: remove underscore prefix since the argument is used 2024-04-04 20:08:00 +11:00
Omar Emara 79ca9e5afe Fix: File Output node always has inputs of type Color
The File Output node always has inputs of type Color regardless of the
type of the connected socket. This is because the socket type update
mechanism no longer works, so the default socket type persisted.

This is a regression due to 4a4916db45, where the RNA set function no
longer allows editing socket types for built-in nodes, and the File
Output node utilized the RNA set function. To fix this, we avoid the RNA
route and set the type directly.

This fix is related to #120175 and partially fixes it, though another
fix is still necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/120199
2024-04-04 09:01:20 +02:00
Omar Emara 0c91ad9008 Fix #120175: File Output node has wrong BW output
The File Output node produces wrong output when the output is set to BW.
This is because the image saving logic assumes float buffers always have
4 channels and ignores the image buffer channels member. So for single
channel images, the code weighted sum neighbouring pixels and asigned
them as a single pixel, producing bleeding at best and crashes at worst.

To fix this, we skip Color to BW conversion if the image is already BW.
And, we fix the functions that assume 4 channels for float buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/120206
2024-04-04 08:51:57 +02:00
Campbell Barton 7e9f7320e4 Cleanup: spelling in comments & comment blocks 2024-04-04 11:26:28 +11:00
Campbell Barton 82904454b4 Docs: tweak help text & correct punctuation 2024-04-04 11:18:56 +11:00
Campbell Barton 61bd22e99b Cleanup: avoid duplicating UVBorder on iteration
Iterating over UVBorder duplicated it's allocated vector each iteration.
Use a const reference instead.
2024-04-04 10:55:22 +11:00
Campbell Barton c1a0804794 Cleanup: remove redundant null check, declare arguments non-null
Checking if `ob` was null in ED_armature_pose_select_pick_bone
implied later access should check too. Remove the null check
as this isn't needed.
2024-04-04 10:55:19 +11:00
Campbell Barton eb04e1a753 Cleanup: quiet set-but-unused warnings 2024-04-04 10:55:18 +11:00
Campbell Barton cc4b5facb8 Cleanup: order index range checks before using them to index arrays
While these particular cases didn't cause out-of-bounds array access,
it's reads like it could be an oversight.
2024-04-04 10:55:16 +11:00
Campbell Barton a7439dd7ef Cleanup: clear a pointer to stack memory in what_does_obaction
Don't leave `workob->adt` set to a stack memory,
avoid the same error occurring which !118847 addressed.
2024-04-04 10:55:14 +11:00
Campbell Barton fdaaebce54 Cleanup: remove unnecessary checks & unused assignments 2024-04-04 10:55:13 +11:00
Campbell Barton 4d84a45e7e Cleanup: simplify CLG logging append function
- Remove redundant length calculation.
- Remove else-after-break.
2024-04-04 10:55:11 +11:00
Campbell Barton 52ce8d408f Cleanup: use const arguments & variables 2024-04-04 10:55:10 +11:00
Campbell Barton e086e88e37 Fix null pointer dereference in assertion
Also re-order null check before accessing the pointer's value.
2024-04-04 10:55:08 +11:00
Clément Foucault e0e6dc8550 DRW: Avoid undefined behavior when volume objects have no bounds
Pull Request: https://projects.blender.org/blender/blender/pulls/120228
2024-04-03 21:37:49 +02:00
Clément Foucault 5c0551fac9 DRW: Replace texspace coord for volume grid by matrix transform
This reduces the complexity inside the shaders and is easier
to debug on CPU.
2024-04-03 20:59:08 +02:00
Clément Foucault b4dbd04590 Cleanup: Replace dummy_grid_mat by identity matrix 2024-04-03 20:59:08 +02:00
Jacques Lucke 51f8bf53b2 Geometry Nodes: use xxhash for compute context hash
Previously, md5 was used which is significantly slower. In almost all cases
this does not have a significant performance impact in practice. However,
it's possible to build geometry nodes setups that become a few percent
faster ( by combining lots of cheap node groups). Using xxhash instead of
md5 should never be slower.

Pull Request: https://projects.blender.org/blender/blender/pulls/120225
2024-04-03 20:11:09 +02:00
Hans Goudey ef07f5d66e Cleanup: Improve naming and comments for sculpt undo node 2024-04-03 14:01:08 -04:00
Hans Goudey ebab68d4f1 Fix #120187: Over-allocation in multires sculpt undo nodes
4b427e1b57 confused `unode->maxgrid` and `unode->grids.size()`
which is the number of all grids in the mesh. A follow-up commit will
rename `maxgrid` to make that clearer.
2024-04-03 13:49:26 -04:00
Jacques Lucke a6d6787d26 Cleanup: make format 2024-04-03 18:24:54 +02:00
Falk David 85ce2a34e3 Fix #120212: GPv3: Hide masks flag wrongly set
This was caused by ab84f9eaf0.

The issue is that setting the flag in the `TreeNode`
constructor means that the root group will always
hide masks when its created. This effectively disables
masks in the entire object.

Instead, leave the default flag to be `0` (masks enabled)
and explicitly set the `HIDE_MASKS` flag when
creating a new layer/layer group.

Pull Request: https://projects.blender.org/blender/blender/pulls/120218
2024-04-03 17:59:30 +02:00
Philipp Oeser 8af4c72ddd Fix #120113: crash reading large jpeg
Caused by 406cfd214a

Above commit added a multiplication by 4 to the offset (rightfully so),
but this could overflow with very large image dimensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/120214
2024-04-03 17:38:02 +02:00
Aras Pranckevicius b3ea1e75dc Cleanup: comment why DDS DXT/S3TC needs power of two sizes, and clearer log message
It is not immediately clear why DDS compressed (DXT/S3TC) textures need
to be power of two in size (since nothing in DXT/S3TC intrinsically
requires that). It is only needed due to the "flip the texture upside
down" dance that we do for DDS at load time.

While at it, when logging DXT related messages, tell which texture
was it for, and dimensions. This changes logs like:
```
Unable to load non-power-of-two DXT image resolution, falling back to uncompressed.
Unable to load non-power-of-two DXT image resolution, falling back to uncompressed.
Unable to find a suitable DXT compression, falling back to uncompressed.
```
Into:
```
Unable to load non-power-of-two DXT image resolution, falling back to uncompressed (281splash-dxt1-mips.dds, 890x501).
Unable to load non-power-of-two DXT image resolution, falling back to uncompressed (281splash-dxt5-mips.dds, 890x501).
Unable to find a suitable DXT compression, falling back to uncompressed (281splash-rgba8-mips.dds, 890x501).
```

Pull Request: https://projects.blender.org/blender/blender/pulls/120210
2024-04-03 17:12:46 +02:00
Laurynas Duburas 4889aed8ac Curves: Bezier handle selection support
Adds ".selection_handle_left" and ".selection_handle_right" attributes to
`CurvesGeometry` and their support in curve's select all, pick, box, circle
and lasso select tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/119712
2024-04-03 16:40:36 +02:00
Prikshit singh 20e07f0102 Fix #119197: missing tool settings in sidebar for curves density brush
The settings used to be shown for the add brush, but not for the density brush.
Now they are shown for both.

Pull Request: https://projects.blender.org/blender/blender/pulls/120090
2024-04-03 16:38:47 +02:00
Falk David 8512a608a4 GPv3: Onion Skinning
Implements the GPv2 onion skinning functionality.

There are no functional changes exept for the `use_ghosts_always`
option, which has been removed. This was used to show onion
skinning in the final render.

Pull Request: https://projects.blender.org/blender/blender/pulls/119792
2024-04-03 15:34:40 +02:00
Sergey Sharybin 1e2e20fe3c Fix #120200: Sculpting is slow with modifier with driver
A regression caused by 7a2d04a5c4

Safest solution is to consider that shading changes will take care
of other components explicitly when/if needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/120207
2024-04-03 15:06:32 +02:00
Hans Goudey 4bdf5bf2e2 Mesh: Remove unnecessary wrapper_type_finalize logic
After some discussions and investigation over the last couple months,
it's not clear what the "wrapper type finalize" logic is necessary for.
For edit meshes and regular meshes, normals are calculated lazily when
building the draw cache.

Apart from the unnecessary complication for mesh GPU draw data
extraction, this code also causes normals to always be calculated
when turning an edit mesh wrapper into a regular mesh. However, those
normals are immediately discarded since the edit deform cache is deleted
in the next line.

Beyond the obvious simplification, the motivation for this change is to
avoid requesting write access on the evaluated mesh and cage mesh. This
works better with implicit sharing, allowing other improvements.

Pull Request: https://projects.blender.org/blender/blender/pulls/120066
2024-04-03 14:15:31 +02:00
Hans Goudey e7339bdd5f Geometry: Use implicit sharing for deformed positions
Avoid copying the positions array into the evaluated edit hints array
that's used to support editing with deformed positions when there is
a topology-changing procedural operation. In a simple test in sculpt
mode with 706k curve points, memory usage went from 78 to 70 MB.

This adds more duplication would be ideal, mainly because retrieving
the data with write access and making implicit sharing info for arbitrary
arrays aren't abstracted by implicit sharing utilities. It may be possible
to improve both of those aspects, either now or in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/120146
2024-04-03 14:14:34 +02:00
Falk David 50f5128be0 Fix: GPv3: Crash converting vertex groups
A grease pencil test file
(can be found here: https://cloud.blender.org/p/gallery/5d9c6ee20f9018baaca071c3)
was crashing when converting to GPv3.
The index of a deform weight group was out of bounds.
We will have to investgate how this can happen, but
in the conversion code it seems best to ignore and skip over
invalid indices.

Pull Request: https://projects.blender.org/blender/blender/pulls/120170
2024-04-03 11:40:10 +02:00
Sergey Sharybin 9efb8329a1 Cycles: Add regression test for light linking and mesh lights 2024-04-03 11:29:40 +02:00
Jacques Lucke e2d170f685 Libraries: integrate xxHash library for fast hashing
`xxHash` is a fast non-cryptographic hashing library. It significantly outperforms
md5 which we use in some places currently while also having great collision
resistance if not attacked explicitly.

The library is added to `extern` because that was the easiest way to do it and has
the least impact on others. I expect this library to become a required dependency
instead of an optional one. It's licence is `BSD 2-Clause` which seems to be the
first of its kind in Blender (there is `BSD 3-Clause` a couple of times).

For now, I used the library only for data deduplication when baking geometry nodes
where the same geometry is generated for each frame. The bake time in my test
goes down from >6s to <1s (note that this includes more than just the hashing time).

Pull Request: https://projects.blender.org/blender/blender/pulls/120139
2024-04-03 10:22:53 +02:00
Campbell Barton 8252208955 Cleanup: pass CoplanarClusterInfo::add_cluster arg by const reference 2024-04-03 15:04:31 +11:00
Campbell Barton 861536b24c Unbreak lite-build WITH_GMP enabled 2024-04-03 15:04:31 +11:00
alxdsptr eca8e5d4b3 Fix: Video alignment issue caused by fix for #120077
after alignment, the rgb_frame's linesize is not equal to the actual
data length, so when copying the data generated from render to the
rgb_frame, they should use different linesize, one after alignment
and one before alignment.

Pull Request: https://projects.blender.org/blender/blender/pulls/120184
2024-04-03 05:56:56 +02:00