Commit Graph

120055 Commits

Author SHA1 Message Date
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
Campbell Barton
8b5f3c4671 Fix back-slash character filtering in the outliner & UI list
The single characters "\" could not be used for filtering
because it was treated as an escape characters.
Although "\\" could be used to match "\".

Disable escape character behavior as this mostly makes sense for
matching file-names for shell input.
2024-09-13 12:45:36 +10:00
Campbell Barton
bd606a3516 Cleanup: use switch statement mouse button checks
Warns if events button types are omitted.
Also use a define for GHOST_kButtonNum.
2024-09-13 12:32:56 +10:00
Campbell Barton
718403e2c4 Refactor: minor changes to thumbnail saving logic
- Clarify misleading logic when the buffer couldn't be allocated.
- Use a utility function to calculate the thumbnail size.
- Calculate the thumbnail size for the on-disk thumbnail
  separately (corrects minor rounding error) caused by
  scaling the smaller size up.
2024-09-13 11:22:51 +10:00
Campbell Barton
c0fa610f78 Cleanup: remove redundant string initialization 2024-09-13 11:05:53 +10:00
Campbell Barton
a47055f7c2 Cleanup: use "_str" as a string suffix instead of "_st" 2024-09-13 11:03:17 +10:00
Campbell Barton
81e2ccbf2b Cleanup: spelling in comments 2024-09-13 10:56:26 +10:00
Campbell Barton
29214b20ec Cleanup: remove unused variables 2024-09-13 10:41:30 +10:00
Sean Kim
d9c941a464 Cleanup: Sculpt: Various changes for pose brush topology chain init
Part of #118145

* Removes usage of PBVHVertRef
* Adds const where possible
* Reduces scope of variables where possible

Pull Request: https://projects.blender.org/blender/blender/pulls/127541
2024-09-13 01:08:33 +02:00
Hans Goudey
d64f62e4fa Sculpt: Update BVH node bounds in deformation loops
Updating the node bounds just after deforming the vertices in the
node is faster because the position data is still fresh in CPU caches.
Updating it later on means all the other nodes have been processed
in the meantime which will evict that position data from the caches.

This results in a 1.11x improvement in the brush benchmark timing,
from 0.495s to 0.438s on a Ryzen 7950x (best of 5 runs).

As part of the change, the update tagging has completely moved
to each brush implementation. This continues the process of
making each brush more independent.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127536
2024-09-12 23:45:52 +02:00
Hans Goudey
dd9b3e4fac Refactor: Sculpt: Remove vertex to face map from SculptSession
Just retrieve it from the mesh as necessary, it's already cached there.
Part of #118145.
2024-09-12 15:47:11 -04:00
Hans Goudey
43476712cf Refactor: Sculpt: Remove SculptSession mesh topology array references
Part of #118145.
2024-09-12 15:36:58 -04:00
Hans Goudey
e751b512ce Refactor: Sculpt: Remove SculptSession Depsgraph pointer
Part of #118145.
2024-09-12 15:32:45 -04:00
Hans Goudey
7755f7c4a2 Fix: Sculpt: Project operator crash
The PBVH type cases were swapped.
2024-09-12 15:06:41 -04:00
Hans Goudey
a19760678e Fix: Crash running sculpt brush performance benchmark
The normals were not allocated before the brush code starts, which is
necessary to store the initial normals in the undo step, among other
things. Previously normals were calculated as part of building the PBVH.
That doesn't make sense anymore because that process shouldn't change
the mesh. For now just add the recalculation in a code path called by
`BKE_sculpt_update_object_for_edit`, called at the beginning of each
stroke, and other places.
2024-09-12 14:51:34 -04:00
Hans Goudey
13f179a9c0 Cleanup: Add utility function to sum offset indices group sizes
I've done this a few times and would have benefited from a utility
function for it, apparently it's done in a few more places too. The
utilities aren't multithreaded for now, it doesn't seem important
and often multithreading happens at a different level of the call
stack anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/127517
2024-09-12 20:28:35 +02:00
Falk David
f68910092b GPv3: Parent armature with empty weights
Implements setting the armature parent and generating
vertex groups for the bones in the armature.

Note: This does not implement the `Envelope` or `Automatic Weights` options.

Pull Request: https://projects.blender.org/blender/blender/pulls/127515
2024-09-12 20:25:27 +02:00
Hans Goudey
1e22f364f8 Sculpt: Replace automasking sculpt attribute API usage
Current the automasking code stores temporary data as geometry
attributes (except for multires where that doesn't work) in order to
persist the cached factors for cavity and occlusion accross multiple
strokes. However, the benefits of this aren't clear, compared to
improving the performance of these calculations. It's also the last
usage of the sculpt attribute API which we plan to remove. The system
is also hard to understand, to make a more solid cache of automasking
values it would be better to start from scratch.

This commit removes the sculpt attribute API and the automasking stroke
ID system, and moves the cached factors to be cached per stroke rather
than more permanently.

Pull Request: https://projects.blender.org/blender/blender/pulls/127470
2024-09-12 20:06:21 +02:00
Pablo Vazquez
1e98b7d2a3 UI: Show material link type icon in dropdown
Enums that are displayed as icon-only should have their icons defined
in RNA, not just through the layout in Python. That way they are shown
in the dropdown itself and users make the connection between the listed
item label and the icon while collapsed.
2024-09-12 19:23:15 +02:00