Commit Graph

115470 Commits

Author SHA1 Message Date
Jacques Lucke
f0500a28ee Fix: BLI: quaternion is not normalized after conversion
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
2024-12-03 12:24:55 +01:00
Jacques Lucke
4d24b5fc08 Fix: Grease Pencil: crash when drawing grid overlay without active layer
Found when checking #130503.

Pull Request: https://projects.blender.org/blender/blender/pulls/131290
2024-12-03 12:23:43 +01:00
Campbell Barton
b48c81761f Docs: improve wording for dna_defaults.c descriptions 2024-12-03 22:20:43 +11:00
Pratik Borhade
3b303bed34 Fix: Grease Pencil: Remove group crash when tab is pinned
Missed in bd4f7acce5.

Pull Request: https://projects.blender.org/blender/blender/pulls/131295
2024-12-03 12:10:01 +01:00
Omar Emara
3b69fe0f40 Fix: Defocus node crashes for single value inputs
The Defocus node crashes for single value inputs, because single values
were not handled. Fix this by handling single values independently.
2024-12-03 12:24:27 +02:00
Omar Emara
1fc9ff4a4e Fix: Variable size Bokeh Blur node crashes
The Variable size Bokeh Blur node crashes due to access to pixels
outside of the image boundary. Fix this by accessing using extended
boundaries.
2024-12-03 12:22:15 +02:00
Omar Emara
03b3f69e33 Compositor: Assert for invalid pixel access 2024-12-03 12:21:31 +02:00
Falk David
f6c30bfe45 Curves: Add python function to compare curve geometries
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
2024-12-03 11:11:27 +01:00
Bartosz Kosiorek
c37e6290ec UI: Add missing tooltips to Principled BSDF for Sheen and Thin Film
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
2024-12-03 10:34:20 +01:00
Clément Foucault
18f3a11955 GPU: Remove remaining metal geometry shader workarounds
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/131267
2024-12-03 10:18:50 +01:00
Jacques Lucke
5e66ece252 Fix #131258: hidden sockets add padding to nodes 2024-12-03 10:08:59 +01:00
Harley Acheson
5d05c36fc7 UI: Fix Broken Menus after #129125
Copy and Paste error resulted in UI_block_end_ex
being called twice.  Remove the first.

Pull Request: https://projects.blender.org/blender/blender/pulls/131275
2024-12-03 02:53:38 +01:00
Campbell Barton
ababc2e01b Fix #120778: depth navigation ignores camera & light objects
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
2024-12-03 11:00:27 +11:00
Jesse Yurkovich
d0eff5f665 Cleanup: IO Common: Use clog and fmtlib instead of streams
Use CLOG for warnings and fmtlib for developer output and string
formatting rather than the heavy `<stringstream>` machinery.

Pull Request: https://projects.blender.org/blender/blender/pulls/131126
2024-12-03 00:24:01 +01:00
Clément Foucault
000f1cfa64 DRW: Port Select engine to new draw manager
Includes no functional change.

Pull Request: https://projects.blender.org/blender/blender/pulls/130378
2024-12-02 23:20:29 +01:00
Bartosz Kosiorek
fc122a1a70 UI: Avoid redundancy with Adaptive Time Steps property name
Change "Use Adaptive Time Steps" to "Adaptive Time Steps" with a
description of "Automatically decide when to perform multiple
simulation steps per frame"

Pull Request: https://projects.blender.org/blender/blender/pulls/131170
2024-12-02 23:10:02 +01:00
Clément Foucault
c770b940ae GPU: GLSL C++ Stubs: Use extern variables for buffers and uniforms
Avoid false positive warning about division by zero.
2024-12-02 23:01:12 +01:00
Clément Foucault
e0989d5bd6 Cleanup: GPU: Address unused GLSL variables throughout the codebase 2024-12-02 23:01:12 +01:00
Clément Foucault
01f1e9a2c4 GPU: Silence most GLSL C++ compilation warnings 2024-12-02 23:01:12 +01:00
Harley Acheson
154ab16ee2 Fix #128419: Allow the Positioning of Centered Dialogs
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
2024-12-02 22:01:05 +01:00
Clément Foucault
2c3ccdf77a GPU: GLSL compilation as C++ for eevee static shaders
Rel #127983

Pull Request: https://projects.blender.org/blender/blender/pulls/130298
2024-12-02 21:26:15 +01:00
Hans Goudey
977387ef0d Fix #131192: Crash with curve with evaluated mesh in edit mode
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
2024-12-02 21:11:07 +01:00
Sean Kim
ed5bcf06b5 Fix: Apply correct version bump for previous change
66bbdeba77 applied the versioning change
in the past to the wrong number as part of testing for the 4.3 branch.
This commit updates it and the version in main to be the correct value.

Pull Request: https://projects.blender.org/blender/blender/pulls/131259
2024-12-02 21:04:49 +01:00
Harley Acheson
798a48f6ef UI: Use Separate Mouse Cursors for Join Operations
To better indicate the point during dragging where join changes to
docking, use specific "join" cursors like we used to use.

