Commit Graph

122218 Commits

Author SHA1 Message Date
Clément Foucault
628a10a9fb GPU: Shader Preprocess: Add basic support for struct methods
This adds the following features:
- `class` keyword support: checked by C++, mutated to struct for shader.
- `private` and `public` keywords: checked by C++, removed for shader.
- `static` methods.
- `const` and non-const methods.

What is not supported:
- Constructors
- Destructors
- operators
- Method definition outside of class definition
- member reference without `this` keyword.

This is implemented using a very simple lexer/parser allowing semantic traversal.

Pull Request: https://projects.blender.org/blender/blender/pulls/144025
2025-08-08 16:49:15 +02:00
Sergey Sharybin
55942f5fbe Armature: Switch envelope weight calculation to the new subdiv code
There should be minimal user-measurable changes since the old algorithm
is not the same as OpenSubdiv. For example now creases (both edge and
vertex ones) are properly supported.

This allows to have less dependencies on the old subdivision surface code
which ideally will be removed soon.

Pull Request: https://projects.blender.org/blender/blender/pulls/143712
2025-08-08 16:29:12 +02:00
YimingWu
d6cc9a0793 Fix #142700: Grease Pencil: Allow copying strokes without materials
Previously copying grease pencil strokes implicitly requires materials
to be available in `grease_pencil_copy_strokes_exec` which isn't
necessarily the case sometimes. Now just set material session uid to 0
when material is not found. When pasting, non-existent materials will
be created as a fallback already.

Additionally, this PR corrects material
access by using `BKE_object_material_get` instead of manually getting
the material from grease pencil material array, making it consistent
with the rest of the logic in blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/142702
2025-08-08 16:09:33 +02:00
Jeroen Bakker
5e2de91654 Fix #142537: Vulkan aliased wireframe occlusion
overlay_wireframe_frag doesn't always set the gl_FragDepth. Depending on
how the driver deals with this it can use uninitialize values or previous
values. This leads to render artifacts as depth testing/storage could be
wrong.

Pull Request: https://projects.blender.org/blender/blender/pulls/144198
2025-08-08 15:51:42 +02:00
Brad Smith
57c25dc222 Build: Only link to librt on Linux
The code that uses this is within #ifdef __linux__. This fixes a build
failure on OpenBSD where this library does not exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/143682
2025-08-08 15:23:42 +02:00
Omar Emara
38a94c02c6 Fix #144107: Cryptomatte picker always samples first frame
The Cryptomatte file picker always samples the first frame in an image
sequence, even if the image editor/backdrop display a different frame.
To fix this, we take the frame into consideration when retrieving the
image to sample from.

Pull Request: https://projects.blender.org/blender/blender/pulls/144195
2025-08-08 15:08:51 +02:00
Habib Gahbiche
7071d9a030 Cleanup: Use correct macro for versioning 2025-08-08 13:35:34 +01:00
Habib Gahbiche
7c3b04549a Compositor: Turn off Render Layers preview in default node tree
The preview of the render layers node is set to off in the default
node tree.

The reasoning is:
- It is common to start compositing without rendering, so this will
give a cleaner look for a first impression.
- Previews in general are not working well (currently the preview won't
compute if the node is disconnected, sometimes the preview is shown
with an empty image, etc..).

Pull Request: https://projects.blender.org/blender/blender/pulls/144173
2025-08-08 14:32:59 +02:00
Jacques Lucke
24c4e0a3f7 Geometry Nodes: move bundle and closure nodes out of experimental
This moves the bundles and closures features out of experimental,
making them an official part of Blender 5.0.

Also see #134029.

Pull Request: https://projects.blender.org/blender/blender/pulls/143750
2025-08-08 13:48:02 +02:00
Falk David
8873dff159 Fix: Grease Pencil: Assert in length modifier due to wrong argument
Discovered in #144048.

The `evaluated_length_total_for_curve` function expects the correct
cyclic value of the curve to be passed in.
2025-08-08 13:45:36 +02:00
Hans Goudey
5deb4b66ed Cleanup: Avoid copying strings in compositor file output node
StringRef or StringRefNull should be used unless the string actually
needs to be copied.

Pull Request: https://projects.blender.org/blender/blender/pulls/144156
2025-08-08 13:36:41 +02:00
Pablo Vazquez
86000f78ba UI: Improve image output File Format menu
Improve the layout and listing of image output file format menu.

