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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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.
- 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.