Commit Graph

113023 Commits

Author SHA1 Message Date
Campbell Barton
9d47d5f8a3 Fix crash scrubbing in the animation player with 1 frame loaded
Regression in caused an integer division by zero.

[0]: e6933e526c
2024-09-14 12:36:14 +10:00
Campbell Barton
95d29c9464 Cleanup: remove redundant null check & unused variable 2024-09-14 12:36:12 +10:00
Campbell Barton
30bbd1583f Cleanup: replace the term "folder" with "directory" for CMake files
This was already more common an in keeping with cmake's own naming.
2024-09-14 12:35:02 +10:00
Campbell Barton
6a1bd2ff40 Cleanup: use C++ comments for disabled code 2024-09-14 12:35:00 +10:00
Harley Acheson
019d987072 UI: Increase Width of ID Search Lists
As discussed in our UI Module meeting, this PR increases the width of
ID Search lists by 40%.

Pull Request: https://projects.blender.org/blender/blender/pulls/127599
2024-09-14 03:20:09 +02:00
Harley Acheson
a5779347b6 Fix #127438: Block Drag Cursor Issues
Avoid setting default cursor while number dragging. But always reset
cursor in title area if even there is a button in that space. Decrease
the title height slightly to work with title-less popups.

Pull Request: https://projects.blender.org/blender/blender/pulls/127598
2024-09-14 00:07:42 +02:00
Hans Goudey
7b69c82494 Refactor: Sculpt: Tag all nodes positions changed together, store in array
Replace the `PBVH_UpdateBB` flag with a separate vector of booleans.
The simplest impact of this is that we can tell when there are no changed
nodes in constant time. Besides that, it also works better with the recent
IndexMask usage for selections of nodes, and allows better const
correctness too, since nodes themselves don't have to be changed
when positions are changed. This also leads into plans to change PBVH
draw data tagging to avoid having to reupload all attributes when only
one changes.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127587
2024-09-13 21:31:08 +02:00
Sean Kim
181f2f8eee Fix #127576: Crash in Sculpt mode when using Sample Color off mesh
Also fixes an unreported crash if no color attribute exists

Pull Request: https://projects.blender.org/blender/blender/pulls/127589
2024-09-13 21:17:20 +02:00
Hans Goudey
96e71dc62c Cleanup: Sculpt: Various changes to indexing in displacement smear brush
Part of #118145.
2024-09-13 15:15:11 -04:00
Guillermo Venegas
033f18b5e9 Fix #127502: Popup resizes few times after closing a layout panel
Avoid truncation errors causing unneccessary resizing by passing floats
to UI_block_translate. That function translates block and button rects
which are floats.

Pull Request: https://projects.blender.org/blender/blender/pulls/127505
2024-09-13 20:04:15 +02:00
Hans Goudey
1241e3a5e4 Fix #127556: Sculpt smooth brush missing updates
Mistake in d64f62e4fa.
2024-09-13 13:15:14 -04:00
Laurynas Duburas
d6778f42d4 Overlay-Next: Origin
Overlay-Next  object centers.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127578
2024-09-13 19:14:17 +02:00
Laurynas Duburas
d37eb7a998 Overlay-Next: Edit text
Overlay-Next version of  Edit text.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127513
2024-09-13 19:04:55 +02:00
Guillermo Venegas
b721374e9b Fix #127504: Layout panel missaligned in UI_DIR_UP popups
Layout panels are relative to `block->rect.ymax`. This PR applies the
overflow created above `block->rect.ymax` as initial offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/127507
2024-09-13 18:49:48 +02:00
Clément FOUCAULT
4e25dfb065 Overlay-Next: Mode Transfer
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127580
2024-09-13 18:39:28 +02:00
Sean Kim
bb97d651aa Cleanup: Remove unused variable
Pull Request: https://projects.blender.org/blender/blender/pulls/127584
2024-09-13 17:57:55 +02:00
Christoph Lendenfeld
cb6ed12ef1 Anim: Reuse action between related data
When inserting keys, look on related IDs for an action to reuse that.
This will make use of the slot system on the new layered action to ensure
the animation data doesn't collide.

