Commit Graph

120055 Commits

Author SHA1 Message Date
Campbell Barton
e5deeafe92 Cleanup: spelling in comments (make check_spelling_*) 2025-05-22 11:11:48 +10:00
Campbell Barton
0bd62779e8 Cleanup: various non-functional changes for C++ 2025-05-22 01:01:08 +00:00
Campbell Barton
d603d872b9 Cleanup: quiet missing-declarations warning 2025-05-22 01:01:06 +00:00
Julian Eisel
3f705ff898 Fix: Windows test failure after recent asset library path changes
Test was failing since efdda78175. The asset library path was now using
backslashes on Windows, and got compared to a path with forward slashes. Use
our higher level path comparison function to make sure they point to the same
directory.
2025-05-21 21:20:15 +02:00
Julian Eisel
85150c7ba1 Fix: Asset browser glitch when library has back slash in path
When displaying an asset library that contains a back slash on macOS (or Linux,
I assume), resizing the asset browser would make all assets disappear, and
instead the message would show that indicates an invalid asset library path.
2025-05-21 21:06:08 +02:00
Julian Eisel
efdda78175 Fix #136906: Crash if asset library path contains back slash on macOS
Convert all slashes to native format when initializing an asset library. This
might convert slashes that are valid parts of the file name, but this just
leads to an error about a not found asset library, which is better than
crashing. This is a typical tradeoff when dealing with cross platform paths.
2025-05-21 20:40:40 +02:00
John Kiril Swenson
65f821139f VSE: Copy handles to selected strips
Now that handles are effectively hidden with the "Tweak Handles" option
(and clear themselves if `use_restore_handle_selection` is set),
handle selection for multiple strips is quite unintuitive.

It is expected that, after selecting a group of strips, the user will
be able to tweak all of their handles, even if they are not connected,
consistent with other NLEs.

This patch enables that behavior by propagating handle selection to
all selected strips if "Tweak Handles" is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/139075
2025-05-21 19:18:46 +02:00
John Kiril Swenson
50321bac99 Fix: VSE: Tweaking strip with selected handle
Originally, `element_already_selected` would always return `true`
as long as the user clicked on a strip that was already selected,
regardless of its handle selection state.

This led to unexpected behavior when trying to tweak a strip:
E.g. taking a strip, selecting its left handle, then trying to tweak
the strip itself would actually tweak the left handle unexpectedly, even
though the cursor would be far enough away that this does not make sense.
2025-05-21 19:18:41 +02:00
John Kiril Swenson
98090e0400 Cleanup: VSE: Add selection code documentation and const code
A lot of this is very messy and I keep running into
the same weird edge-cases, so hopefully more documentation
will help for the time being, until I can rework the entire
selection system in 5.0.
2025-05-21 19:18:41 +02:00
John Kiril Swenson
9a6350c4a0 Cleanup: VSE: Rename eStripHandle enums from SEQ_ to STRIP_
Rename from `SEQ_HANDLE_*` -> `STRIP_HANDLE_*`.
2025-05-21 19:18:41 +02:00
John Kiril Swenson
35cab63eaf Cleanup: VSE: Rename Strip::machine to channel
This should make VSE code more readable and easier to understand from an
outside perspective.

The name was chosen to be `channel` rather than `channel_index` to keep
things short and concise -- it should be clear based on the context
whether we are talking about the strip's channel index (singular case,
`Strip::channel` or `SeqTimelineChannel::index`) vs. the channel list
(plural case, e.g. `Editing::channels`).

Pull Request: https://projects.blender.org/blender/blender/pulls/138919
2025-05-21 19:13:20 +02:00
Bastien Montagne
4397fa5056 Refactor: Convert Node Socket Default Value and Storage readfile code to typed DNA handling.
For default values, the fairly complex reasoning for the code is explained
in details in comments. The TL;DR: would be that this code is needed to
safely load blendfiles older than 2.83, which were saved without any DNA
type information for these default value data.

Storage data have always been written with DNA info (added in commits
3bae60d0c9 and 9d91bc38d3), so no need to add special handling for them.
Just use regular DNA struct reading.