Pull Request: https://projects.blender.org/blender/blender/pulls/131167
2024-12-02 20:30:51 +01:00
Philipp Oeser
a0c0eefd5d Fix #106849: Sculpt Edit Voxel Size text too big (applies UI scale twice)
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
2024-12-02 20:04:03 +01:00
Hans Goudey
56be16b21e Fix: Compile error after recent StringRefNull cleanup 2024-12-02 13:58:28 -05:00
Sean Kim
66bbdeba77 Fix #130527: Brush related keybinds do not import into 4.3 correctly
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
2024-12-02 19:54:29 +01:00
Clément Foucault
3d9ffa5085 Overlay: Remove legacy option and legacy code
This simply removes the old overlay engine.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/131155
2024-12-02 19:47:55 +01:00
Iliya Katueshenock
7348e670b3 Cleanup: BKE: Use StringRefNull instead of char *
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
2024-12-02 19:24:07 +01:00
Harley Acheson
bc430c4e67 Fix #131017: Improve Subframe Tooltip
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
2024-12-02 19:18:28 +01:00
Hans Goudey
d04ac76ed8 Fix #131214: Geometry Nodes: Crash due to Free curve normals 2024-12-02 13:11:52 -05:00
Julian Eisel
6e44380e8d Fix #131185: Active object asset preview operator broken for node groups
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.
2024-12-02 18:51:56 +01:00
Hans Goudey
b5a2858fab Fix #131194: Crash with animated geometry nodes math node operation
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
2024-12-02 18:42:52 +01:00
Philipp Oeser
914e824900 Cleanup: typo in Sculpt function name
Unnoticed since 4a373afa5f

Pull Request: https://projects.blender.org/blender/blender/pulls/131160
2024-12-02 18:27:20 +01:00
Jesse Yurkovich
3bb6e8f1b8 Cleanup: Remove old embedded preview_grease_pencil_legacy.blend
Looks like a simple leftover. The linkers are smart enough to completely
exclude this from the final binary so this is only targeting `main` as a
general cleanup.

Part of #130518.

Pull Request: https://projects.blender.org/blender/blender/pulls/129271
2024-12-02 18:07:57 +01:00
Nathan Vegdahl
089c3cd85c Refactor: rename ChannelBag and channel_bag
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
2024-12-02 17:55:59 +01:00
Omar Emara
6879d924eb Fix: Compositor: Unlinked group inputs are ignored
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.
2024-12-02 18:52:44 +02:00
Omar Emara
c2b1b84094 Cleanup: Remove unused variable 2024-12-02 18:51:41 +02:00
Clément Foucault
4bfaecc340 Fix #131212: Metal: Non-aligned circular buffer allocation logic
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.
2024-12-02 17:34:35 +01:00
Jonas Holzman
62b2bb48e8 macOS: CMake: Fix last CMP0177 policy warnings
This commit fixes the last few CMake CMP0177 policy warnings on macOS.

Follow-up to: #130602 and 536937b4d4

Pull Request: https://projects.blender.org/blender/blender/pulls/131219
2024-12-02 17:15:58 +01:00
Omar Emara
eaa0ae23a9 Fix: Lighten blend mode is wrong for factors less than 1
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
2024-12-02 17:12:08 +01:00
Nathan Vegdahl
aa83738d44 Anim: change parameters of slots.new() RNA function
`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
2024-12-02 17:04:37 +01:00
Omar Emara
7ec9fa680e Compositor: Implement Scale node or new CPU compositor
Reference #125968.
2024-12-02 18:02:38 +02:00
Jeroen Bakker
53eadcc533 ImageEngine: Migrate to new draw manager
Converts the image engine to the new draw manager.
This is an as is migration without just a few tweaks to improve the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/131142
2024-12-02 16:10:02 +01:00
Iliya Katueshenock
26b13504d4 Cleanup: BKE: unnecessary namespace usage
Since 75d17b1db5 everything in the file are already in such a namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/131205
2024-12-02 15:38:28 +01:00
Guillermo Venegas
4a23553b83 BLI: avoid initializing StringRefNull with explicit nullptr
`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
2024-12-02 15:30:27 +01:00
Omar Emara
819ff69ea3 Fix: Crash in compositor transform node
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.
2024-12-02 16:29:35 +02:00
Jacques Lucke
cdbd3f8bee Fix: Nodes: improve spacing from last socket to end of node
This was reported in https://projects.blender.org/blender/blender/pulls/124042#issuecomment-1355483
2024-12-02 15:28:32 +01:00
Jeroen Bakker
e0252ae6de Overlay: View not set for overlay_clipbound shader
overlay_clipbound wasn't working in the Vulkan backend as the draw_view
was never uploaded. In vulkan this lead to a crash as it is more strict.

Detected when researching #131111

Pull Request: https://projects.blender.org/blender/blender/pulls/131247
2024-12-02 15:22:35 +01:00
Jeroen Bakker
108a0f2ec0 Vulkan: Share driver check between GPU and GHOST
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
2024-12-02 14:50:32 +01:00