Commit Graph

150077 Commits

Author SHA1 Message Date
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
Campbell Barton
9819725666 Deps: update wayland dependencies
- wayland-protocols: 1.44
- wayland: 1.23.1
- weston: 14.0.2

Ref: !139127
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
Julian Eisel
5a5e1b7d14 Tools: Group commits in weekly report scripts
Since ec141ba3ff, commits from all branches are listed. Issue is that
commits from different repositories and branches will be mixed.
Personally I prefer grouping commits better, so I always edit the output
manually.

With this, commits will be grouped by branch, or PR if one can be found.
The branches and commits will then be printed under their target
repository. This isn't the owning repository of the branch or PR (often
people's personal fork), but the one it targets. This worked much better
in own tests.

Further:
- For some common repositories more readable names are used, e.g.
  "Blender Manual" instead of "blender/blender-manual".
- Commits of the Blender repository are listed first, without grouping
  under a `blender/blender`.
- Commits to each repository's main branch are listed first, directly
  under the repository grouping.
- See PR for a textual mockup of the output format.

Pull Request: https://projects.blender.org/blender/blender/pulls/138615
2025-05-20 19:13:43 +02:00
Julian Eisel
ec141ba3ff Tools: Include commits to all branches in weekly report script
Currently the script only includes commits to "main" branches. Much of
people's work is done in branches however, so developers either
customized the script, or they would manually go through own history to
find remaining commits (I asked some).

Even if some people prefer to only list main branch commits, it's much
easier to simply remove some commits than to add missing ones.

To be able to tell which branch a commit was on, this adds a " on
`branch-name`" after the commit hash. Personally I don't find this
optimal, I'd rather group commits under their repository/branch,
proposed separately in #138615.

Pull Request: https://projects.blender.org/blender/blender/pulls/138612
2025-05-20 19:07:18 +02: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
Jeroen Bakker
60990f6b72 Refactor: OpenXR: Add begin and end submit swapchain handler
Graphics bindings would be able to share resources more easily.
Extracted from !139140

Pull Request: https://projects.blender.org/blender/blender/pulls/139155
2025-05-20 14:04:45 +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
Clément Foucault
8bc70f24a1 EEVEE: Film: Reduce amount of compilation stutters at startup
Removes the stutters comming from the film shader.
The number of samples used by the film shader is set
throught a specialization constant. Since the number of
effective sample can depend on jitter position, this
number was fluctuating and trigger compilation on
new specialization until all specialization were
encountered.

Rounding the samples up to the most common sample
count fixes the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/139154
2025-05-20 12:45:45 +02:00
Clément Foucault
d3053fead0 GPU: Assert that a shader is not bound when deleting it
This caused UB in the tests now that tests are all ran
inside the same context.

A shader could be free but its pointer would be dangling
inside the `Context`. A new shader could have the same
address and generate UB after binding.

This is not the best way to solve this issue but at least
we prevent the use of the UB.

Pull Request: https://projects.blender.org/blender/blender/pulls/139109
2025-05-20 12:43:58 +02:00
Weizhen Huang
54e748852a Fix #139022: Cycles: Mix Color Node using socket values when constant folded
If Mix Color node clamps the result, we do not bypass the node, but
disconnect other inputs. However, for the case where both inputs were the
same, the disconnected one would use the stored socket value instead, so
set the factor to 0 to only use the intended input.

Pull Request: https://projects.blender.org/blender/blender/pulls/139098
2025-05-20 12:30:20 +02:00
Jacques Lucke
ecfd9ec2d7 Fix: Spreadsheet: bad default width for instance reference column
Now the default width of this column type is also derived from its content.
2025-05-20 12:14:33 +02:00
Campbell Barton
7883412cde Cleanup: rename Curve::type -> ob_type, remove BKE_curve_type_get
It's not common for object data to reference it's object type
so name the struct member to make this clear.

Also remove BKE_curve_type_get which is no longer needed.
2025-05-20 10:11:56 +00:00
Campbell Barton
cdaf17031e Docs: update help text for DNA renaming
Also use sha256sum in the example to calculate the sum and sort
definitions.
2025-05-20 19:59:52 +10:00
Aras Pranckevicius
389d770bf4 Fix #122256, #123862: OBJ import Clamp Size option issues
- #122256: Clamp Size option did not work at all, due to mesh
  bounding box still not being calculated (and was firing an assert
  in Debug build).
- #123862: Clamp Size option was rounding the resulting scale to
  powers of ten, which is not what anyone would expect.

This fixes both issues, and adds test coverage.

Co-authored-by: dshot92 <dshot92@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/139145
2025-05-20 11:57:42 +02:00
Campbell Barton
8fea423e00 Fix #139133: Crash entering edit mode for curve/text objects
- Make Curve::type the source of truth for the curve type,
  instead of Curve::vfont, since it's possible for this to be
  set to null from RNA which effectively changed it's type.
  See #138730.

- Update objects to match the curve type on file read.

  Without this, an object may link to a curve in another file which
  can be replaced by a curve data-block of a different type.

  Note that updating the object type was already being done
  when reloading library data and setting object data,
  just not on file load.