* Sort the menu alphabetically.
* Remove image icons.
* Remove column layout, use a single list.
* Group first the most commonly used formats.
* Add extension, similar to I/O menus.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/144162
2025-08-08 13:04:07 +02:00
Sergey Sharybin
cda9ff445f Shrinkwrap: Use OpenSubdiv instead of legacy DerivedMesh
The title says it pretty much all: the shrinkwrap modifier is no longer
dependent on the legacy DerivedMesh.

The benefits for doing this are:
- The DerivedMesh is closer to be removed from the codebase.
- Only base vertices are subdivided which could result in better
  performance and memory usage.
- Proper crease support (for edges and vertices).

The downside of using OpenSubdiv is that the topology refiner might be
expensive to calculate, so for meshes with a lot of extraordinary faces
(such as n-gons, triangles) the performance will be worse.

Pull Request: https://projects.blender.org/blender/blender/pulls/143706
2025-08-08 12:44:10 +02:00
Sergey Sharybin
8e9c68f6a3 Cleanup: Bake from multires code
This PR contains the following incremental changes:
- Remove dead code of AO multires baker
- Use C++ primitives in multires baker (and cleanup some comments and naming)
- Remove unused bake user scale

Pull Request: https://projects.blender.org/blender/blender/pulls/143707
2025-08-08 12:43:01 +02:00
Bastien Montagne
d5bc0fb4bb Fix #144065: Do not transfer special user count (e.g. the fake user) when duplicating. 2025-08-08 12:30:04 +02:00
Bastien Montagne
62d1c3d998 Fix more cases of invalid ID refcounting status in RNA.
* NodeTree space does not refcount the displayed nodegroup
* Collections used by light linking _do_ ID refcount (unlike default
  expected behavior for Collection usages).
2025-08-08 12:04:00 +02:00
Jeroen Bakker
e408029d5b Cleanup: Vulkan: Remove not needed code.
Would never have anything to report. Can be added back when there are
validation messages added.
2025-08-08 11:10:38 +02:00
Jeroen Bakker
073b4d4d7b Fix #144048: Vulkan: Crash minimized windows
Swapchain handling of minimized windows wasn't correct. On some
platforms it still tried to create images with no surface.

This PR will discard swapchains of minimized windows, but still being
able to flush the render graph and free resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/144189
2025-08-08 11:03:02 +02:00
Falk David
816da3c63b VSE: Copy settings of active scene when adding new scene
The `Add` > `Scene` > `New Scene` operator was behaving as follows:
* If there is no active scene strip, create an empty blank scene and
   assign it to a new scene strip.
* Otherwise, use the scene referenced by the active scene strip and
  use one of the copy scene methods (blank, copy settings, copy linked,
  or full copy) to create a new scene and assign it to a
  new scene strip.

This was not ideal for 2 reasons:
1. With no strip selected, creating blank scenes is generally not very
   useful as it means that the user has to e.g. update all the render
   settings, add a camera, etc.
2. The behavior of copying an existing scene by using the active strip
   is very hidden. Also because adding the strip immedialty calls the
   move operator, so you cannot even adjust the copy method of the
   scene.

This PR changes 3 things:
1. Don't use at the active scene strip. Instead use the active scene.
2. Don't create an empty blank scene, copy the settings of the active
   scene by default. This means that e.g. render settings can be reused.
 3. The operator entry in the `Add` > `Scene` menu is now called `Empty Scene`.

Part of #144063.

Pull Request: https://projects.blender.org/blender/blender/pulls/144069
2025-08-08 10:50:58 +02:00
Jacques Lucke
d954c48d02 Fix #144175: assert when adding texture paint slot
Better type safety would have prevented this..
2025-08-08 10:48:20 +02:00
Omar Emara
a252ebb531 Cleanup: Remove deprecated movie formats code
This patch removes code handling the now-deprecated movie formats.

Pull Request: https://projects.blender.org/blender/blender/pulls/144188
2025-08-08 10:28:19 +02:00
Jacques Lucke
e72e049c84 Nodes: remove experimental option for new socket shapes
This removes the experimental feature flag for the new socket shapes,
making them official. This only affects the UI and does not affect the evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/144119
2025-08-08 09:41:06 +02:00
Jacques Lucke
4a1020df6c Fix #143585: wrong structure type inferencing for lists
Mixing dynamic data with other data always results in dynamic now. While this
wasn't true without lists, it is true now and also makes sense generally. Also
mixing lists and single values or fields results in a list now.

