Commit Graph

134824 Commits

Author SHA1 Message Date
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
Campbell Barton a85b1dd2fc Cleanup: avoid shadowing local variables 2024-04-03 14:41:43 +11:00
Campbell Barton b24a295af1 Cleanup: pass arguments by const reference instead of value 2024-04-03 14:40:39 +11:00
Campbell Barton b03332a055 Cleanup: use BLI_assert_msg instead of checking string literals 2024-04-03 14:27:54 +11:00
Campbell Barton c4c1aedd00 Cleanup: correct comments in scanfill.c, don't use bool for a flag
Logically PolyFill::f is a flag so use uchar instead of bool.
2024-04-03 14:07:37 +11:00
Campbell Barton cbd6266162 Cleanup: simplify init_meta logic
- Remove redundant loop on meta-elements.
- Use continue to reduce nested blocks.
- Move zero-axis matrix check into a function.
2024-04-03 14:07:04 +11:00
Hans Goudey 820865bacf Cleanup: Improve EditMeshData comments 2024-04-02 21:11:34 -04:00
Sean Kim 06f04a2c19 Refactor: Use blender::Array for SubdivCCGNeighbors
To avoid requiring callers to remember to free the allocated data.

Pull Request: https://projects.blender.org/blender/blender/pulls/120194
2024-04-03 02:37:45 +02:00
Campbell Barton d4c7e6f020 Cleanup: suppress type warnings
Also make the script executable & clarify some variable names.
2024-04-03 10:41:03 +11:00
Campbell Barton 56c78a9236 Cleanup: use boolean instead of float for motion_blur_fx_enable
Logically this is used as a boolean so use a bool type.

Ref !120156
2024-04-03 10:22:18 +11:00
Campbell Barton d5d1025e94 Cleanup: use const pointer arguments 2024-04-03 10:22:05 +11:00
Harley Acheson bc099fe808 UI: Remove Extraneous Parentheses
My #120117 introduced a build warning for extraneous parentheses, this
PR just removes those.