Ref !139137
2025-05-20 19:28:49 +10:00
Nathan Vegdahl
d9d399ccb1 Fix: Truncated filepath fields give incorrect path template errors
The Path Template errors reported in tooltips could be incorrect,
depending on whether the field was visually truncated in the UI or not.

For example, if you had a path `/tmp/{blend_name}{foo`, the error is
that the template expression `{foo` is unclosed.  However, if the
available space for the field in the UI is too small, the displayed path
could end up as `/tmp/{blend_na...`.  This is for display purposes only,
and shouldn't effect things like template errors.  However, it did, and
the error checking would be run on that display string, and report that
`{blend_na...` is unclosed, which is incorrect.

The issue was that the code doing the live error checking for the UI was
using the display string because it was conveniently available.

This fixes the issue by properly querying the property value via RNA,
and using that.

Pull Request: https://projects.blender.org/blender/blender/pulls/139144
2025-05-20 11:26:51 +02:00
Clément Foucault
de8f13d1d6 Fix: GPU: Assert caused by specialization constant with primitive expansion
This path was not passing the the specialization constant state
to `GPU_shader_bind`.

Fix #139132
2025-05-20 11:23:42 +02:00
Nathan Vegdahl
984a2b5298 Fix: RNA_property_string_get() always returns zero-length string
The variant of `RNA_property_string_get()` that returns a `std::string`
always returned a string with zero length. The issue is that it was only
calling `reserve()`, which ensures an underlying buffer with enough
*capacity*, but does not set the string length. The property's string
value would then be correctly copied to the reserved buffer, but the
string length would remain zero.

This commit fixes the issue by replacing the call to `reserve()` with a
call to `resize()`, which additionally sets the string length.

Pull Request: https://projects.blender.org/blender/blender/pulls/139106
2025-05-20 10:33:19 +02:00
Christoph Lendenfeld
717fa42e5e Anim: Add more modes to Select Grouped in pose mode
This adds the following options to Select Grouped in pose mode:
* Children
* Immediate Children
* Parents
* Siblings

Doing so means we are more in line with similar operators in edit mode.
Unfortunately re-using existing functionality from edit mode doesn't seem
possible due to the edit/pose bone difference.

The added functionality can handle multiple armatures in pose mode at once.
Also the same operators can be accessed from weight paint mode.

Implements #137274

Pull Request: https://projects.blender.org/blender/blender/pulls/137960
2025-05-20 10:19:31 +02:00
Omar Emara
85cfdf9e04 Cleanup: Assert on unknown enum 2025-05-20 09:45:28 +03:00
Omar Emara
a141d66aa2 Compositor: Add Relative To Pixel node
This patch adds a new Relative To Pixel node in the compositor. The node
converts values that are relative to the image size to values that are
in terms of pixels.

This is useful to use relative values in nodes that take pixel values.
For instance, the Kuwahara node has an input that defines the filter
size in pixels. If one wants to define it relative to the image size
instead, one can use this node.

The node can operate on float and 2D vector values. Further, the node
can do the conversion relative to a number of image properties:

- Per Dimension: Each dimension gets converted independently. The X
  value is relative to the X dimension and the Y value is relative to
  the Y dimension. This mode is special because in float mode, the
  output will be a factor as opposed to a float.
- X: Relative to the x dimension.
- Y: Relative to the y dimension.
- Greater: Relative to the greater dimension.
- Smaller: Relative to the smaller dimension.
- Diagonal: Relative to the diagonal of the image.

Pull Request: https://projects.blender.org/blender/blender/pulls/138773
2025-05-20 08:32:46 +02:00
Omar Emara
c9dc4a0f69 Fix: Crash when all inputs inside panel are unavailable
Blender crashes when a node has a panel whose children input sockets are
all unavailable. This happens when marking sockets as collapsed, where
the non-initialized header_center_y members of such panels are accessed,
causing asserts or crashes.

The update_collapsed_sockets_recursive function has a check that should
avoid such accesses, but it seems wrong due to the negation of the
visibility check.

To fix this, we move the visibility check to a guard condition in the
marking function instead, and simplify the collapsed check in the update
function.

Pull Request: https://projects.blender.org/blender/blender/pulls/139104
2025-05-20 08:26:36 +02:00
Campbell Barton
cd2be77610 Cleanup: remove unnecessary curve type check
Calculating the curve type isn't needed for data which is only written
for text curves.

Note that this complicates a fix for #139133 which changes how curve
type data is accessed, where a version of BKE_curve_type_get that used
old behavior would have had to be kept for version patching.
2025-05-20 15:43:22 +10:00
Campbell Barton
1f37a7d363 Cleanup: remove unused defines 2025-05-20 04:33:43 +00:00
Campbell Barton
277dc3aef4 Cleanup: use doxygen style comments for doc-strings 2025-05-20 04:33:42 +00:00
Campbell Barton
7473124d0f Cleanup: remove trailing space 2025-05-20 11:52:08 +10:00