Similar to !124267 and !124261
This normal data is eventually passed into `BKE_mesh_set_custom_normals`
and through to `mesh_normals_corner_custom_set` which expects normals to
actually be normalized per its documentation.
Not doing so would yield meshes with incorrect "sharp" data for affected
edges.
Thx @OmarEmaraDev for the initial patch
Pull Request: https://projects.blender.org/blender/blender/pulls/124336
The cause of the crash was that asset libraries are freed, but the filtered
trees used for things like node tool menus weren't marked dirty, so we
continued to use the freed asset data. On a design level this is quite
concerning because it means the lifetimes of the asset tree caches and
the asset system's asset libraries are connected tenuously.
Eventually there should be a better solution, but I found the simplest
fix for now is just to add a notifier when opening a new file that causes
the asset tree caches to be tagged dirty.
Pull Request: https://projects.blender.org/blender/blender/pulls/124254
The `enum_definition` property was changed by #121234 and now returns
the node itself. This creates an infinite recursion in the override
system that must be avoided by adding this flag.
Pull Request: https://projects.blender.org/blender/blender/pulls/124347
The issue here was that the left handle of the first point was calculated
incorrectly (set to the position of the point itself), which caused a
NaN when attempting to normalize a zero vector when computing extrapolation
vectors.
Pull Request: https://projects.blender.org/blender/blender/pulls/124239
Update the description to mention the node is now based on the OpenPBR
model rather than the Disney Principled Model. This has been the
case since Blender 4.0.
Pull Request: https://projects.blender.org/blender/blender/pulls/124209
When clearing depth attachment the write depth state should be enabled.
When this isn't the case a clear texture is being performed. Before
the render graph this used to be a performance issue as the rendering
would be suspended.
The render graph currently reorders these texture clears before of
the rendering context and therefore isn't seen as a performance issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/124340
The draw tool was creating catmull-rom curves because the
curve type attribute was being reset to the default (0) which
happens to be the catmull-rom type.
The fix makes sure to skip over the `curve_type` attribute when
initializing the other attributes to their default.
This change allows to pass optional freeing and copy callbacks to
functions setting the `func_argN` member of the `uiBut` and `uiBlock`
structs. These callbacks are used to free or duplicate the data stored
in these void pointers.
Defaults are set respectively to `MEM_freeN` and `MEM_dupallocN`, to
match previous hard-coded behavior.
Utils template functions are added to easily generate callbacks to
types that are managed with the `MEM_new`/`MEM_delete` C++-style
allocation, as long as they provide a copy constructor.
Note that this change should be considered as a temporary, transitional
solution. A more robust and future-proof solution is to move towards
more usage of `std::function` for these callbacks, which can then own
and manage their custom data themselves.
This normal data is eventually passed into `BKE_mesh_set_custom_normals`
and through to `mesh_normals_corner_custom_set` which expects normals to
actually be normalized per its documentation.
Not doing so would yield meshes with incorrect "sharp" data for affected
edges.
Pull Request: https://projects.blender.org/blender/blender/pulls/124267
Calling `MEM_freeN` on data allocated with `MEM_new` is bad, since it will not
call a destructor matching the one invoked as part of `MEM_new`.
Would crash with the guarded allocator, which detects such mismatches now.
Adds snapping in the VSE preview area.
Source points are the four corners and origins of all selected, visible
image quads. Targets can be preview borders, preview center, or
corners/origins of other strips.
Pull Request: https://projects.blender.org/blender/blender/pulls/122759
This makes it possible for popups to have their confirm & cancel buttons
defined in the operator's draw callback.
When used with popups created by: `WindowManager::invoke_props_dialog()`
to override the default confirm/cancel buttons.
In the case of `WindowManager::popover(..)` & `bpy.ops.wm.call_panel()`
this can be used to add confirm/cancel buttons.
Details:
- When the confirm or cancel text argument is a blank string the button
isn't shown, making it possible to only show a single button.
- The template is similar to UILayout::operator in that it returns the
operator properties for the confirm action.
- MS-Windows alternate ordering of Confirm/Cancel is followed.
Needed to resolve#124098.
Ref !124139
If you change an area to a File Browser while it is vertically
minimized we get an assert on layout initialization since there
are no visible rows. But this state is valid and it works great
without this assert. This PR removes the assert and adds a comment.
Pull Request: https://projects.blender.org/blender/blender/pulls/124253
It looks like the "user edited flag propagation" node built for the geometry
nodes modifier is unchanged after modifiers are removed. My guess is this
is now a more general problem when modifiers are removed-- I guess the
depsgraph nodes for an object have to be rebuilt when that happens now.
Maybe there is a more general fix, but to fix the crash mentioned in the
report, I tagged the depsgraph for a relations update, which rebuilds the
problematic modifier node.
Pull Request: https://projects.blender.org/blender/blender/pulls/124252
This removes `BKE_attributes_supported`.
Instead, a static method `from_id`
is added to the `AttributeAccessor` class that constructs
the accessor from the given ID. If this fails, `std::nullopt`
is returned.
Pull Request: https://projects.blender.org/blender/blender/pulls/124245