Avoid retrieving context data for every single node which can be
expensive when there are thousands of nodes. In the "Mouse House"
test file I observed a 13% improvement in drawing timings.
Pull Request: https://projects.blender.org/blender/blender/pulls/130239
Some Vulkan platforms don't support framebuffers with gaps between the
color attachments. Workbench framebuffers can create gaps.
(`in_front_fb`, `main_fb` when used for wire frame drawing).
This PR implements a detection mechanism to detect gaps. It also disables
features that are not able to comply to this requirement.
Detected when working on #129062
Pull Request: https://projects.blender.org/blender/blender/pulls/130258
Similar to the handling of this cache in `flush_update_step` (after a
brush stroke calculation), the face normals cache needs to be cleared.
Sculpt mode doesn't have granular updates implemented for face corner
normals currently.
Pull Request: https://projects.blender.org/blender/blender/pulls/130248
When symmetrizing a bone (in edit mode) any constraint subtargets were name flipped,
if possible and they exist. This only worked if the target is the armature of the bone
being flipped.
This patch changes that so a subtarget flip is always attempted for targets that are an armature.
Pull Request: https://projects.blender.org/blender/blender/pulls/129169
Brush assets from the current file should be supported like other brush
assets.
This assert would fail on startup for example, when opening the
essentials file containing the default brush of this mode.
Similar issues to previous problems in `IMAGE_OT_open` and the
`BKE_image` API... Relative filepaths of linked editable IDs must be
relative to the ID's library blendfile, not the current 'local'
blendfile.
Doing something like `for (auto key : get_map().keys())` does not work, because the lifetime
of the `Map` returned by `get_map()` is not automatically extended for the duration of
the loop. This could cause crashes at run-time.
Now this pattern will not compile anymore. Note that there are possible valid use-cases
of this iterating over a `Map` that won't compile anymore either. This is fairly uncommon
though, and just storing the map in a separate temporary variable is a simple fix.
This would have been a valid usage for example: `do_something(get_map().keys())`.
This would have prevented e.g. 9840dd233c.
Pull Request: https://projects.blender.org/blender/blender/pulls/129880
Videos written out of blender were not explicitly indicating the color
metadata (color range, primaries, TRC, color space). While some video
players assume BT.709, some others assume BT.601, leading to inconsistent
look.
Explicitly indicate BT.709 and limited ("mpeg") YUV range for video
codecs that are YUV based (i.e. final image is non-RGB(A)). Overall now
the code does the same as these command line ffmpeg parameters:
`-vf scale=out_color_matrix=bt709 -color_primaries 1 -color_trc 1 -colorspace 1`.
This also fixes an issue where video proxies were looking wrong within
Blender, if the source video file contained colorspace metadata.
Images in PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/130021
Currently, Sculpt Mode's UndoStep stores two main categories of data,
the first category is valid for undo pushes where individual nodes of a
mesh are modified, the second category is when the entire mesh is
changed.
To avoid extra processing of data and move towards reducing and
simplifying the amount of data each of these types of undo operations
need, this commit strips down the data stored when a geometry_push step
is called.
Additionally, there are some areas in the code which called
`BKE_sculpt_update_object_for_edit` as a requirement for the undo step
data, these calls have been removed.
---
Testing:
* Undo / Redo on mesh with color attributes and performing remesh operations
* Undo / Redo with shape key data
* Undo / Redo with trim tools
* Base Mesh
* Deform Modifier
Pull Request: https://projects.blender.org/blender/blender/pulls/129828
Use new `_in_lib` BKE_image API to re-use or load an image from/in the
expected library, including using the library path as root path for
relative file paths handling.
Using the new `BKE_image..._in_lib` API also allows to get rid of the
`check_exists` 'hack' introduced in `image_open_exec` (when support to
edit some linked data was added, in 5f9f3116db) to avoid re-using local
Image IDs for editable linked data (brush assets), since
`BKE_image_load_exists_in_lib` will now ensure to only re-use an Image
ID if it matches the target library.
This commit also simplifies/makes `ED_image_filesel_detect_sequences`
signature more to the point. It replaces the `Main` parameter by a mere
`root_path` string. The given `bmain` was indeed only used to extract
(again) a base for relative paths.
NOTE: The general idea of this fix is the same as in PR !130058, thanks
to Sean Kim for the investigation and initial fix.
Pull Request: https://projects.blender.org/blender/blender/pulls/130197
This commit adds support for clang-tidy checks during compilation on
macOS, which can now be enabled using the optional `WITH_CLANG_TIDY`
CMake variable.
The clang-tidy executable doesn't need to be separately installed since
CMake will pick up the executable from the LLVM pre-compiled library.
This commit also expands the coverage of clang-tidy checks to
Objective-C/C++, for which checks were enabled in PR #128334.
Pull Request: https://projects.blender.org/blender/blender/pulls/129761
Previously, we had to fetch all asset previews at once. However the preview
caching system was limited at 8192 previews, so with large asset libraries, many
previews would get dropped. Instead, allow selectively requesting previews and
only request previews of items displayed on screen. This should fix the issue,
and reduce the time it takes to display brush assets in general, especially with
bigger libraries. This should also reduce memory usage quite a lot when
displaying the asset shelf, since not all asset previews are loaded anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/130105
This commit refactors `BKE_image_load` and `BKE_image_load_exists` APIs:
* Remove the `_ex` versions (the 'exist' boolean return pointer can have
default `nullptr` value instead).
* Add `_in_lib` versions, which match signature and behavior of the
generic ID creation code to allow to find or create a new image ID
directly in a library 'namespace' (as linked data).
This is required by upcommig fixes for Brush Assets, which are using
linked but editable data-blocks.
Fix#130194: When trying to add a new image from the UI (e.g. for a new
texture) for a local ID, if that same exact image was already loaded by
a linked ID, it would trigger an assert in `BKE_id_move_to_same_lib`,
because `BKE_image_load_exists` would return the matching linked Image ID
instead of creating a new local one. In release builds with no assert,
it would result in making a linked ID 'local', while still being used by
original other linked data.
Passing around the intended final destination of the new Image (local or
in a given library) allows `BKE_image_load_exists` to be more specific
when searching for an already loaded matching image ID, and ensures that
a new local Image ID is created in the case described above.
Pull Request: https://projects.blender.org/blender/blender/pulls/130195
Remove `node_under_mouse_tweak` and replace it with
`node_under_mouse_select`.
The special handling for tweaking reroutes wasn't working correctly:
1. It didn't check at the correct reroute node location.
2. The (de-)selection behavior negated possible benefits anyway.
In practice the user-facing behavior is not affected by this.
Pull Request: https://projects.blender.org/blender/blender/pulls/130222
Partial fix for #129267.
Avoid creating an entry in the file list cache for every asset when iterating
over the available assets. For this, allow passing a pre-filter function to the
asset iterator, to filter based on `AssetRepresentation` data. The asset shelf
can then pre-filter based on asset type and the active catalog.
Really, the cached file entry is only needed to access the preview image of the
asset, so it can be avoided most of the time.
While this should still be solved properly as outlined in #122439, this is
a general improvement and fix the mentioned report in a minimal way.
Was hoping this would be sufficient to fix#129267, but the whole of
!130105 will be needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/130166
This implements the proposal from #124512. For that it contains the following
changes:
* Remove the global override of `new`/`delete` when `WITH_CXX_GUARDEDALLOC` was
enabled.
* Always use `MEM_CXX_CLASS_ALLOC_FUNCS` where it is currently used. This used
to be guarded by `WITH_CXX_GUARDEDALLOC` in some but not all cases. This means
that a few classes which didn't use our guarded allocator by default before,
are now using it.
Pull Request: https://projects.blender.org/blender/blender/pulls/130181
Caused by 71398478b2.
`parsubstr` is nullptr in Layer struct. This results in crash when an
object is parented to a new layer. This can be fixed by passing layer
member function `parent_bone_name()`. It handles the null pointer.
Pull Request: https://projects.blender.org/blender/blender/pulls/130205
* Early return in case the given `id` is already in the same library as
its target `owner_id` (in addition to both being local data).
* Assert with message AND return in case the given `id` is a linked ID
from a different library.
The second point somewhat mitigates the severity of #130194.
These were last used in some sculpt code that has been refactored
to do things more efficiently. For that same reason I don't think we're
likely to need them elsewhere.