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
Handle the case separately when end points of strokes are selected.
Always deselect them (i.e. set "true", later array values are inverted)
when executing select less operation.
Pull Request: https://projects.blender.org/blender/blender/pulls/126591
When auto key is enabled, add keys to all layers in sculpt mode.
After 37458329e2, `ensure_active_keyframe` accepts layer argument. Run
a loop over all the layers, call above function to handle keyframe/drawing at
current frame.
Resolves#127650.
Pull Request: https://projects.blender.org/blender/blender/pulls/127849
Pipeline pool could log to much information that confused developers who
are not up to date what pipelines are. This PR will hide the confusing
messages. When working on Vulkan these messages can still be shown by
raising the log level.
See !128254
Pull Request: https://projects.blender.org/blender/blender/pulls/128352
This rare GPU has z-fighting issues in editor mode. Might be fixable by
changing the bias, but would decrease precision on other platforms as
well. Better to move this GPU to limited support. It is working, just
has some drawing artifacts.
See #128179
Pull Request: https://projects.blender.org/blender/blender/pulls/128351
The meshes custom data-mask edit-mode check only considered the object
in edit-mode if it was the active object. This isn't correct as multiple
objects can be in edit-mode at once.
The potential for `mesh_get_eval_deform` to leak memory remains,
this just avoids an unnecessary mesh re-generation on selection
(which was causing the leak), see: !128228 for details.
Brushes that restored from undo step data on every brush
iteration triggered a performance regression because of
missing filtering of unchanged nodes after recent changes
to the PBVH dirty positions tagging system. There was a
TODO comment left from 76c322047e that
I had forgotten about.
Part of #118145.
Prior to this commit, for each node that a brush step affected, we would
look up the `.sculpt_mask` and `.hide_vert` attributes. To avoid this
overhead, this commit creates a helper struct to hold commonly used
attributes and reduces the frequency that they are accessed.
Pull Request: https://projects.blender.org/blender/blender/pulls/128286
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'.
Fixes incorrect usage of StringRef in new grease pencil code, where
`.data()` was passed as a null terminated C string. Removes the now
unnecessary `std::string` creation that attribute accessors used to
fix that problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/128298
Part of #118145.
This PR introduces a number of helper methods used across the brush
implementations to reduce duplication when calculating a base value for
the `factors` array.
Not all brushes have been ported to use these helper methods - a
conservative approach was taken to avoid adding complexity for the
common case.
Pull Request: https://projects.blender.org/blender/blender/pulls/128235
When attempting to cache a generated image, the ImageFormatData's
view_settings would inadvertently be leaked due to the settings being
assigned a different set of values without first being free'd.
Additionally, there was another missed free from an early return a bit
later in the same function.
Pull Request: https://projects.blender.org/blender/blender/pulls/128229
Remove the indirection previously used for the topology refiner
to separate C and C++ code. Instead retrieve the base level in
calling code and call opensubdiv API functions directly. This
avoids copying arrays of mesh indices and should reduce
function call overhead since index retrieval can now be inlined.
It also lets us remove a lot of boilerplate shim code.
The downside is increased need for WITH_OPENSUBDIV defines
in various parts of blenkernel, but I think that is required to avoid
the previous indirection and have the kernel deal with OpenSubdiv
more directly.
Pull Request: https://projects.blender.org/blender/blender/pulls/120825
If conditions are not met for offscreen rendering, render job is used as
fallback. This can be skipped if there is possibility of race condition.
This was only considered for case where `context->for_render` was false,
since this indicates that call is invoked by the job itself.
If scene strip display is set to `OB_RENDER`, it needs to start the
render job. So variable `do_seq_gl` was renamed to `is_preview` and
reused in race avoidance connditon. This was done to convey clearer
meaning and match comments.
This change does make code less safe - race is avoided by UI not
allowing to run F12 render and opengl render at the same time. However,
I don't think, this could be easily resolved on VSE side without
suspending thread or being able to run multiple render jobs.
Pull Request: https://projects.blender.org/blender/blender/pulls/127926
Memory allocated to vertex buffer but the total verts are zero. This
triggers assert in bind function when `vbo_size_` is zero. Exit out of
funtion early to prevent the assert.
Also wrap `DRW_shgroup_call_no_cull` with if check.
Pull Request: https://projects.blender.org/blender/blender/pulls/128248
Implements the "Select Similar" operator for Grease Pencil v3.
Several modes are available. Each mode has a dedicated "distance" metric:
- layer, material: compared by index
- radius, opacity: simple value difference
- vertex color: euclidian float4 distance metric
The implementation uses a `Set` to find selected values first, then compare each point attribute value to each value in the set until a distance below the threshold is found. This could be optimized by using a KD-Tree in the future. Layer comparison is a special case because points are already separated into drawings by layer, so any drawing in a "selected" layer is becomes fully selected.
Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/111410
This adds an operator that splits all slots of the action on the active object,
into separate actions.
The newly created actions will be named `slot_name+Action`.
All users of those slots will be reassigned to this new action.
The exploded action will not be deleted, but will end up with 0 users
unless a fake user is set.
------
For the review, does that operator name make sense?
Pull Request: https://projects.blender.org/blender/blender/pulls/128251
Send a WM notifier when deleting a node from a node tree/group. Removing
a node also removes its animation data, and thus animation editors need
to receive a notification to refresh.
Pull Request: https://projects.blender.org/blender/blender/pulls/128255
`BKE_animdata_fix_paths_remove()` now calls into the new function
`animrig::legacy::action_fcurves_remove()`, which works for both
legacy and slotted Actions.
Also I updated the documentation of the BKE function so that it's clear
what it's actually doing.
No functional changes for legacy Actions.
Ref: #123424
Pull Request: https://projects.blender.org/blender/blender/pulls/128252
Reduce cognitive complexity of `BKE_animdata_fix_paths_remove()` by
returning early, returning literals (instead of variables) when the
returned value is known, and just calling `BKE_animdata_from_id()` instead
of re-implementing it here.
No functional changes.
With the Slotted Actions experimental feature enabled, Blender will use
versioning to automatically convert legacy Actions into slotted ones.
Assignment of the converted Action's slot can fail in the following
scenario, when dealing with the following dance between "old Blender"
(only supporting legacy Actions) and "new Blender" (versions supporting
slotted/layered Actions):
1. New Blender: create an action with two slots, ME and KE, and assign
to respectively a Mesh and a Shape Key. Save the file.
2. Old Blender: load the file. This will load the legacy data, but still
keep the assignments. This means that the Shape Key will get a ME
Action assigned, which is incompatible. Save the file.
3. New Blender: upgrades the Action, and tries to assign its only slot.
This will fail for the shape key, as the ID type doesn't match.
The failure is in itself okay, as there was actual data loss in this
scenario, and so issuing a warning is the right way to go about this.
The Action is still assigned, but the data-block won't get a slot
assigned.
Pull Request: https://projects.blender.org/blender/blender/pulls/128199
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
Layer selectors in Line Art and all modifier's Influence panel was
using the Grease Pencil icon, instead of the Grease Pencil Layer icon.
At the moment they are similar so it's easy to miss. But soon there
will be a new icon for layers so better use the right one.
The Line Art modifier was using Grease Pencil icon for materials
selector.
When exiting the immediate buffers are discarded, but where not
destroyed making the buffers still leak.
Detected when looking into descriptor set freeze issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/128249
Implements the design from #120318. The existing selection nodes now have
the ability to deal with float/soft selection. For meshes the soft selection
corresponds to the inverse of the sculpt mask attribute. In the future this
will likely be unified with edit mode selection a bit more which is why
this design was chosen compared to separating masking and selection.
Curves and point clouds already use a single selection attribute with
either data type.
Pull Request: https://projects.blender.org/blender/blender/pulls/126316
This adds an operator that moves slots of slot channels selected in
the channel box to a new action.
All slots are moved together into that new action instead of
moving them into separate actions.
I think that's more reasonable because that way the "move slots into separate actions" is
still possible by selecting the slots one by one.
The "explode action" operator that does just that can be a separate operator.
The new action is named after the slot for the case when only one slot is moved.
When multiple slots are moved, the name "CombinedAction" is used.
This also adds a menu entry "Action" to the action editor.
Pull Request: https://projects.blender.org/blender/blender/pulls/128171