Allow creating a new asset catalog in a yet-to-be-saved blend file. The
problem was caused by `AssetLibrary` not having an `AssetCatalogService`
right after creation; only after loading data from disk was this
instance created. It's now always there.
`outliner_draw_overrides_buts` uses `uiDefIconBlockBut` but doing so
without defining a function callback to actually build a block.
This will make the button go down the route of spawning a popup, but
without a menu. Crash then happens later accesing the (missing) menu in
`ui_handler_region_menu`.
So while we could dive into making this usage failsafe (carefully
checking `BUTTON_STATE_MENU_OPEN` in combination with
`uiHandleButtonData->menu` being NULL all over), but it seems much more
straightforward to just use `uiDefIconBut` (instead of
`uiDefIconBlockBut`) since this Override Warning buttons seem not to
intend spawning a menu anyways?
Maniphest Tasks: T92265
Differential Revision: https://developer.blender.org/D12917
In 2.93 and before, when appending wityh 'localize all' off, all linked
IDs (including indirectly linked ones) from initial library would be
made local.
In 3.0, after refactor from rB3be5ce4aad5e, only directly linked IDs
(i.e. user-selected IDs) would be made local.
This change was not intentional (result of confusing code and naming in
previous implementation), and old behavior is used in some workflows to
control which data is kept linked and which data is made local.
This commit revert to 2.93 behavior.
NOTE: there is still an (extreme) corner case where behavior is
different between 2.93 and 3.0:
If you append (at the same time) object A from LibA.blend, and object B
from LibB.blend, and object B uses somehow a material from LibA.blend:
* In 2.93, that material would have been made local (because it belonged
to one of the 'initial' libraries, even though not the initial lib of
object B).
* In 3.0, this material will remain linked, since from object B
persective it comes from a different library.
When using `asset_mark` function from a Python script and afterwards
updating the preview image, a crash might happen. The preview image is
generated by the `asset_mark` function. This may happen on a background
thread, introducing potential synchronization issues.
This patch fixes this by separating the preview generation
`ID.asset_generate_preview` from the mark as asset `ID.asset_mark`.
Note: this separation of "mark as asset" and "generate preview" also
applies to the `ED_asset_mark_id()` C function; if it is desired to have
previews rendered after marking as asset, a call to
`ED_asset_generate_preview()` is now also required.
Reviewed By: sybren
Maniphest Tasks: T91197
Differential Revision: https://developer.blender.org/D12922
This patch includes an updated version of the raycast node that uses
fields instead of attributes for inputs instead of outputs. This makes
the node's UI much clearer. It should be faster too, since the
evaluation system for fields provides multi-threading.
The source position replaces the input geometry (since this node is
evaluated in the context of a geometry like the other field nodes).
Thanks to @guitargeek for an initial version of this patch.
Differential Revision: https://developer.blender.org/D12638
Make `AssetLibraryService::get_asset_library_on_disk(path)` insensitive
to trailing slashes; i.e. `get_asset_library_on_disk("/path")` and
`get_asset_library_on_disk("/path/¨)` will now return the same
`AssetLibrary*`.
`BKE_callback_remove` now checks whether the callback actually is known,
before trying to remove it.
`BKE_blender_atexit()` runs after `BKE_callback_global_finalize()`. When
an at-exit callback tried to unregister its BKE callbacks, these would
already be unregistered, causing a crash of Blender when exiting,
This commit removes the implicit conversion from points to a mesh
that used to happen before the next modifier. It also removes the
implicit realizing of instances that happened before another modifier.
Now we have specific nodes for both of these operations, the
implicit conversions make less sense, and implicit instance
realizing has already been removed in other nodes.
This adds another geometry nodes modifier before modifiers that would
have realized instances implicitly before. Currently adding another
data-block during versioning after linking means that an assert needs
to be changed. That should be made unnecessary by T92333.
Differential Revision: https://developer.blender.org/D12722
Some compositing applications do not support spaces and dots in layer names, and change
these to other symbols on import. This causes various compatibility issues, including
with Cryptomatte metadata. While technically those could be considered bugs in the
Cryptomatte implementation of other software, where they are not properly accounting for
that layer renaming, it's not ideal.
The OpenEXR channel naming convention is "layer.pass.channel". We get away with dots in
the layer name since we parse this from right to left, but it's a weak assumption.
Now we don't forbid using spaces or dots, and existing files are unchanged. But at
least by default names will be compatible, and hopefully other software catches up in
time to support more flexible layer names.
Ref T68924
OpenEXR uses "." to separate layers/passes/channels, so using AOV.001 is
a problem. Other applications will not be able to parse it correctly.
Default to AOV_001 instead, and don't allow using dots in AOV names.
Fixes T89991
Ref T73266
Ref D12871
The thread affinity setting in OIDN can break multithreading on some CPUs.
While this leads to somewhat worse performance on CPUs that do work correctly,
it's better than having some CPUs use only half the cores.
We do this in other nodes to reduce overhead of using the same node more
than once. I don't think it will make a difference with index nodes
currently, but at least it's consistent.
noise.cc uses std::min and std::max without
including the algorithm header required.
Newer MSVC versions and GCC implicitly include
it somewhere, which isn't something we should
count on. Best to include what you use.
Even though these nodes do support fields internally, there are no
input string sockets that support fields currently, so removing
the diamond sockets for now helps avoid confusion.
Differential Revision: https://developer.blender.org/D12828
Split thumbnail job in 2 passes. First pass will render visible images
and second part renders set of "guaranteed" equally spaced images.
When viewing larger amount of strips, it is likely that only 1 or 2
images will be rendered in first pass, while in second pass it is up to
30 images.
This results (seemingly) in 3x better performance, but zooming before
set of guaranteed images is done will be slightly more inaccurate.
During rendering VSE cache is invalidated, so thumbnails would be
removed and thumbnail job would constantly restart.
Even if thumbnails would be preserved, resources should be dedicated
for rendering job.
When the 'Separate Children' option is selected, the children of
the selected collection are inserted into the geometry output
sorted alphabetically by name.
One item to note is that the rename function does not trigger a
depsgraph update. This means that the changes are not reflected
in the spreadsheet until another action triggers the update.
Differential Revision: https://developer.blender.org/D12907
Move the static functions higher in the file so they are usabl
for an upcoming patch, and make it use clearer names instead
of overloading a function name.
Pencil
Not naming the auto-generated vertexgroup after the selected bone was
just confusing (since the group would not have an effect), so now use
similar code that is used for meshes for greasepencil as well.
Maniphest Tasks: T92314
Differential Revision: https://developer.blender.org/D12906
Instead of switch statements, make use of generic virtual arrays
so the code is shorter and easier to read.
Differential Revision: https://developer.blender.org/D12908
It seems possible to switch object selection (if `Lock Object Modes` is
turned off) and end up with an object that has a SculptSession but a
NULL PBVH.
(I was not able to repro from scratch, but file from the report was
clearly in that state).
This would crash in displaying scene statistics.
While there might be a deeper fix (making sure PBVH is available early
enough -- possibly using `BKE_sculpt_object_pbvh_ensure`,
`sculpt_update_object` or friends), there are also many checks in tools
for PBVH, so the situation seems to be somewhat vaild/expected also in
other places.
So to fix this, just check for a non-NULL PBVH, returning early
otherwise.
Note: this leaves us with displaying 0/0 Faces & Vertices in the borked
case until an operation takes place that updates the PBVH.
Maniphest Tasks: T92246
Differential Revision: https://developer.blender.org/D12904
The old code only worked when built-in nodes are only unregistered
at most once while Blender is running. However, this is not the case
when running certain unit tests such as `AbstractHierarchy*`
in `blender_test`.
Found by Sybren, thanks.
In an attempt to reduce scrolling. This can be re-visited if a kind of switch
between "compact" and "comfortable" UI size is implemented in the future.
On GCC in release mode (and maybe also debug mode without ASAN enabled),
allocating an `AssetLibraryService` will reuse the space that should
have just been freed. This made a test fail, as it was testing that new
memory was allocated and not some old instance reused.
To ensure that the calls that should allocate a new block of memory
return a unique pointer, I added some dummy allocation to the test.
No functional changes to Blender
Previously, every node had its own declaration. This isn't ideal, because
it's often the case that all nodes of the same type have the same declaration.
That's the case for all nodes using declarations currently. It will not be true
for e.g. group nodes in the future.
Sharing node declarations between nodes makes it a bit more efficient.
Differential Revision: https://developer.blender.org/D12898
This was caused by `DRW_view_data_texture_list_size_validate` which now
delete everything from the render engine.
This might change in the future but for now we just avoid calling it from
the render loop (when using DRW_cache_restart).
CD_PROP_COLOR vertex data is stored in scene linear while legacy vertex
colors are srgb, so both operators also need to do this conversion
Reviewed By: sergey
Maniphest Tasks: T79005
Differential Revision: https://developer.blender.org/D8320
Adds a button, Update All Paths, to the Motion Paths property tabs and
will always show. The operator goes through all visible objects and
updates their motion paths.
The current implementation has a subtle functional change. Calculating
or updating motion paths for armature objects (through the Object tab,
not Armature tab) now also updates the paths for its bones. We could
preserve the old behavior but it doesn't seem necessary. It seems more
likely that the animator wants to update both anyways.
Reviewed by: sybren
Maniphest Tasks: T83068
Differential Revision: https://developer.blender.org/D11667
Add `blender::bke::AssetLibraryService` class that acts like a
blendfile-scoped singleton. It's allocated upon the first call to
`BKE_asset_library_load` and destroyed in the LOAD-PRE handler.
The `AssetLibraryService` ensures that edits to asset catalogs are not
lost when the asset browser editor closes (or even reloads). Instead,
the `AssetLibrary` pointers it owns are kept around as long as the blend
file is open.
Reviewed By: Severin
Maniphest Tasks: T92151
Differential Revision: https://developer.blender.org/D12885
The Endpoint Selection node allows for the Selection of an aribitrary
number of endpoints from each spline in a curve. The start and end
inputs are evaluated on the spline domain. The result is outputted
as a boolean field on the point domain.
Differential Revision: https://developer.blender.org/D12846