Pull Request: https://projects.blender.org/blender/blender/pulls/144183
2025-08-08 09:07:20 +02:00
Lukas Tönne
18ec47361f Fix: UI: Node layout buttons not visible in material node view
Node buttons declared with `NodeDeclarationBuilder::add_default_layout`
are not visible in the `uiTemplateNodeView` used for shader nodes among
others. This happens in the Glass BSDF shader node.

The `ui_node_draw_node` was not handling node layout items in case the
node is using a custom socket order.

This was originally fixed in #143781 which was closed accidentally.

Pull Request: https://projects.blender.org/blender/blender/pulls/144159
2025-08-08 08:56:06 +02:00
Campbell Barton
062fcd00d1 Cleanup: improve confusing/incomplete code-comments 2025-08-08 16:41:38 +10:00
Falk David
1d6a0b7070 Cleanup: VSE: Replace STRIP_DUPE macros with enum
This removes the `STRIP_DUPE_UNIQUE_NAME` and `STRIP_DUPE_ALL` macros
and replaces them with an `enum StripDuplicate`.

A flag with a value of 0 was implicitly used as "duplicate selected strips" so the
enum uses `Selected = 0` to document this behavior better.

Pull Request: https://projects.blender.org/blender/blender/pulls/144125
2025-08-08 08:33:35 +02:00
Jeroen Bakker
97f1aeb84c Vulkan: Remove support for render passes
Vulkan 1.0 render passes have been replaced by dynamic rendering in 1.2.
Blender Vulkan backend was implemented with dynamic rendering in mind.
All our supported platforms support dynamic rendering. Render pass support
was added to try to work around an issue with legacy drivers. However these
drivers also fail with render passes.

Using render passes had several limitations (blending and some workbench
features were not supported).  As no GPU uses it and it is quite some code
to support it is better to remove it.

Pull Request: https://projects.blender.org/blender/blender/pulls/144149
2025-08-08 08:08:58 +02:00
Campbell Barton
73afa1c94f UV: support island selection with sync-select in vertex/edge mode
This was disabled because island selection used to be exposed as a
UV selection mode (along with vertex/edge/face) where selecting
parts of other islands would seem like a bug.

Now island selection has been moved to a separate toggle it makes
sense to allow connected geometry to be included in the selection when
other selection options enforce this.
2025-08-08 05:58:04 +00:00
Campbell Barton
1b618461f3 Correct error in 359599a16b
Passing false for "update" was needed to remove the redundant update.
2025-08-08 13:47:13 +10:00
Campbell Barton
359599a16b Modeling: avoid redundant update call for bevel when auto-merge is used 2025-08-08 13:43:54 +10:00
Eitan Traurig
a584197ab3 Modeling: Support "Auto Merge" for the bevel operator
The bevel operator can leave overlapping vertices.
Support "Auto Merge" so these are cleaned when the tool-setting is
enabled.

Ref !142008
2025-08-08 03:11:56 +00:00
Campbell Barton
a27b309009 Modeling: add "Connected" support for auto-merge
Support limiting the merge by connected geometry.
This is useful for operations such as bevel where it's not desirable
for the merge to connect isolated surfaces.

Accessible from the Python API, no user visible changes.

Ref !144036
2025-08-08 13:04:42 +10:00
Campbell Barton
28e9e87786 PyDoc: add missing arguments to bpy.app.handlers 2025-08-08 08:47:41 +10:00
Campbell Barton
53cae68ee8 Cleanup: hyphenate the term data-blocks in strings/doc-strings 2025-08-08 08:47:13 +10:00
Campbell Barton
cccc2c77c5 Cleanup: consistent for C-style comment blocks 2025-08-08 07:37:33 +10:00
Campbell Barton
86dcdb418d Cleanup: use doxy sections for resources 2025-08-08 07:37:00 +10:00
Campbell Barton
ff10f7803e Cleanup: correct comment 2025-08-08 07:36:32 +10:00
Campbell Barton
0b091db913 RNA: require the enum flag is set before enum items are set
Failure to do this can cause the the property default to be incorrect
and some sanity checks fail to run.

Fail when an error if this isn't set.

Ref !144133
2025-08-07 20:45:45 +00:00
Hans Goudey
02181347ce Geometry Nodes: Change closure color, reset repeat zone color
Follow up to f646948ace
The repeat zone color is changed back to the color it used in 4.5, to
avoid the need for people to re-learn the color. The closure socket and
zone share the same color, which is made more yellow-ish to distinguish
it from the bundle socket color.
2025-08-07 15:27:02 -04:00
Jesse Yurkovich
2822b3badf Fix: USD: Use exr instead of hdr for world light texture
The spec for .usdz permits only a small handful of file formats to be
contained in the archive, and HDR is not among those supported[1]. This
also causes validation errors with the `usdchecker` tool (will be
properly tested in a follow up change).