Pull Request: https://projects.blender.org/blender/blender/pulls/139175
2025-05-21 18:47:31 +02:00
Alberto Pilotto
e96e300099 Geometry Nodes: align sockets in Replace String and Slice string nodes
This is similar to f19f260ca8.

Pull Request: https://projects.blender.org/blender/blender/pulls/139219
2025-05-21 18:01:06 +02:00
Jacques Lucke
40177a8426 UI: Tree View: support drag&drop below last element
Previously, when reordering a tree view item to the end, one had to move it drop
it fairly precisely on the lower half of the last item in the list. This patch
makes it possible to just drop it below the last item too. The outliner has the
same functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/139025
2025-05-21 17:56:39 +02:00
Jacques Lucke
6e29616c49 UI: support scrolling over fully visible tree view
Currently, nothing happens when trying to scroll while hovering a tree view that
is fully visible (i.e. does not have a scroll bar). This patch makes it so that
the scroll event is passed through in this case so that one can scroll the
entire region even when hovering the tree view. If the tree view does have a
scrollbar, then the scroll-event is still captured by that even if scroll all
the way up/down already.

Pull Request: https://projects.blender.org/blender/blender/pulls/138930
2025-05-21 17:18:12 +02:00
Habib Gahbiche
f6048a5e7b Compositor: UI: Visualize render size and domain size in image editor
Show render region as a bounding box with a passepartout option.
Additionally, a text info is shown at the upper left corner, similar to
the info text in 3d view, showing the render size and current image
size.

Devtalk thread:
https://devtalk.blender.org/t/compositor-ui-improvements/34186?u=izo

Pull Request: https://projects.blender.org/blender/blender/pulls/120471
2025-05-21 15:57:31 +02:00
Clément Foucault
9a9fec7f03 EEVEE: Only request raytracing shader specialization if needed
This improves opengl startup time with default settings
or when rendering with raytracing turned off.

Fix #139188

Pull Request: https://projects.blender.org/blender/blender/pulls/139201
2025-05-21 15:57:00 +02:00
Damien Picard
9ce0a2d1d5 I18n: Add translation contexts to node panels
Node UIs can now have panels. Some of those may need to have their
labels translated using translation contexts. PanelDeclarations
already had a translation_context member, this commit adds a way to
specify this context, and to use it for translation on drawing the
node.

Pull Request: https://projects.blender.org/blender/blender/pulls/139124
2025-05-21 13:54:11 +02:00
Aras Pranckevicius
8119e4baa7 Fix: FBX importer was not skipping special MotionBuilder viewport cameras
Reported on devtalk: MotionBuilder produced FBX files contain
"cameras" that are not really user visible cameras, but rather map to
MotionBuilder viewports. They are at root, have no child elements,
and have special names. There is also a "camera switcher";
ignore that too.

Pull Request: https://projects.blender.org/blender/blender/pulls/139204
2025-05-21 11:15:20 +02:00
Omar Emara
14f7faf283 Compositor: Turn Crop node options to inputs
This patch turns the options of the Crop node into inputs.

Instead of specifying the bounds of the crop, the inputs now specify the
Width and Height of the crop region. The Crop Image Size option was
renamed to Alpha Crop and inverted, so it now defaults to actual
cropping. The Relative option was removed, as it is now superseded by
the Relative To Pixel node, and removal was done to facilitate the
options to inputs project.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/139163
2025-05-21 11:01:25 +02:00
Omar Emara
f790547fe9 Compositor: Use realize size for relative to pixel conversion
The Relative To Pixel node considers the original resolution of the
image with no transformation, while it is more useful for it to consider
the realized size instead, because that's what later processing nodes
will be using.
2025-05-21 10:31:09 +03:00
Sean Kim
f801740e01 Fix: Potential ASAN crash when Dyntopo sculpting
If the cursor has never been over the mesh and a stroke is drawn that
starts off of it, passes over the mesh, and then ends off of the mesh,
then when the active index is accessed, it is possible that the BMesh
indices and tables are not initialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/139184
2025-05-21 07:02:00 +02:00
Jacques Lucke
0559b6e787 Cleanup: Spreadsheet: remove unused extra column cache
This was used to cache a lazily evaluated viewer field in the past, but is
unused for a while now already. If we need it again, it can be implemented with
`GenericKey` instead of a custom version of that.