This is done on the `id_action_ensure` function since that is the common
function to get an action off an `ID`.

IDs with more than 1 user will be skipped.

"Related ID" in this case is hardcoded with a `switch` statement for each ID type.
The system builds a list starting from the ID that should be keyed and
keeps expanding the list until an action is found or no more
non-duplicate IDs can be added. (This is using linear search for duplicate checks,
but I don't think we will deal with a lot of IDs in this case)

Pull Request: https://projects.blender.org/blender/blender/pulls/126655
2024-09-13 17:57:22 +02:00
Falk David
d911d673a4 Cleanup: Fix compiler warnings
Cleanup unused variable and remove unecessary typedef.
2024-09-13 17:54:35 +02:00
casey bianco-davis
50770bd8f5 GPv3: Add support for transform object origin.
Implements support for `transform only origins`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126446
2024-09-13 17:06:43 +02:00
Clément FOUCAULT
ffb5226944 Overlay-Next: Edit Mesh: Weight display
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127566
2024-09-13 17:01:46 +02:00
Clément FOUCAULT
1d3613e75c Overlay-Next: Particle Edit
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127518
2024-09-13 17:00:51 +02:00
Sietse Brouwer
eaad744c7f GPv3: Operators for Normalize active and Normalize all vertex groups
This PR implements the Normalize operators in Weight Paint mode for
GPv3:
- Normalize weights of the active vertex group. This operator normalizes
all the vertex weights in the active vertex group to a value between 0.0
and 1.0.
- Normalize All. This operator normalizes the weights of all vertex
groups, so that for each vertex, the sum of the weights is 1.0. Weights
of locked vertex groups are not changed. By default, the active vertex
group also stays unchanged, unless it's necessary to reach a normalized
state.

The operators are added to the 'Weight' menu in Weight Paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126302
2024-09-13 16:59:20 +02:00
casey bianco-davis
3c67ae7785 GPv3: Rename Cutter tool to Trim
This rename the `Cutter` tool's name, code and icon to `Trim`.
The legacy Grease Pencil code is unchanged.

This was discussed in the 2024-07-30 Grease Pencil Module Meeting.

Reasons for the change:
 - Match the `Trim Stroke Ends` setting on brushes.
 - Match the `stroke_trim` operator.
 - Name is more clear and more commonly used.
 - Frees the name for a future boolean cutting tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/126452
2024-09-13 16:56:51 +02:00
Hans Goudey
613e535fb8 Refactor: Sculpt: Remove SculptSession scene pointer
Part of #118145.
2024-09-13 10:26:50 -04:00
Hans Goudey
bde4efe1f5 Refactor: Sculpt: Remove SculptSession face visibility pointer
Part of #118145.
2024-09-13 10:26:50 -04:00
Hans Goudey
27e2062eac Refactor: Sculpt: Remove SculptSession mesh size variables
Part of #118145.
2024-09-13 10:26:50 -04:00
Hans Goudey
1f7d594aca Refactor: Sculpt: Remove SculptSession face sets pointer
Part of #118145.
2024-09-13 10:26:50 -04:00
Falk David
8cbdbf5634 GPv3: Vertex Paint operators
This adds the following operators:
* Set Vertex Color
* Reset Vertex Colors
* Invert
* Brightness/Contrast
* HSV
* Levels

Also populates the `Paint` menu with them in vertex paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/127572
2024-09-13 15:42:21 +02:00
Sybren A. Stüvel
7916a33be0 Anim: correctly auto-sync NLA strip length for slotted Action
When syncing the NLA strip length with the Action it uses, use the
length of the assigned action slot. Previously the entire Action was
considered when determining the length.

Pull Request: https://projects.blender.org/blender/blender/pulls/127573
2024-09-13 15:10:46 +02:00
Sybren A. Stüvel
b952782a44 Refactor: Anim, move Action queries from BKE to the animrig::Action class
Move the following BKE functions to the `animrig::Action` class. Some of
those will be extended to support slots in a future commit; for now they
still operate on all F-Curves in the Action.

| Old                             | New                                 |
|---------------------------------|-------------------------------------|
| `BKE_action_frame_range_calc()` | `Action::get_frame_range_of_keys()` |
| `BKE_action_frame_range_get()`  | `Action::get_frame_range()`         |
| `BKE_action_has_motion()`       | `Action::has_keyframes()`           |
| `BKE_action_has_single_frame()` | `Action::has_single_frame()`        |
| `BKE_action_is_cyclic()`        | `Action::is_cyclic()`               |

Implementations have been copied from the BKE functions. The frame range
functions now return `float2` instead of requiring two `float *r_…`
return parameters.

The `has_motion` function is now renamed to `has_keyframes`, as that is
what the implementation was actually testing for.

The functions now no longer are null-safe. The BKE functions handled a
null action pointer, but IMO that doesn't make sense, and in none of the
call sites I could find where this would actually be valid.

No functional changes.

Ref: #127489

Pull Request: https://projects.blender.org/blender/blender/pulls/127512
2024-09-13 15:04:47 +02:00
Campbell Barton
bcac20a670 Relocate "--quiet" to the "Debug" section in --help
This was listed under "Render Options:".
2024-09-13 23:00:17 +10:00
Campbell Barton
fe97bf29a6 Suppress render prints with G.quiet is set 2024-09-13 22:57:51 +10:00
Campbell Barton
c6afb0e270 Core: remove sdlew/WITH_SDL_DYNLOAD & disable SDL by default
Disable dynamic SDL loading as well as disable SDL for release builds.

This was only used for audio output which can already use OpenAL
if there are back-ends not natively supported by Blender.

- Remove extern/sdlew/
- Remove the WITH_SDL_DYNLOAD build option.
- Remove `bpy.app.sdl.available`.

Ref !127554
2024-09-13 22:44:35 +10:00
Campbell Barton
4743abda5e Core: expose --quiet / -q command line argument
Support suppressing "info" messages when running Blender.
Useful when Blender is used as part of an automated action
that should only show output for warnings/errors.

Ref !127562
2024-09-13 22:44:34 +10:00
Falk David
45ef0112cd Fix: GPv3: Sculpt paint operator name
The operator was improperly named "Grease Pencil Draw".
New name is "Grease Pencil Sculpt".
2024-09-13 14:20:18 +02:00
Sybren A. Stüvel
65728f16e7 Fix #127397: Duplicating layered actions makes things not animate
Duplicating an Action stashes the original one on the NLA. The NLA
evaluation code didn't properly handle the special case of an all-muted
NLA (all stashed actions are muted there) when a layered Action was
assigned directly to the animated ID.

The code is now refactored to remove this special handling from the
`animsys_calculate_nla()` function. Instead it now just returns whether it
did anything. The caller can then decide to evaluate the main Action
instead. This ensures that there is only one "evaluate the main Action"
branch in the `BKE_animsys_evaluate_animdata()` function.

Pull Request: https://projects.blender.org/blender/blender/pulls/127569
2024-09-13 14:19:22 +02:00
Nathan Vegdahl
54584ea98d Fix #127508: Breakdowner not affecting some properties
The bug was introduced in #126291, which was a refactor PR. Prior to the
PR there was a condition that could only trigger when a given pointer
was null. That pointer was turned into a reference in the refactor,
but instead of deleting the conditional code that should no longer be
reachable, the refactor simply removed the null check, allowing the code
to still trigger based on just the remaining part of the condition.

The code behind the condition bailed out before checking all fcurves for
whether they should be included in pose slide, and thus would omit some
channels from the breakdowner (and presumably other operators as well).

This commit fixes the issue by simple removing that code entirely, since
it's no longer relevant. It also renames the function and one of its
parameters to be clearer about what it actuallys does, since that was
pretty obscure before.

Pull Request: https://projects.blender.org/blender/blender/pulls/127565
2024-09-13 13:33:11 +02:00
Clément FOUCAULT
bf01ec1113 Fix: Overlay-Next: Broken Curve display in object mode
Logic was incorrect.
2024-09-13 13:14:28 +02:00
Sybren A. Stüvel
7cb77d925a Anim: add NLA evaluation of slotted Actions
Add support for slotted Actions to the NLA evaluation code.

This also affects the pose library code and the Action Constraint. These
both share some Action evaluation logic with the NLA. They now
explicitly looks at only the first Action slot. The Action Constraint will
have to be updated to have an explicit slot selector, but that's for another
commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/127425
2024-09-13 12:34:50 +02:00
Sybren A. Stüvel
7cd3f2aabb Refactor: Anim, prepare for slotted Action support to quaternion eval
Refactor to prepare for slotted action support to the evaluation of
quaternion F-Curves.

Since slotted Actions store F-Curves in an array, you cannot iterate over
them any more via the `ListBase` pointer `fcurve.next`. Quaternion
evaluation code has been refactored to work on a span of F-Curves instead
of just getting the first one.

For now, slotted Actions just evaluate their first slot only. A future
commit will add a slot handle parameter to evaluate the correct slot.
2024-09-13 12:34:48 +02:00
Sybren A. Stüvel
9405a47442 Fix: Anim, duplicating Action misses some properties
Duplicating an Action was missing the Slot flags (so they reset to
collapsed and unselected) and the F-Curve group memberships.

Pull Request: https://projects.blender.org/blender/blender/pulls/127560
2024-09-13 12:05:28 +02:00
Campbell Barton
40188f6c97 WM: suppress "Info" prints from reports when G.quiet is enabled
Suppress operator info reports from printing to the stdout
(save, remove double etc).
2024-09-13 19:30:59 +10:00
Campbell Barton
b8a6482a2e Unbreak build 2024-09-13 19:30:57 +10:00
casey bianco-davis
1df3388fae GPv3: Create weights on draw for new strokes.
Implements the legacy  `weight_data_add` button for GPv3.

Note: This PR properly accounts for the bone's transformation when applying so that the stroke does not appear to teleport after drawing, unlike the legacy system.

Pull Request: https://projects.blender.org/blender/blender/pulls/119302
2024-09-13 11:15:31 +02:00
casey bianco-davis
4fc665e4a1 GPv3: Apply Transform operator
Add support for the `Apply Object Transform` operator.

Unlike GPv2, this will update the radius properly.

Pull Request: https://projects.blender.org/blender/blender/pulls/126442
2024-09-13 11:08:37 +02:00
Pablo Vazquez
1f95b0f43f Text Editor: Enable find "Wrap Around" by default
Without it sometimes it feels that search didn't work, when it just
happened that we were near the end of the file.

It is the default in popular external editors as well.

Ref: !127528
2024-09-13 16:27:56 +10:00
Sean Kim
8dcef4838e Cleanup: Sculpt: Various changes for face sets IK chain initialization
Part of #118145

* Remove some booleans in favor of std::optional
* Group variables into a `struct` for convenience
* Organize & rename variables to reduce scope

Pull Request: https://projects.blender.org/blender/blender/pulls/127545
2024-09-13 07:19:01 +02:00
Campbell Barton
1fa666495a Docs: note why fnmatch doesn't use escaping 2024-09-13 14:15:41 +10:00
Campbell Barton
38bb6c22a0 Cleanup: quiet undeclared function warning 2024-09-13 14:15:37 +10:00
Sean Kim
2b9f95a9c6 Cleanup: Sculpt: Various changes for Pose brush FK initialization
Part of #118145

* Inline floodfill functions
* Extract average function to separate method
* Add `const` where possible
* Rename certain variables

Pull Request: https://projects.blender.org/blender/blender/pulls/127540
2024-09-13 05:47:28 +02:00