Commit Graph

122246 Commits

Author SHA1 Message Date
Jacques Lucke
6dca66d606 Fix: Instances: ensure unique instance ids
The previous code to get unique instance ids did not actually ensure 100%
uniqueness. Now the code does and hence the "almost" from the name is removed.
In practice, this change likely does not have any impact because the fallback
case is very unlikely to be reached.

Pull Request: https://projects.blender.org/blender/blender/pulls/144324
2025-08-11 10:03:59 +02:00
Jacques Lucke
eb73729e67 Fix #144314: crash when syncing sockets with recursive closures
The fix is to detect when the compute context is recursive and to stop the
search early in that case. Currently, this does not generate a warning. There
will be a warning when trying to evaluate the recursive closure though.

Pull Request: https://projects.blender.org/blender/blender/pulls/144330
2025-08-11 10:03:21 +02:00
Jacques Lucke
f6ee7e13b2 Fix: Geometry Nodes: wrong data-block default values
This was missing from #144199.
2025-08-11 09:49:10 +02:00
Clément Foucault
9fbf7e9ec2 GPU: Remove wrapper type for gpu::UniformBuf
This is the first step into merging `DRW_gpu_wrapper.hh` into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/144328
2025-08-11 09:46:45 +02:00
Clément Foucault
1388a70914 GPU: Remove wrapper type for gpu::Shader
This is the first step into merging DRW_gpu_wrapper.hh into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/144229
2025-08-11 09:34:28 +02:00
Jeroen Bakker
06b32f6c1d Vulkan: Add assert to check valid API usage
Related to #143691.
2025-08-11 09:08:04 +02:00
Jacques Lucke
b37fa3f7db Cleanup: remove duplicate assignment 2025-08-11 08:57:56 +02:00
Jacques Lucke
c8507ed375 Refactor: Geometry Nodes: use SocketValueVariant for data-block types
Use `SocketValueVariant` for all the data-block types as well. Before it was
used for e.g. float, integer and menu sockets.

The only remaining type afterwards is the geometry socket which will be moved
separately.

Using `SocketValueVariant` for all socket types will simplify code later on and
also removes the need for dealing with raw memory in more cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/144199
2025-08-11 08:53:47 +02:00
Jacques Lucke
785a915321 Fix: Geometry Nodes: keep materials on geometries in bundles in simulation/bake
Previously, materials were lost on geometries in bundles.

Pull Request: https://projects.blender.org/blender/blender/pulls/144320
2025-08-11 08:03:43 +02:00
Jacques Lucke
496eb15f21 Fix: Geometry Nodes: fix using constexpr if
MSVC needs the `else` to avoid compiling the rest of the function if it can't be reached.

This is merged from #143171.
2025-08-11 07:42:58 +02:00
Hans Goudey
e0170883d4 Fix #144126: Set Selection node can still fail with incorrect domain
I'm not sure why the edge domain was handled differently than the other
domains with regards to attributes on unexpected domains. Now use a
simpler more consistent solution that removes invalid selection
attributes before they're used at all.
2025-08-10 09:11:36 -04:00
Hans Goudey
12f4b98258 Fix #144272: Render slot list broken
Use a callback function for the button instead of `hardmin` which was
used before ecd8de4bea.
2025-08-10 08:56:48 -04:00
Campbell Barton
ce3998ffea Refactor: simplify "_bpy_types" initialization internals
- Store the `_bpy_types` dictionary on startup instead of
  importing and setting on demand.

- Remove duplicate `_bpy_types` import.
2025-08-10 03:48:48 +00:00
Campbell Barton
eb2cc80cd0 PyAPI: move bpy_types.py to a private module
Use an underscore prefix as this module should not be accessed directly.
2025-08-10 13:45:40 +10:00
Campbell Barton
be0a16cacf Docs: add note that smooth-view may set the viewport "dist" to zero 2025-08-10 11:32:17 +10:00
Aras Pranckevicius
1cf265988b Fix #144254: VSE proxies for image sequences do not work
Broken with new 4.5 cache implementation; the loop for building
image sequence proxies was not flushing the intra-frame cache
between frame changes. This affects image proxies since they go
through the whole VSE render stack; does not affect video proxies
since they just manually decode the file frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/144269
2025-08-09 21:27:10 +02:00
Harley Acheson
91ebf29877 UI: Optionally Indicate Region Overflow
This PR adds a region flag to specify that it should indicate, with a
line or gradient, that content overflows any edge. This then enables
this for the Properties area and categories, Outliner, Spreadsheet,
File Browser main area, Asset Browser, Preferences, 3D View Sidebar and
Toolbar. And for headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/144091
2025-08-09 19:15:21 +02:00
Hans Goudey
993a85047b Fix: Revert part of previous fix breaking curves tests
The change changes the way the converted curves are evaluated.
It may be better and a valid choice, but it needs to be considered
more carefully since it would be a breaking change.
2025-08-09 11:40:24 -04:00
Laurynas Duburas
88241bc51e Fix: Curves: Various fixes for poly curves
Hides Resolution field in "Curve Data" panel if at least one poly curve
is selected. For these curves, the field is ignored. Moreover its value
is `0` for them, for all other curve types minimum is `1`.

