The crash happens because some layout drawing code accesses the evaluated data
which is being generated by the baking thread. This access is not thread safe
currently.
This patch simply locks the UI of the properties editor when the interface is
locked using `WM_set_locked_interface` which is done during baking. The same is
done for the 3d view, node editor and spreadsheet already.
Pull Request: https://projects.blender.org/blender/blender/pulls/133867
When duplicating an action, it is stashed in the NLA on a muted track.
Over time this can slow down blender, because certain code will look at every
FCurve in every action in the NLA.
To fix the performance issue, we can take advantage of the fact that
stashed actions are put onto a muted NLA track.
With this patch any strip on a muted NLA track is ignored in the
Depsgraph evaluation.
Measurements of `DEG_graph_relations_update`
| - | Before | After |
| - | - | - |
| 50 actions | ~140 ms | ~10.0 ms |
| 100 actions | ~250 ms | ~10.7 ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/133864
This allows to run with the --debug-gpu option (which
does NAN and 0xF0F0F0F0 clearing) without asserts
even when the texture atomic workaround is enabled.
The refactor 9c0321ae9b
had the wrong mental model of the backing texture
layout for the atomic workaround.
For 3D textures, the layout is breaking the 3D texture
and reinterpreting the linear location as its 2D
linear location. This breaks the 3D texture Z slices
into non contiguous regions in 2D.
Comments have been added to avoid future confusion.
Pull Request: https://projects.blender.org/blender/blender/pulls/133830
Exposed by bc0b86797c
(but even before we had Asserts in a debug build -- also crashed
WITH_ASSERT_ABORT OFF)
The call to ensure Mesh data from a mesh in edit mode needs
to happen before the triangulation which uses Mesh. This gets rid of
the crash and also previous asserts.
Pull Request: https://projects.blender.org/blender/blender/pulls/133859
Emit a 'diff' for the `animdata.slot_handle` property whenever the
`.action` property is changed through a library override.
The slot handle is only meaningful within the context of the assigned
action. So when a liboverride changes the assigned action, the slot
handle should also get an override.
This is necessary even when the numerical value of the slot handle
happens to be the same in both actions, as the newly chosen slot is
different from the slot that was chosen in the library file.
This applies to direct Action assignment, NLA strips, and Action
constraints.
Pull Request: https://projects.blender.org/blender/blender/pulls/133727
Add `ensure` boolean parameter to the `ActionKeyframeStrip.channels()` RNA
function. Passing `ensure=True` will ensure the channelbag for the given
action slot handle exists. This makes it more straight-forward to create
F-Curves for a slot regardless of whether there already was a channelbag
for those F-Cuves:
```python
strip = action.layers[0].strips[0]
slot = action.slots[0]
# Old:
channelbag = strip.channels(slot.handle)
if not channelbag:
channelbag = strip.channelbags.new(action_slot)
ob_loc_x = channelbag.fcurves.new('location', index=0)
# New:
channelbag = strip.channels(slot.handle, ensure=True)
ob_loc_x = channelbag.fcurves.new('location', index=0)
```
Pull Request: https://projects.blender.org/blender/blender/pulls/133678
The reproject operator in GPv3 was implemented using the depth buffer instead of
using the transform snap functions that are based on raycasts. This causes
problems with accuracy and does not account for possible animation of objects.
This patch reintroduces the raycast method.
Pull Request: https://projects.blender.org/blender/blender/pulls/133863
Also adds a new `BLO_readfile_id_runtime_tags_for_write` accessor to
ensure readfile data is created before assigning a tag value.
Followup to 2ec1b6887d. Should cover the last existing ID tags that
can be moved to temp runtime readfile ID data.
Pull Request: https://projects.blender.org/blender/blender/pulls/133715
Auto-merge with nearby strokes seems to only implemented for stroke drawing.
Code has been copied from `on_stroke_done()` that handles the
auto-merging, this will allow to join the primitive shape with nearest stroke.
Pull Request: https://projects.blender.org/blender/blender/pulls/133420
This makes the code simpler, aligns it with the builtin translations in
messages.cc, and should improve performance as well. My motivation
for the change is to allow returning StringRef/StringRefNull from the
translation functions instead of char pointers.
To test the change I used the Sun Position addon which includes
translations and toggled different languages in the preferences.
Pull Request: https://projects.blender.org/blender/blender/pulls/133827
Use streaming to `std::cout` for debug prints, rather than using
`printf()`. Different compilers disagree on the `printf()` format string
for `int64_t`: GCC thinks it should be `%ld` while Clang says `%lld`,
and either will emit a warning when the other's preference is used.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/133857
VkBufferViews could be used after they were freed. The reason is that
they were not managed by the discard pool. Detected when looking in
failing render tests (pointcloud_motion.blend).
This part of the API is used by motion blur in EEVEE. Fixes the next
render tests
- `eevee_next_motion_blur_vulkan`
- `eevee_next_pointcloud_vulkan`
- `eevee_next_hair_vulkan`
Related: #133546
Pull Request: https://projects.blender.org/blender/blender/pulls/133856
The issue is that `ANIM_animdata_filter` with the flag `ANIMFILTER_ANIMDATA`
did not actually return only animdata.
The reason for this is in `animdata_filter_grease_pencil_data`,
where there is special handling for this flag.
It seems that returning non-animdata things is expected for Grease Pencil.
So my solution is to just verify the type of `bAnimListElem` before use.
Pull Request: https://projects.blender.org/blender/blender/pulls/133853
When writing an Action to a blend file, for forward compatability
reasons the animation data in the first slot is also written to the old
Animato Action storage locations. That way, loading the Action in an
older version of Blender will still at least have that animation data.
However, we overlooked `Action.idroot`, which indicates which ID
type the Action is for, and therefore all Actions have an unspecified
`idroot` when loaded in pre-layered-action versions of Blender.
This PR fixes that by also setting the `idroot` to match the target ID
type of the first slot when writing to disk.
Pull Request: https://projects.blender.org/blender/blender/pulls/133819
The File Output node sometime ignores the transformations of their
inputs. That's due to the fact that transforms are now delayed and the
File Output node does not realize its inputs on its domain in case it
was not multi-layer.
To fix this, add another realization mode for transforms only. And use
that in the File Output node, as well as the Bokeh Blur, UV Map, and
Plane Track Deform, which also need this fix.
Pull Request: https://projects.blender.org/blender/blender/pulls/133850
Nodes that process single values can fail to work for GPU compositing.
That's because multi-function procedures writes to the single values but
never uploads them to the GPU, which is what this patch does.
Pull Request: https://projects.blender.org/blender/blender/pulls/133851
When creating a layer, suffix is added to the new layer name. In move to
layer operation, the target layer is searched based on the old name,
results in transferring strokes to wrong layer. Now fixed with correct
target layer.
Pull Request: https://projects.blender.org/blender/blender/pulls/133697
When moving strokes to same layer, curve at wrong index is removed at
the end of operation. This seems to happen due to wrong order of
geometryset component.
Pull Request: https://projects.blender.org/blender/blender/pulls/133359
There is a special case in the compositor code where viewer nodes are
treated as composite nodes. This patch renames relevant methods and
updates comments to clarify this use case.
Pull Request: https://projects.blender.org/blender/blender/pulls/133811
This patch changes how the Wrap option in the Translate node works. It
now repeats infinitely when realized, and not just in its own domain.
This is essentially how it used to work prior to version 4.2, so we are
reverting that change. We also rename Wrap to Repeat for clarity.
This is part of an ongoing to project to allow the user to control how
boundaries and empty areas are filled after transformations. So similar
options will be added to all transform nodes. But this patch is the
first step, since the functionality is already there, we just need to
extend it to work in all domains.
Pull Request: https://projects.blender.org/blender/blender/pulls/133766
Small changes to the status bar display when the active object has non-
uniform or negative scale. Use CTX_data_active_object rather than
BKE_view_layer_active_object_get. Case correction for a text string.
Small spacing change. Improved comments.
Pull Request: https://projects.blender.org/blender/blender/pulls/133834
The original function did extensive calculations to get the nearest handle,
even though none of the calling functions used that information.
Its functionality was very similar to `mouseover_strips_sorted_get`, except
that it was less precise and did not factor in `STRIP_OFSBOTTOM/OFSTOP`.
`mouseover_strips_sorted_get` is called by
`ED_sequencer_pick_strip_and_handle`, so update all of the calling functions to
use this instead.
Refactor and replace `find_nearest_seq` into `mouseover_strip_get`, which does
not factor in padded strip handles, and is used only by
`ED_sequencer_special_preview_set` as a static function for scrubbing over
strips.
Pull Request: https://projects.blender.org/blender/blender/pulls/133744
Adds new function `foreach_content_slice_by_offsets` that gathers mask's
indices into `IndexRange` lists grouped by given offsets. New approach
doesn't need temporary `points_to_duplicate` array of size
`curves.points_num()`. Traversal is more effective as only selected
indices get visited. Also point data is copied by point ranges instead
of point by point.
Performance was tested with following code:
```cpp
TEST(curves_geometry, DuplicatePoints)
{
CurvesGeometry curves = create_basic_curves(100000, 100);
IndexMaskMemory memory;
IndexMask every_second = IndexMask::from_predicate(
curves.points_range(), GrainSize(100), memory, [](const int i) {
return bool(i % 2);
});
for (const int i : IndexRange(1000)) {
CurvesGeometry copy = curves;
const int expected_point_count = copy.points_num() + every_second.size();
ed::curves::duplicate_points(copy, every_second);
EXPECT_EQ(copy.points_num(), expected_point_count);
}
}
```
| | main | mask slices | slices & copy by ranges |
| -------- | -------- | ----------- | ----------------------- |
| full copy| 3346 ms | 2270 ms | 1614 ms |
| `i % 2` | 8084 ms | 5918 ms | 5112 ms |
| `!((i % 10 == 0) or` <br/>`(i % 10 == 1) or` <br/>`(i % 10 == 2))` | 4522 ms | 2860 ms | 2343 ms|
| `(i % 10 == 0) or` <br/> `(i % 10 == 1) or` <br/> `(i % 10 == 2)`| 4088 ms | 1961 ms | 1639 ms|
| `IndexRange(50020, 70)` <br/> <sub>(one small range in the middle)</sub>| 1966 ms | 100 ms | ~75 ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/133101
This adds support for Transform MouseInputMode INPUT_ERROR using a new
transform cursor HLP_ERROR (dashed line ending with WM_CURSOR_STOP.
This is shown when attempting an object rotation or scale when
transforms are set to "Affect Only Locations". At this time the status
bar is also cleared and an warning message is shown.
Pull Request: https://projects.blender.org/blender/blender/pulls/132957
Operators should not act on non-visible entities really.
Posemode already did the combination of "visible and selected" via
`FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN`, editmode didnt.
To resolve, add `EBONE_VISIBLE` as a condition (as done elsewhere).
Pull Request: https://projects.blender.org/blender/blender/pulls/133660
Previously, the global storage of these types either used a GHash or a
blender::Map. VectorSet is preferrable to GHash because it's type safe,
clearer, and faster. It's preferrable to Map because the key doesn't
have to be duplicated and because iteration is faster.
This PR moves these registered types to VectorSet, just like the
node, node socket, and node tree types. Note that none of these types
use RAII for allocation, so freeing is still done manually.
Testing was manually interacting with each of these systems, including
with addons that register their own types.
Pull Request: https://projects.blender.org/blender/blender/pulls/133778
This was caused by the subpass input workaround for non-tilebased
GPU using `texelFetch` on an `image`. This was supported before
the cleanup 9c0321ae9b.
But is against the GLSL specification and was removed inside the
cleanup.
Using `imageLoad` instead of `texelFetch` fixes the crash.
However rendering seems to be broken for other reasons.
Currently the "Show All" layer operator operator only enables visibility
for layers only. If the Grease Pencil object has layers that are children
to a Layer Group that is hidden, these layers would not be revealed
to the user.
This pull request modifies the grease_pencil_layer_reveal_exec function
to iterate through Layer Groups present in the object and sets them visible.
Pull Request: https://projects.blender.org/blender/blender/pulls/133613
10/12bpp movie writing code assumes that input image is properly
floating point for these cases. That is always true for regular
rendering, however VSE can produce 8bpp images, if there
are no float/HDR strips in there. Make these convert into a float
image in the render pipeline when needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/133802
Was just getting the default name, but if we also have a bone selected
in weightpaint mode, these should be named after the bone (otherwise the
armature modifier does not deform accordingly).
To resolve, basically do the same we do for meshes in
`ED_wpaint_ensure_data`.
Pull Request: https://projects.blender.org/blender/blender/pulls/133804
This adds another operator mode for changing brush radius and opacity while the
modal primitive operator is running. It's based on the `wm.radial_control`
operator but only implements simple mouse control for these two properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/133675
In renderdoc the debug stack got corrupted when render graphs where
reused. The previous usage didn't clear the stack. This PR clears
the debug stack when render graphs are reset.
This patch adds support for drag and dropping colors (from color buttons) into
the Compositing, Shading and Geometry node trees.
Additional support was added for dragging and dropping colors with an Alpha
component (which was previously ignored), both in the context of the Node Editor
and for Color Buttons in general. This handles cases like drag and dropping a
color from an RGB to an RGBA button, which recreates the color with a default
Alpha value of 1.0.
Pull Request: https://projects.blender.org/blender/blender/pulls/129026