The issue was that if the seqslide was cancelled such that the
`new_frame` of the left handle was greater than its previous
right_handle (before the cancel), `SEQ_time_left_handle_frame_set()`
would clamp this value and so the left handle would not properly restore
itself.
Fix by updating both handles at once (right handle first) if both
handles are selected and the cancel jump travels in the right direction.
This also seems to fix the situation where strips w/ both handles
selected would be erroneously detected as overlapping when moving them
rapidly side to side.
Pull Request: https://projects.blender.org/blender/blender/pulls/128740
Part of the brush assets project followups, see #116337.
Based on feedback, it seems important to indicate to the user when a brush has
unsaved changes.
There's no reliable updating mechanism we can use or hook into here, except for
RNA "update" callbacks. Brush data gets changed in many places in code, the only
way to do this seems manual tagging every time a brush property gets changed.
This PR introduces `BKE_brush_tag_unsaved_changes()` for this. I spent some time
going through all brush properties to ensure changes call the tagging function.
A known limitation with this will be that changes to dependencies won't be
indicated in the brush. E.g. Changing the texture attached to a brush won't make
the brush be indicated as changed.
The UI to indicate the changed brushes is being discussed still, see #128846.
Pull Request: https://projects.blender.org/blender/blender/pulls/128845
Fixes an issue with the new node insertion feature where, after a link drag search,
the main input of the new node is connected to, regardless of which one was chosen.
Pull Request: https://projects.blender.org/blender/blender/pulls/128640
This introduces partial functionality of Precision mode to 'Snap to
Grid'.
However, it behaves differently from 'Absolute Grid Snap', as it lacks
smooth mouse movement.
Precision mode is now available specifically for Transform operations.
The issue occurred because the code block that read the snap flag was
out of sync with the code block that saved the flag.
The solution was to centralize snap flag handling in the
`transform_snap_flag_from_spacetype_ptr()` function. This function
retrieves the appropriate snap flag and property based on the editor
type, eliminating the need for repetitive conditional checks and
ensuring that the correct snap flag is set for each editor.
Before version 4.1, the vertex destination during edge sliding for two
independent edges was always the midpoint of the vertices closest to
those edges.
In version 4.1, this behavior was improved to calculate the destination
based on the intersection of the edges. However, when the faces were
coplanar, the behavior would revert to the previous midpoint
calculation instead of using the intersection.
This fix ensures that the vertex destination consistently aligns with
the intersection point, even when the faces are coplanar.
In non-manifold geometry, the original loop could fail to identify the
correct slide direction because it checked for loop equality
(`l_other != l_edge`), which might never be met.
The condition has been revised to check for face equality
(`l_other->f != l_edge->f`), ensuring the loop terminates correctly and
preventing infinite iterations in problematic geometry cases.
The `transformEvent` function is becoming increasingly complex due to
the inclusion of operation-specific code.
To improve this, remove the `handled` boolean and allow each
`TransModeInfo::handle_event_fn` to determine how to handle already
processed events.
Additionally, move some operation-specific logic to the operators file.
Note:
The `handled` boolean was added in aef307cf31 to fix a bug with the
custom events of the Edge and Vertex Slide operators;
Instead of calling `BKE_nlastrip_new()` (which, due to backward compat
reasons automatically picks a slot), the Push Down operator now calls
`BKE_nlastrip_new_for_slot()`, which explicitly assigns the given slot.
On top of that, the frame range of the slot is used to set the strip's
frame range (instead of the range of the entire Action).
Pull Request: https://projects.blender.org/blender/blender/pulls/128444
Removes many of the operators, panels, and menus used exclusively by Grease Pencil v2 that are no longer needed in v3.
No functional changes are expected.
Some operators are still used by the annotations system and have to be kept around. These may be renamed in future.
Pull Request: https://projects.blender.org/blender/blender/pulls/128521
The geometry of objects behind Curves was being considered for snapping
even when occluded.
The occlusion test logic has been reworked and simplified when the snap
target is a Curve.
As a result, Snap to Face now works correctly for the active Curve.
The snap-to-grid constraint in the rotation operation should not be
limited to the grid closest to the constraint axis, as this restricts
rotational freedom.
This makes link-drag-search more convenient when one wants to insert a new node
between existing nodes. The change currently also affects normal node-insertion
when dragging it. The exact behavior still has to be figured out.
Pull Request: https://projects.blender.org/blender/blender/pulls/128197
The 'Closest' 'Snap With' option does not work well with 'Snap to Grid'
due to the unpredictable nature of this 'Snap With' option. That's why
another option is used in this case.
The option chosen in this case is the same one that was used in
'Absolute Grid Snap', that is, 'Median'.
When assigning an Action with the new API:
- check the Actions ID type (if it is a legacy Action), and
- check whether the ID is in NLA tweak mode.
This means that action assignment can fail, so the
`animrig::assign_action()` and `animrig::unassign_action()` functions
now return a `[[nodiscard]] bool`.
Part of `generic_assign_action()` has now also been shielded with an
`#ifdef WITH_ANIM_BAKLAVA` just to be sure.
This also includes a change in `BKE_animdata_free()`. That function now
first exits NLA tweak mode (if enabled) before freeing the Actions. This
makes it possible to simply un-assign the assigned Action, as all the
NLA tweakmode stuff has already been taken care of by the responsible
function.
Pull Request: https://projects.blender.org/blender/blender/pulls/128199
Caused by 1c77779160
That commit removed the part that created the skip_occlusion_plane
variable for edit meshes. Therefore, restore that part of the code.
Not verified by actually building, but pretty sure this was caused by
8bff3ec76b.
Since above commit, the Z axis of the View orientation was not negated
by default anymore.
This was then being accounted for in `applyRotation` (but not
`applyNormalRotation`).
So to resolve, do the same in `applyNormalRotation` as in
`applyRotation` (so negate there).
Pull Request: https://projects.blender.org/blender/blender/pulls/128115
When having two objects selected that use the same action,
the Graph Editor would effectively show the same FCurve on 2 channels.
When building the `TransData` array the code would iterate
all channels though not checking for duplicate FCurves.
As a result when transforming keys, the `TransData`
array would contain the same entry twice.
That would break the logic introduced in c6c7d3d8c4 which
builds a Map of the `float *` that needs
updating and the index of that data in the array.
Only the first index of the `TransData` array would be updated since the
Map can only contain a certain value once.
The fix is to ensure that entries in the `TransData` array are unique.
This is done in the construction of the array.
Pull Request: https://projects.blender.org/blender/blender/pulls/127911
Partially revert [0] which replaced BMBVHTree with SnapObjectContext.
While SnapObjectContext is a comprehensive method of performing
ray-casts, the purpose of edge-slide visibility checks is mainly to
exclude back-facing vertices.
Using SnapObjectContext has some down-sides that include iterating
over all dupli-instances for every vertex, details in code-comments.
Resolve be restoring simpler self-occlusion check.
[0]: 2d50a41d77
Ref !128016
When I was learning VSE code, MAXSEQ constant (a preprocessor define!) was
confusing. It makes it sound like it is "max sequences", but it is actually
"max channels". So rename it to SEQ_MAX_CHANNELS and make it C++ constexpr int
instead of preprocessor macro.
Pull Request: https://projects.blender.org/blender/blender/pulls/128024
Integrate an existing implementation of the SLIM unwrapping algorithm
into Blender. More info about SLIM here:
https://igl.ethz.ch/projects/slim/
This commit is based on the integration code written by Aurel Gruber
for Blender 2.7x (unfinished and never merged with the main branch).
This commit is based on Aurel's code, rebased and further improved.
Details:
- Unwrap has been moved into a sub-menu,
slim unwrapping is exposed as: "Minimum Stretch".
- Live unwrap with SLIM refines the solutions using a timer.
- When using SLIM there are options to:
- Set the number of iterations.
- Weight the influence using vertex weights.
- SLIM can be disabled using the `WITH_UV_SLIM` build option.
Co-authored-by: Aurel Gruber <aurel.gruber@infix.ch>
Ref !114545
This has already been tried to solve in f71d89bb04 (but apparently
still wrong).
This PR will hopefully address part of the scaling issues (rotation
needs another look, see below)
wrt. to scaling, the is code in place to reorient the size matrix in
`ElementResize` (for `Sculpt`, `Object`, `ObjectTexSpace` & `Pose`) that
multiplies by `td->axismtx` and it can be assumed that this code expects
`td->axismtx` to be normalized (otherwise the scaling adds up). And it
looks like all code coming here actually does this (except sculpt code
from `createTransSculpt`).
So to resolve, normalize `td->axismtx` in `createTransSculpt`.
NOTE: even after this PR, there can still be issues with scaling, namely
with rotated objects and global orientation, or when the pivot is set to 3D
cursor, those need another look.
NOTE: for rotation, I need another look at git history, atm. it seems
puzzling that f71d89bb04 e.g. uses `TransDataExtension::l_smtx` (this
is only ever used for pose related rotation?!)
part of #127398
Pull Request: https://projects.blender.org/blender/blender/pulls/127495
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
For an NLA strip to use a slotted Action, it needs to specify which slot
to use in that action. This is now handled by two new properties on the
strip in DNA & RNA: `action_slot_handle` and `action_slot_name`.
These serve the same purpose as their counterparts on the `AnimData`
struct.
Note that this commit does NOT add NLA evaluation support for slotted
Actions. It merely allows assigning them. Evaluation, tweak mode
support, etc. will be implemented in future commits.
Pull Request: https://projects.blender.org/blender/blender/pulls/127359