Also conversion of `CURVE_TYPE_POLY` to `CURVE_TYPE_NURBS` is fixed to
emit curves of order 2. This gives same shape as input had. Resolution
is set to `1`, because "Curve to Mesh" node ignores curves with
Resolution `0`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144239
2025-08-09 16:33:17 +02:00
Campbell Barton
510b51391f Modeling: support maintaining the active object when pasting
Maintain the active object for the 3D viewports clipboard.
This avoids the need to activate the object after pasting to edit
its materials or change modes.

Matches the behavior for notes (see !143832) and addresses #143833.

Ref !144192
2025-08-09 21:50:22 +10:00
Casey Bianco-Davis
eb651bb243 Fix #143534: Grease Pencil: Grid snapping problem with bezier points or proportional editing
When the median was being calculated, the division was by the total number of transform data, rather than the selected number of transform data.
Under most circumstances this would be the same, but when transforming bezier control points without the handles selected, or when having proportional editing on. This the median calculation would return a wrong result.

Note: This problem could occur almost every object type not just Grease Pencil.

Resolves: #143534

Pull Request: https://projects.blender.org/blender/blender/pulls/144245
2025-08-09 12:28:34 +02:00
Nika Kutsniashvili
a459556ebd UI: Theme: Move more animation properties in common
Next step of #140360, continuing after 39c066ee53
Moves more animation theme properties shared by different editors to the new Common panel.

- Playhead (was shared by 7 editors)
- Marker Line (was shared by 5 editors)
- Marker Line Selected (was shared by 5 editors)
- Channel (was shared by 3 editors)
- Sub-channel (was shared by 3 editors)
- Channel Group (was shared by 2 editors)
- Active Channel Group (was shared by 2 editors)

In total, 27 properties are replaced with 7.

---

User Visible Changes:
- "Current Frame" is renamed to "Playhead". It was general sentiment among
Anim and UI modules to rename this everywhere after "Playhead Snapping" was
added, and this is first step towards that. Name is more recognizable and it's
clear it refers to UI element, rather than something as generic as "current frame".

- Channel, Sub-channel, Channel Group, and Active Channel Group colors in
Dope Sheet had alpha, but ones in Graph and NLA editors didn't. New common
property is used for all three of them and has alpha, meaning two editors gain
alpha as well, but they don't use alpha, still only Dope Sheet does.

- Channel and Sub-channel had different color in NLA and didn't match Dope Sheet
and Graph Editor, now since it's shared it has same color, which is a visual change
(slighlty lighter blue).

Pull Request: https://projects.blender.org/blender/blender/pulls/144060
2025-08-09 09:04:53 +02:00
Jesse Yurkovich
43850d3223 Fix #144221: Use Depth instead of Z in grease pencil render pass warning
Pull Request: https://projects.blender.org/blender/blender/pulls/144230
2025-08-08 20:26:21 +02:00
John Kiril Swenson
7cc4fa633e Fix: Assert when opening movie clip (debug build)
Similar to the fix in 6dbcc84cc0, ensure that this RNA pointer is marked
with "no refcount."

Pull Request: https://projects.blender.org/blender/blender/pulls/144180
2025-08-08 18:57:45 +02:00
Falk David
0b73ceb0e7 Fix: Grease Pencil: Remove fill guides skips locked layers
The remove fill guide operator should remove all fill guides, even if
the layers are locked to ensure the attributes get removed.
2025-08-08 18:52:37 +02:00
Sergey Sharybin
cc6a6fe893 Fix #143474: Color Space inconsistent between 2D and 3D texture paint
The short description of the root of the problem is that 2D texture
paint properly handled non-color paint while 3D painting did not (for
both painting and color sampling).

This change makes it so 3D texture paint avoids color space conversion
of brush color (which is assumed to be in display space) to scene linear
when painting on images set to Non-Color.

On the design level this change moves code closer to the following
design:
- Brush color is specified in display space.
- Float buffers are in scene linear space (or a non-color).
- When painting on color float buffers brush color gets linearized
- When painting on non-color float buffers brush color is used as-is.

For painting on non-color images it means: values from brush color
are used as-is, without any color space conversion.

The change makes 3D painting behave the same as 2D painting.

There are a couple of tricky parts remaining. Relatively small thing
is that the color displayed on the brush color swatch is not what it
will be after making a stroke. This is because brush colors are used
as-is, image is not color managed (and is drawn as-is on a surface
which is assumed to be in scene linear), and the brush color swatch
is color managed. Generally it means the swatch color is darker than
what the stroke on non-color image would look like.

The bigger topic is color sampling that read pixel value from frame
buffer. This change makes it so sampling color in such cases (by either
using eyedropper from the color swatch popup, or by using Shift-X
sampling operator outside of painting object/texture) will set brush
color in a way that making stroke will result in the same color as it
was on the screen. When painting on non-color images it means the
brush color will be sampled darker than when painting on a color
textures.

This introduces some context dependency to the way how sampling works
which might be undesirable.

Pull Request: https://projects.blender.org/blender/blender/pulls/143642
2025-08-08 17:58:44 +02:00
Pratik Borhade
a55e0b9516 Fix: Avoid drag-drop above basis key
As mentioned in !141930, prevent shape key from dropping above the
basis, so it remains the first.

See video in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/143050
2025-08-08 17:44:18 +02:00
Clément Foucault
02503cd41a GPU: Shader Preprocess: Add support for guarded scope using return value
This removes one limitation of the guarded scopes that needed to
not have return statement. Now a dummy return statement is created.

See #139233 for original implementation.
2025-08-08 16:55:02 +02:00
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