Pull Request: https://projects.blender.org/blender/blender/pulls/120193
2024-04-03 01:09:20 +02:00
Pratik Borhade 96ce5a1fd1 Fix #120095: Missing stats in sculpt mode
Caused by 2df06a05ae
totobj and selected objects are not counted for sculpt mode stats (can
do that but it's unnecessary). Hence the above commit falsely showed 0
objects in statistics. To fix this, skip showing object count in sculpt
mode, otherwise print 0 objects if selobj and totobj are none.

Pull Request: https://projects.blender.org/blender/blender/pulls/120106
2024-04-03 01:00:43 +02:00
Hans Goudey 5b9ed4258b Cleanup: Access edit mesh caches with span return values
Instead of accessing the data directly from the cache struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/120191
2024-04-03 00:36:29 +02:00
Hans Goudey 41ed0d4001 Cleanup: Remove unnecessary cache checks in mesh analysis VBO creation
These functions are already called in `mesh_render_data_create` which
happens before the various VBO extraction functions are called.
2024-04-02 18:03:49 -04:00
Hans Goudey e29d582137 Cleanup: Use C++ Span, float3 in legacy instancing code 2024-04-02 18:03:49 -04:00
Hans Goudey a4b4f0116c Cleanup: Use C++ Span, float3 for BMesh normals API 2024-04-02 18:03:49 -04:00
Hans Goudey 768c68f19b Fix #120179: Assert failure after sculpt trim operation
Seems to be caused by c53e220aef. I didn't think our PBVH building would
ever create a node with no triangles, but I guess I was wrong, since I
checked and the PBVH is clearly being rebuilt after the trim operation,
so it seems there isn't anything else weird going on here.

Rather than trying to figure that out, I'll just add the empty check
back here. Eventually we should completely replace the algorithm that
creates the PBVH nodes anyway.
2024-04-02 17:58:36 -04:00
Hans Goudey d001302200 Fix #117709: Crash with single point NURBS curve
The root of the issue seems to be calling `BLI_snprintf` with the
wrong number of arguments in the `MorePointsForBezierRequired`
case. The fix arguably makes things simpler anyway: just use a
separate call in each case of the switch.
2024-04-02 17:44:49 -04:00
Hans Goudey bf2b684913 Cleanup: Remove unused variable after recent cleanup 2024-04-02 17:41:27 -04:00
Sean Kim d80b8cbcdc Cleanup: Add doxygen sections to sculpt_face_set.cc
This PR adds doxygen headers to `sculpt_face_set.cc`

Pull Request: https://projects.blender.org/blender/blender/pulls/120190
2024-04-02 23:13:52 +02:00
Iliya Katueshenock 3f3df16ba2 Cleanup: Mesh calculate edges file cleanup
Trivial changes of code:
1. Const correctness.
2. Arguments order.
3. Use regular constructor instead of aggregate one.
4. Replace stateful iterators of corners by `bke::mesh` functions.
5. Offset Indices instead of manual prefix sum.
6. Slight changes of iterator names which is affected by cleanup.
7. Cpp allocator.
8. Explicit template parameter.

Pull Request: https://projects.blender.org/blender/blender/pulls/120189
2024-04-02 22:48:58 +02:00
Hans Goudey 89d38cf008 Cleanup: Use ImplicitSharingInfo type instead of C handle 2024-04-02 16:40:33 -04:00
Harley Acheson d1b6621903 UI: Complete Event Icon Coverage
This PR completes coverage of the event icons used to represent keymap
entries on the status bar. This adds 0-9, non-alpha keys, tablet, F13-
F24, NDOF buttons, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/120117
2024-04-02 21:52:57 +02:00
Harley Acheson 65bfae2258 UI: Status Bar Keymap Spacing
Adjustments to the spacing of keymap items shown in the status bar
while idle and during modal operators. Decreased space between icon
and related text makes each item have better separation.

Pull Request: https://projects.blender.org/blender/blender/pulls/120124
2024-04-02 21:25:56 +02:00
Hans Goudey 930d645b4c Fix #120154: Cage face normals overlay always draws original normals
When the cage mesh is the output of a modifier that supports deforming
BMesh directly, it will be a mesh wrapper and `MR_EXTRACT_BMESH` will
be used. Otherwise the cage mesh will be a `Mesh` and its own normals
should be drawn instead of the the original normals. Thought this seems
deceivingly simple, it works with no modifiers, BMesh-deforming modifiers
with cage enabled and disabled, and topology changing modifiers, which
should be all the possible cases here.
2024-04-02 13:42:06 -04:00
Sean Kim 6160335c4d Cleanup: Extract common functions in sculpt_trim.cc
This PR extracts a few common functions for operations
in `sculpt_trim.cc` to reduce duplication.

Pull Request: https://projects.blender.org/blender/blender/pulls/120180
2024-04-02 19:38:37 +02:00
Xavier Hallade 891d71a4d4 Cycles: Drop noinline keyword for oneAPI device
fdc2962beb indirectly introduced a change
in inlining (light_tree_pdf started getting inlined) that led to a 5-10%
drop in performance for most scenes.
Dropping the noinline keyword for oneAPI device recovers it.
It however brings another performance regression to MNEE and Raytrace
kernels, that we'll look into separately.
2024-04-02 18:29:35 +02:00
Omar Emara 5de40790d0 Compositor: Set W to 1 in Float to Vector conversion
Set the w component to 1 in Float to Vector implicit conversion for the
Realtime Compositor. That's because the Vector Output node expects a
vector for the velocity input, but the CPU compositor fakes it as a
color input, while assumes a fourth component of 1.
2024-04-02 18:10:13 +02:00
Jacques Lucke 77a34791a3 Fix #119938: performance regression when adding output attribute
Avoid calling `modify_geometry_sets` because this can potentially result in
additional data copies when the geometry references the final mesh of other objects.

For more details, see https://projects.blender.org/blender/blender/issues/119938#issuecomment-1155109.

This implements a special case to avoid the regression until e.g. #119968 is done.

Pull Request: https://projects.blender.org/blender/blender/pulls/120177
2024-04-02 17:48:03 +02:00
Falk David 03bcd7390a Formatting 2024-04-02 16:46:27 +02:00
Falk David 45a0b6cc1a Cleanup: GPv3: Use `const` in a few places 2024-04-02 16:40:00 +02:00
Christoph Lendenfeld 8a1c2b172a Fix: Escape property name when keying
The property name can contain `"` which would cause keyframing to
fail. By escaping it those properties can now be keyframed.

E.g. property names like `"test"` now properly receive keys.

Pull Request: https://projects.blender.org/blender/blender/pulls/119922
2024-04-02 16:24:59 +02:00
Jacques Lucke 7400927ada Fix #120084: custom group node remains undefined after registering node type 2024-04-02 16:07:48 +02:00
Thomas Dinges 04293e2494 Tools: Add script to report (high) priority issues per module
The python script checks on reports based on the provided severity (default High) and sorts them per module.

Thanks to Sybren for suggestions on how to improve it!

Pull Request: https://projects.blender.org/blender/blender/pulls/120022
2024-04-02 15:54:14 +02:00
Falk David ca0b02aa96 Fix: GPv3: Crash rendering cyclic strokes with single point
Creating the batch cache for rendering crashes when
there is a stroke with one point that is set to cyclic.
There was a missing check for the number of points
because we're accessing the curve lengths, which
needs at least 2 points to be populated.
2024-04-02 15:51:26 +02:00
Jacques Lucke 7ed713e772 Fix #120087: wrong node selection after duplicating node 2024-04-02 15:40:51 +02:00
Jacques Lucke 6f6ab91dbf Fix: support parallel_for_each with IndexRange without TBB 2024-04-02 15:12:37 +02:00