Ignoring the potential for a user to export a .usdz file with materials
referencing unsupported file formats, Blender itself should use only
the supported formats for its business.

[1] https://openusd.org/release/spec_usdz.html#usdz-specification

Pull Request: https://projects.blender.org/blender/blender/pulls/144101
2025-08-07 20:54:22 +02:00
Ray Molenkamp
8bf975325b bf_imbuf_movie: Fix warnings building with MSVC 2019
in 236b6513cf which was supposed to
remove warnings, 6 new warnings were added, this fixes those warns

See PR #144164 for exact details

Pull Request: https://projects.blender.org/blender/blender/pulls/144164
2025-08-07 20:29:57 +02:00
Habib Gahbiche
6d129290a7 Nodes: Use frame with label for versioning Use Nodes (World)
Ref: #143441

Add label to indicate that the new nodes were added for versioning:

Pull Request: https://projects.blender.org/blender/blender/pulls/144083
2025-08-07 20:08:25 +02:00
Miguel Pozo
908fd7ab57 Fix: EEVEE: VolumeProbeModule do_full_update_
`VolumeProbeModule::do_full_update_` can be true while
`irradiance_pool_size_` being already correct and `irradiance_atlas_tx_`
being valid, so `brick_pool_` ends up being "allocated" with
`atlas_col/row_count` being 0.
This can happen if `VolumeProbeModule::init` is called, but the
`VolumeProbeModule::set_view` call is skipped (due to ongoing shader
compilation), so the `do_full_update_` flag is not cleared before the
next `init`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144154
2025-08-07 19:37:09 +02:00
Miguel Pozo
7263d19c1e Fix #142046: EEVEE: Deferred Lighting shader doesn't run (Nvidia)
The issue in #142046 is caused by the deferred lighting pass not
running.
Despite plenty of testing and debugging we have not been able to spot
any errors in the Blender code.
Checking the link status of specialization shader variants seems to fix
the issue, which may suggest a bug on the driver side.

Pull Request: https://projects.blender.org/blender/blender/pulls/144150
2025-08-07 19:36:06 +02:00
Hans Goudey
45f3180bc8 Fix #143539: Assert in UI auto complete after StringRef refactor
Caused by d216476458
2025-08-07 12:57:33 -04:00
Hans Goudey
5925233e4d Fix #143847: Assert in attribute operator poll after refactor
Mistake in fa03c53d4a.
We need to test for negative indices here too.
2025-08-07 12:38:27 -04:00
Jacques Lucke
3f94a4ab1c Animation: minor speedup when accessing id properties
This is fundamentally quadratic code until #140907 is implemented. However, the
old approach that didn't use `StringRef` was a few percent faster because it
didn't have to call `strlen` as often. So this brings back a little bit of
performance in cases like #140706.

Pull Request: https://projects.blender.org/blender/blender/pulls/144012
2025-08-07 16:38:04 +02:00
Maxime-Cots
7f8d01f809 UI: "Delete Other Workspaces" operator
Adds a context menu entry to delete all workspaces but the one the menu
was spawned from.

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/138530
2025-08-07 16:07:05 +02:00
Christoph Lendenfeld
a43359eb88 Anim: Store pose bone visibility flag on pose bone
This PR adds a flag to the pose bone that determines its visibility.
Doing so allows to hide a pose bone and
* don't affect other instances of the same armature
* save the visibility even if the rig is linked

The visibility of the bone in object mode is now also determined by the
pose bone whereas before it was the `Bone`.

**This breaks backwards compatibility** on the Python API since the visibility property,
on the `Bone` behaves differently now as it hides the edit bone instead of the pose bone.

In order to remove all active uses of `BONE_HIDDEN_P` the changes in `armature_skinning.cc` are required.

Part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/139167
2025-08-07 15:54:58 +02:00
YimingWu
6f57268e9a LineArt: Use "Radius" instead of "Thickness" for generating strokes
Previously line art uses the same thickness value as found in grease
pencil before blender v4.3 for generating strokes, now everything is
migrated to using "radius", so it makes more sense to change that it to
using "radius" so it's consistent with everywhere else.

Pull Request: https://projects.blender.org/blender/blender/pulls/144121
2025-08-07 15:40:17 +02:00