This applies the fix from 98334b8f7d to the c++ implementation.
Two notes:
* We need to work towards unifying these implementations which would have avoided this bug.
* In the C++ implementation, one can't use `math::dot` and `math::normalize` for quaternions
where this function is implemented, because of include dependency order.
Both these things should be resolved, but right now correctness has priority for me.
Pull Request: https://projects.blender.org/blender/blender/pulls/131296
This adds a `unit_test_compare` function to `Curves`.
Compares the curves. Curves are the same if:
* The number of points matches.
* The number of curves matches.
* The attribute names are the same and have the same type.
* The point attribute values are within the `threshold`.
* The curve topology matches (e.g. the curve sizes are the same).
* The curve attribute values are within the `threshold`.
* The indices of the points and curves are the same (can be ignored if this should be treated as the same).
The implementation reuses the same functions as the existing
comparison function for meshes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131164
This adds tooltip descriptions for five items in the Principled BSDF
that currently have no descriptions at all. Sheen Weight: "Intensity
of the sheen layer, which simulates very small fibers on the surface".
Sheen Roughness: "Roughness of the sheen layer. Low and high roughness
values produce fuzzy or dusty appearance, respectively". Tint Color:
"Color of the sheen reflection". Thin Film Thickness: "Thickness of the
film in nanometers". Thin Film IOR: "Index of refraction (IOR) of the
thin film".
Pull Request: https://projects.blender.org/blender/blender/pulls/126735
Restore overlay depth drawing which was removed in [0].
For viewport navigation this is useful. Disable overlays
for other operations such as painting & object placement.
Also disable color drawing in the overlay_next engine drawing
when drawing depth, since it caused the viewport to show a
checkered backdrop.
Details:
A boolean argument has been added to ED_view3d_depth_override instead
of new enums in eV3DDepthOverrideMode since mixing object-filtering
and draw-type in the one enum gets verbose & awkward, where most
existing enums would have needed to include NO_OVERLAY in their name.
V3D_DEPTH_NO_OVERLAYS has been renamed to V3D_DEPTH_ALL,
the caller must pass in use_overlay as false.
[0]: 5fea1eda36
Some popups are positioned centered in the window, like "Splash",
"About", and the large confirmations. But when you drag these to
a different location they will snap back when there is any window
interaction. This PR allows you to move these popups and they will
stay in the new location.
Pull Request: https://projects.blender.org/blender/blender/pulls/129125
The mesh edit mode overlay has some complex code to avoid
drawing the same edit data twice. That code has a bug where
it runs with the incorrect original object type. However, these
days we prevent multiple objects sharing the same mesh from
entering edit mode at the same time, so the duplicate skipping
is unnecessary as far as I can tell. This commit removes it.
Pull Request: https://projects.blender.org/blender/blender/pulls/131254
There has already been some work on the placement/size of the text
displayed by the Edit Voxel Size operator (see b65ab29310 &
0c98bb75cb), so it already sets up a suiting matrix in
`VoxelSizeEditCustomData` > `text_mat`. This includes having called
`ED_view3d_pixel_size` and this takes into account the UI resolution
scale already afaict.
So in order to resolve, just remove the multiplication by UI_SCALE_FAC.
Fixes#106849
Pull Request: https://projects.blender.org/blender/blender/pulls/131093
With the introduction of the brush assets project, there were a number
of changes to the overall API and UI that affect how user-defined
keymaps were made.
In all modes, users could either assign activating a brush via
right-clicking on the toolbar and assigning a shortcut, which would
bind to the `wm.set_tool_by_id` operator, or by manually inserting an
entry for `paint.brush_select`
For tools that have a one to one mapping for versions prior to 4.3
and ones post brush assets, we migrate the `wm.set_tool_by_id` `name`
property to the new name
For manually added entries, we swap from `paint.brush_select` to
activating the specific essential brush asset.
For Sculpt mode specifically, the number of tools in the toolbar
dropped significantly, any shortcuts that were created for these need
to be transitioned to activating a particular asset.
Finally, there are certain brushes that were expanded from a single
entry into multiple (e.g. multiple cloth brushes, paint brushes, etc)
For all of these cases, a reasonable default was picked.
Pull Request: https://projects.blender.org/blender/blender/pulls/130930
Use StringRefNull for all function arguments and return types.
Not a StringRef but StringRefNull since there is still large
interaction with C api so null-termination usually necessary.
If string is expected to be not only empty but also a null then
optional is used. This change depends on #130935.
Pull Request: https://projects.blender.org/blender/blender/pulls/131204
Change Timeline "Show Subframes" property description from "Show
current scene subframe and allow set it using interface tools" to
"Display and allow setting fractional frame values for the current
frame".
Pull Request: https://projects.blender.org/blender/blender/pulls/131115
03ae57dd8b extended poll functions to check if a given ID would result
in a non-empty preview using the automatic preview, but covered too many
operators. This check does not make sense for the Load Custom Preview,
or the Render Active Object operators. The former was fixed in
de487a6712, but turns out the same fix needs to be applied for the
latter too.
The animation system can't properly update the node tree to regenerate
all the necessary information when changing the operation. The operation
changing with animation also invalidates some assumptions we make to
improve performance, and the complexity of supporting it isn't worth
the questionable utility.
Similar to 7797fcc3c9 and dc9249c97f.
Pull Request: https://projects.blender.org/blender/blender/pulls/131252
We've had a bunch of inconsistency between `channel_bag` and `channelbag` in the
code base. After discussion with @dr.sybren, we decided to standardize on
`channelbag` and also rename the camelcase `ChannelBag` to `Channelbag` to be
consistent with that.
This PR implements those changes.
Note that the reason we standardized on `channelbag` rather than `channel_bag`
is because it makes things clearer when stringing multiple terms together in
type and function names. For example, in `channelbag_fcurves_move()` it makes
it clear that `channelbag` describes one thing, rather than `channel` and `bag`
being two separate things.
No functional changes intended.
Pull Request: https://projects.blender.org/blender/blender/pulls/130988
The new CPU compositor ignores group inputs that are unlinked. This
patch fixes that by considering all origin sockets in multi-function
procedures, be it an input or an output.
The new buffer size could have been non aligned when using the
fractional growing heuristic. This non aligned allocation
would then trigger an assert at the SSBO constructor.
Aligning the alocation size fixes the issue.
The Lighten blend mode is wrong for factors less than 1, as it is
computed as a weighted maximum using the factor as the weight, while it
should be a simple component-wise maximum.
This is correctly implemented for Compositor, EEVEE, and Cycles. But the
render/material implementation is wrong. So we adjust the implementation
to match the correct one.
The Darken counterpart was already fixed in 1dcf956849. While the
lighten was fixed in 8b7b165ad9 among other patches. This just completes
the fix.
Pull Request: https://projects.blender.org/blender/blender/pulls/131242
`Action.slots.new()` in the Python API previously took either an ID or nothing
as a parameter. In the former case it would create a slot with the appropriate
`id_root` and name for that ID. In the latter case it would create a default
slot with an unspecified `id_root` and default name.
This had several issues:
1. You couldn't create a slot with a specific `id_root` without already having
an ID of that type. In theory this isn't a problem, but in practice in larger
scripts/addons you don't necessarily have such an ID on hand at the call
site.
2. You couldn't directly create a slot with a desired name without an existing
ID with that name. This isn't so important, since you can always just set the
name afterwards. But it's a bit annoying.
3. Most other `new()` APIs in Blender *require* you to specify the name of the
item being created. So calling this with no parameters was violating that
norm.
4. Ideally, we want to eliminate unspecified `id_root`s, since they cause other
weirdness in the API such as slot identifiers changing upon slot assignment.
To resolve these issues, and just generally to make the API more
straightforward, this PR changes `slots.new()` to take two required parameters:
an ID type and a name. For example:
`slots.new(id_type='CAMERA', name="My Camera Data Slot")`.
This fully specifies everything needed for the slot identifier upon creation,
and doesn't require any outside data items to create a slot with the desired
type and name.
In the future if we decide we still want a `for_id`-style slot creation API, we
can reintroduce it as a separate function.
Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130970
`StringRefNull ` expects a null terminated string and `StringRefNull (const char *)` initializer
already realizes a runtime assert to avoid `nullptr` c strings, however this stills allows
initializing `StringRefNull ` with a explicit `nullptr`.
Deleting `StringRefNull(std::nullptr_t)` gives a error if `StringRefNull` is initialized with a implicit `nullptr`.
This follows the same deleted `std::string(std::nullptr_t)` initializer in c++23.
Pull Request: https://projects.blender.org/blender/blender/pulls/130935
Transform node in the new CPU compositor crash in background mode
because of a call to GPU_max_texture_size where the GPU module is not
initialized. To fix this, restrict this call to GPU device and use 2^16
as an upper limit for CPU.
GPU and GHOST require to have identical checks to remove faulty drivers.
When not done GHOST can still select a device that isn't supported and
lead to freezing interfaces.
Pull Request: https://projects.blender.org/blender/blender/pulls/131241