Pull Request: https://projects.blender.org/blender/blender/pulls/139192
2025-05-21 05:45:09 +02:00
Campbell Barton
3af6f7a989 Cleanup: place ID comments before the literal values
This is already done in most places and matches struct-member
comment ordering.
2025-05-21 12:40:10 +10:00
Campbell Barton
8f1cd941ce UI: show an icon in the "slots" menu for
A small quality of life change to indicate which slots are used.

This only applies to the slots menu, the UI List could show these too
however this requires extending the RNA API.

Ref: !138651
2025-05-21 11:09:25 +10:00
Guillermo Venegas
5b82ee11df Refactor: UI: Replace uiItemFullO_ptr with class method uiLayout::op
This converts the public `uiItemFullO_ptr` function to an object
oriented API (an `uiLayout::op` overload), matching recents changes
in the API.

Changes include rearranging the `IDProperty *properties` parameter to be
the last parameter. Now is optional (but will be removed), also instead
of using a return parameter the function now returns the pointer to
write properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/139166
2025-05-21 02:55:04 +02:00
Sean Kim
1d77037e88 Cleanup: Avoid unnecessary manual conversion of .hide_vert
This code appears to be leftover from a time prior to the
`BM_mesh_bm_to_me` method being able to apply the attributes correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/139186
2025-05-21 01:31:37 +02:00
Sean Kim
4ecde8dc53 Paint: Allow duplicating essential brushes into current file
With the release of the brush assets project in 4.3, most brush
management moved out of the current .blend file into either the
essentials library or user-created libraries.

With this change, a number of workflows became more difficult:
* Handling a large library of texture and texture properties for brushes
  due to ID linkage constraints.
* Having local tweaks to a brush without bloating the the asset library
  and reducing discoverability.

This commit introduces an intermediate step to assist with both of the
preceding pain points. The `brush.asset_save_as` operator is extended
to allow saving into the current blend file via the `Duplicate Asset`
context menu entry.

Additionally, these features help ease authoring brush assets in general
from the UI instead of requiring manual datablock management.

This allows brushes to be stored alongside other data inside a specific
blend file.

Related to #129655 and [1].

[1] https://blender.community/c/rightclickselect/XYMA/

Pull Request: https://projects.blender.org/blender/blender/pulls/138105
2025-05-20 22:02:42 +02:00
Sean Kim
7ada8e28d7 Cleanup: Rename Sculpt BMesh helper method and use it consistently
Pull Request: https://projects.blender.org/blender/blender/pulls/139122
2025-05-20 21:44:03 +02:00
Sean Kim
44e36ef581 BKE: Add BKE_brush_duplicate to support deep copying
This commit adds the `BKE_brush_duplicate` function that performs a deep
copy of a brush ID and all associated IDs into the current Main
database.

Unit tests are added with this case to ensure that grandchildren and
embedded data is handled correctly for both Sculpt and Grease Pencil
brushes, as the latter contains more ID references than other brush
types.

Related to #138105

Pull Request: https://projects.blender.org/blender/blender/pulls/138629
2025-05-20 20:29:52 +02:00
Hans Goudey
c0afb85a2c Fix: Menu search crash outside of node editor
Caused by c6995d03dd.
2025-05-20 13:25:15 -04:00
Jacques Lucke
416b40af05 Geometry Nodes: reduce Bake node weight in link-drag-search
Currently, when using link-drag-search and searching for "Value" shows the bake
node first. This is annoying because it's rarely what one means. It's shown
first because it's a shorter search entry.

This patch reduces the weight of that entry so that the Value node shows up
first.

Pull Request: https://projects.blender.org/blender/blender/pulls/139156
2025-05-20 18:36:56 +02:00
Jacques Lucke
66e96bf134 Spreadsheet: support reordering columns interactively
This adds a new modal operator that allows reordering columns interactively.

It's triggered by dragging the column header. Edge panning while dragging the
column to the left or right of the region is supported. Scrolling with a
horizontal scroll wheel works too.

