Commit Graph

134809 Commits

Author SHA1 Message Date
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
YimingWu 4f4e8381ee Fix #120164: GPv3: Update points range after trimming
In `process_stroke_end`, an end point that has a thickness of 0 will be
removed, but the `IndexRange` for points isn't updated, leading to wrong
slicing downstream.

Pull Request: https://projects.blender.org/blender/blender/pulls/120165
2024-04-02 13:50:59 +02:00
Aras Pranckevicius 19ce05971d Fix #120077: Video output artifacts due to threaded YUV conversion
ffmpeg AVFrame objects should use correct alignment between image
rows, or otherwise bad things might happen. In this particular
case, multi-threaded libswscale RGB->YUV conversion was trampling
over 4 bytes of V plane, for each thread boundary.

Pull Request: https://projects.blender.org/blender/blender/pulls/120168
2024-04-02 13:03:05 +02:00
Omar Emara fd7e74aa23 Compositor: Retain alpha in Color to Vector conversion
Retain the alpha channel in Color to Vector implicit conversion for the
Realtime Compositor. That's because speed passes are exposed as color
sockets, so connecting them to a node like Vector Blur will lose the
y component of the next vectors.

The CPU compositor handles that by faking vector sockets as color
sockets internally, while the realtime compositor does not do that.
2024-04-02 12:35:12 +02:00
Sebastian Parborg 658eba4b2e Fix #119966: File rename fails on Mac with certain filesystems
As in the Linux case, it seems like the atomic rename doesn't work on all file systems on Mac either.
We did test on Windows and it seems like there is a built in fallback, so we don't need to do this there.

Pull Request: https://projects.blender.org/blender/blender/pulls/120037
2024-04-02 12:27:36 +02:00
Campbell Barton 16a1c2e33f Fix error copying a grease pencil strokes fill opacity
The destination value was set to itself.
2024-04-02 17:44:30 +11:00
Campbell Barton cbee0f5477 cppcheck: update the checking utility to resolve issues in source/
The script to run cppcheck failed for most files in source/ because
of a syntax error in MEM_guardedalloc.h with attribute functions.

Workaround the error by including BLI_compiler_attrs.h directly.

Other changes:

- Specify c++17 / c11 standards for C++ & C.
- Resolve errors from undefined integer ranges.
- Set the check level to exhaustive so checks always run.
- Suppress noisy missingIncludeSystem warning.
- Move run-time compiler defines into a temporary include
  which resolves argument quoting errors when cppcheck is used with
  clang's parser.
2024-04-02 17:02:23 +11:00
Campbell Barton 97d93c7e33 GHOST/Wayland: pass in null when the cursor theme isn't set
While an empty string resolves to the default theme, it's not following
the API specification for wl_cursor_theme_load as it's written.

Checking on wayland internals this looks only to add an unnecessary
theme lookup on an empty string which falls back to the default.

Noticed when investigating #105895 although it seems unlikely
that this chagne would resolve the issue.
2024-04-02 15:11:05 +11:00
Campbell Barton 03d728e281 Cleanup: improve type checking in project_source_info.py
Since the type hints were added it seems mypy has been improved
making it possible to remove the workarounds.
2024-04-02 10:26:14 +11:00
Campbell Barton cf1849aedb Fix string formatting in git_log_review_commits_advanced dev tool 2024-04-02 10:17:54 +11:00
Hans Goudey 32fc3c0c1c Fix: Resolve over-allocation for mesh tangents
For some reason, the custom data type was set as `float[4][4]`
for tangents, but they are written as `float[4]`. The overallocation
might not have been a problem, since it looks like the extra memory
was never written to. But it's still confusing and potentially bad for
performance.
2024-04-01 13:38:06 -04:00
Jacques Lucke 7934ebd4e4 Fix: baking simulation only bakes a single frame
When using the bake button in a simulation zone, it currently only bakes a single frame.
Still baking only works in the Bake node.

Pull Request: https://projects.blender.org/blender/blender/pulls/120138
2024-04-01 17:59:29 +02:00
Hans Goudey 935666a622 Fix #120104: Snap ignores evaluated geometry bounds
Previously the bounds were accessed on the original object.
That used to implicitly get the evaluated geometry's bounds,
but now that is an explicit choice.
2024-04-01 11:01:19 -04:00
Hans Goudey f0d7a05fc4 Fix #120065: Mesh tangent draw extraction crash
Since the code was added, it used the active indices of the input and
output custom data layers incorrectly. 82b88f130a exposed that
by actually modifying the active indices of the ouput custom data
correctly, but it didn't update a couple other places to take that into
account.
2024-04-01 10:48:43 -04:00
Germano Cavalcante ea3f938c07 Fix #120109: Grid snap crash when locking axis before base selection
The functionality of snap with constraints relies on the position of
the transformed object.

Previously, snap to grid with constraints was restricted to the Move
operation.
Consequently, the 'Set Snap Base' mode, as well as other transformation
modes, failed to compute the moved position.
As a result, it lacked support for snap to grid with constraints and
would even crash under such circumstances.

The solution involves eliminating the reliance on the Move operator and
instead calculating the position based on mouse position.
2024-04-01 11:22:03 -03:00
Omar Emara 0b1dc351e4 Fix: eGPUBarrier enum negate operator is broken
The ENUM_OPERATORS macro for the eGPUBarrier enum uses
GPU_BARRIER_UNIFORM as its maximum value, while it should be
GPU_BARRIER_BUFFER_UPDATE instead.
2024-04-01 16:14:23 +02:00