There are three new UI elements to help the user understand what is happening.
These three elements seem to be fairly standard in other spreadsheet software.
* The column that is dragged is highlighted in its original place.
* A "shadow" of that column stays attached to the cursor.
* A line indicates where the column will be inserted.

Note: The column order is not yet persistent when columns disappear temporarily.
That will be worked on separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/139136
2025-05-20 18:19:24 +02:00
Jacques Lucke
c55ffb5258 Nodes: improve implicit inputs
This improves implicit node inputs in multiple ways:
* Fix crash when switching a group input socket type from e.g. vector to
  integer, while the default input is set to "position". Now, the default input
  type is reset automatically if it's invalid.
* Add Left/Right Handle as possible implicit vector inputs (next to Position and
  Normal). Those were the only ones that we used internally that were not
  exposed yet.
* When creating a new group input from an existing socket, also initialize the
  default input based on the socket. E.g. when grouping a `Set Position` node,
  the `Position` input of the group will now also use the position attribute by
  default.

In addition to these user-level changes, some internal changes were done too:
* Use unified `NodeDefaultInputType` in node declaration instead of function
  pointers which were hard to propagate to node groups.
* Use a new reusable `socket_type_supports_default_input_type` function in rna
  to filter the list of possible input items.

Pull Request: https://projects.blender.org/blender/blender/pulls/139139
2025-05-20 17:54:49 +02:00
Bartosz Kosiorek
6f1e0a8adf Physics: Decrease thickness of smoke surface emission for small objects
The Smoke Surface Emission is the height of the smoke from the mesh surface.
It is measured in Domain Grid Units, and if the grid unit is relatively big
(compared to the mesh), the smoke emission is huge.

To fix that the Surface Emission was decreased from 1.5 to 1.0. As a result
it is possible to emit smaller smokes (width 2, previously 3).

Further decreasing default value of Surface Emission is not recommended,
as in some cases (too small mesh compared to Grid Unit) will result not
emitted smoke.

Fix #132613: Issue with large smoke domain and small emitter

Pull Request: https://projects.blender.org/blender/blender/pulls/138567
2025-05-20 17:40:03 +02:00
Brecht Van Lommel
ee1a460f42 Revert "Refactor: Add and use MEMCPY_STRUCT_AFTER_CHECKED"
Needs more review, see #138830.

This reverts commit 5ac631d02b.
2025-05-20 17:32:49 +02:00
Hans Goudey
2673224ee5 Attributes: Implement memory counter for AttributeStorage
Similar to CustomData_count_memory.
2025-05-20 10:21:23 -04:00
Hans Goudey
1f4faa906c Fix: AttributeStorage shared data reading broken
Issue in original commit. The data pointer argument is already a pointer
to the array pointer. No need for three star programming here.
2025-05-20 10:21:23 -04:00
Omar Emara
aa6a0638ff Compositor: Remove Relative option from Translate node
This patch removes the Relative option from the Translate node. This is
now superseded by the Relative To Pixel node, and removal was done to
facilitate the options to inputs project.

Pull Request: https://projects.blender.org/blender/blender/pulls/139147
2025-05-20 16:05:07 +02:00
Guillermo Venegas
44160a0524 Refactor: UI: Replace uiItemFullO with class method uiLayout::op
This converts the public `uiItemFullO` function to an object oriented
API (an `uiLayout::op` overload), matching recents changes in the API.

Changes includes the removal of the paramether `IDProperty *properties`
that seems unused (all places just sets `nullptr`, can be added as last
argument with `nullptr` as default value though), and instead of using a
return paramether the function now returns the pointer to write properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/138961
2025-05-20 15:19:34 +02:00
Clément Foucault
decf99106a GPU: Add shader and pass name inside debug groups
This allows to know which shader specialization and
compilation are affecting performance.
2025-05-20 14:44:23 +02:00
Clément Foucault
1c17063155 EEVEE: Avoid stall caused by film specialization in preview render
This is because the warm_shader_specialization was
not called for the actually used specialization since
the samples_len would be updated right before accumulation.

Fixed by calling update_sample_table before the warm shader
call. Also avoid default filter request 4 sample specialization.
This avoid all stall altogether.
2025-05-20 14:38:36 +02:00
Hans Goudey
3d6ea7c075 Shape Keys: Use actual evaluated meshes in Update/Join operators
Previously this attempted to use the evaluated deform mesh (otherwise
known as the cage mesh). Because this isn't the mesh displayed in the
viewport it can be unintuitive, and it also doesn't work when the other
meshes are procedurally generated or have other "generative" modifiers.
This commit switches to just checking the evaluated mesh.

A potential downside is that modifiers like subdivision are also taken into
account and can potentially make the objects incompatible because of
mismatched vertex counts.

Part of #135095

Pull Request: https://projects.blender.org/blender/blender/pulls/138330
2025-05-20 14:19:52 +02:00
Christoph Lendenfeld
5f5c06fc24 Assets: Create Asset thumbnails via a screenshot anywhere in Blender
This patch adds the option to take screenshots for asset previews.
Since the functionality lives inside an operator, the screenshot can only
be taken from within the GUI of Blender.

* The operator can be accessed from the dropdown menu in the asset
browser preview n-panel.
* It works for local assets and assets that are managed by blender
(e.g. brush assets)
* Click drag anywhere in Blender to create a capture
* Holding Space will move the capture area
* Holding Shift will unlock the aspect ratio
* On a re-run, the operator remembers it previous capture
area to easily create an identical screenshot
* If the screenshot is fully contained within a single 3D viewport,
the background will render transparent

Pull Request: https://projects.blender.org/blender/blender/pulls/132904
2025-05-20 13:56:45 +02:00
Habib Gahbiche
c6995d03dd Nodes: Show error when image node cannot be added
Currently, if a user drags an image file into a node editor with
no node tree, then the operator silently fails.

This patch adds an error to warn the user that adding an image is
only possible if a node tree exists already.

Pull Request: https://projects.blender.org/blender/blender/pulls/138997
2025-05-20 13:44:08 +02:00
Damien Picard
7365a43c9a I18n: Disambiguate "Close"
- "Close" is usually the action.
- Specifically, it can refer to the camera's shutter closure.

Pull Request: https://projects.blender.org/blender/blender/pulls/139125
2025-05-20 13:30:01 +02:00
Damien Picard
f454d7a173 I18n: Fix weird translation string
Error messages already do formatting, there is no need for RPT_().
2025-05-20 13:30:00 +02:00
Brecht Van Lommel
5ac631d02b Refactor: Add and use MEMCPY_STRUCT_AFTER_CHECKED
Check if either the memory is zero or already matches the default value,
and copy. This simplifies a common pattern to a single line.

Preparing for default initializers in DNA (#134531).

Pull Request: https://projects.blender.org/blender/blender/pulls/138830
2025-05-20 13:27:08 +02:00
Brecht Van Lommel
f165c75e14 Refactor: Add various DNA_*_enums.h and DNA_*_types.h files
* Move colorband and theme DNA to own headers
* Move some anim, curve, modifier and space enums to new headers
* Move data transfer enums to DNA
* Duplicate imbuf proxy and GPU backend enums

For a few reasons:
* Reduce number of includes in DNA headers
* Don't define enums used in DNA outside of DNA
* Move theme settings to separate header for userdef_default_theme.c
* Prepare for using default initializers in DNA headers. (#134531)

Pull Request: https://projects.blender.org/blender/blender/pulls/138831
2025-05-20 13:26:43 +02:00
Christoph Lendenfeld
b690e9d4db Anim: Use bone_is_visible_... functions
This is mostly a non-functional change except for

* `overlay_armature.cc` was drawing relationship lines to bone
hidden by collection logic (except that doesn't seem to work anyway,
relationship lines are drawn regardless)
* `transform_snap_armature.cc` it was possible to snap to pose bones
hidden by collection logic.

I assumed those to be oversights so I changed them in this PR.

This does *not* remove all usages of `BONE_HIDDEN_P`
and `BONE_HIDDEN_A`. Some direct access is required in
the UI and for cases where we explicitly don't want to check
collection visibility.

Part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/139151
2025-05-20 12:58:53 +02:00