Commit Graph

121856 Commits

Author SHA1 Message Date
John Kiril Swenson
b4815957ab Fix: VSE: Strip label jumping when resizing vertically
Make sure `mask_size` is calculated correctly in
`UI_view2d_view_to_region_rcti_clip` since the rcti is inclusive and the
size functions do not take this into consideration. This function is
only used from NLA and VSE drawing code.
2025-07-25 14:09:41 -05:00
Miguel Pozo
33d9e00f4a Fix #142738, #136688: Workbench: Inconsistent matcap rendering
Use `bool32_t` to work around C++/GLSL bool differences.

Pull Request: https://projects.blender.org/blender/blender/pulls/143233
2025-07-25 19:45:28 +02:00
Guillermo Venegas
52403b686f UI: Move block layout methods to namespace
Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/143232
2025-07-25 19:33:15 +02:00
Sergey Sharybin
dcae48d1d3 Cycles: Add Portal Depth light pass information
It allows to implement tricks based on a knowledge whether the path
ever cam through a portal or not, and even something more advanced
based on the number of portals.

The main current objective is for strokes shading: stroke shader
uses Ray Portal BSDF to place ray to the center of the stroke and
point it in the direction of the surface it is generated for. This
gives stroke a single color which matches shading of the original
object. For this usecase to work the ray bounced from the original
surface should ignore the strokes, which is now possible by using
Portal Depth input and mixing with the Transparent BSDF. It also
helps to make shading look better when there are multiple stroke
layers.

A solution of using portal depth is chosen over a single flag due
to various factors:
- Last time we've looked into it it was a bit tricky to implement
	as a flag due to us running out of bits.
- It feels to be more flexible solution, even though it is a bit
	hard to come up with 100% compelling setup for it.
- It needs to be slightly different from the current "Is Foo"
	flags, and be more "Is Portal Descendant" or something.

An extra uint16 is added to the state to count the portal depth,
but it is only allocated for scenes that use Ray Portal BSDF.

Portal BSDF still increments Transparent bounce, as it is required
to have some "limiting" factor so that ray does not get infinitely
move to different place of the scene.

Ref #125213

Pull Request: https://projects.blender.org/blender/blender/pulls/143107
2025-07-25 18:09:38 +02:00
Harley Acheson
efe14ff166 UI: Fix VSE Channel Label Jiggling
In the video below you will see how VSE labels can jiggle vertically
while the area is resized. This is caused by the incorrect calculation
of rect height in UI_view2d_view_to_region_y. Our BLI_rcti_size_y does
not return the correct size, but max-min, which one unit too small for
our inclusive integer rects like v2d->mask or region->winrct. This PR
corrects the calculation in UI_view2d_region_to_view_y, and also in
UI_view2d_region_to_view_x because these are so similar.

Pull Request: https://projects.blender.org/blender/blender/pulls/143095
2025-07-25 18:09:02 +02:00
Omar Emara
2582630702 Refactor: Use Bounds for compositing region
This patch uses the new C++ Bounds structure for the composition region
returned by the compositor context.

Pull Request: https://projects.blender.org/blender/blender/pulls/143199
2025-07-25 15:40:45 +02:00
Hans Goudey
8b883a3922 Fix #143142: Displace modifier Custom Normal direction broken
Caused by cf6ee877a0
2025-07-25 09:27:57 -04:00
Brecht Van Lommel
ae5152866e Fix #142724: Mesh used by boolean modifier missing subdivision in edit mode
The code path for non-editmesh has ensure subdivision in it, the editmesh one
was missing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/143135
2025-07-25 15:03:45 +02:00
Omar Emara
8cb7aafae2 Refactor: Use generic name for compositor context IO methods
This patch renames some IO methods in the compositor context to be more
generic. This is in preparation for more generic use of the compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/143193
2025-07-25 14:40:17 +02:00
Pratik Borhade
df75d3e664 Fix: Delete basis removes all shape key
Caused by 29b90af679
When deleting the first/basis shape key, all successive keys are
deleted. `shapenr` remains 1 during entire iteration and `BLI_findindex`
returns 1 for every keyblock as first element is deleted. This
eventually clears the entire list. To fix this, change `shapenr` value to 0
when deleting the first element.

Pull Request: https://projects.blender.org/blender/blender/pulls/142946
2025-07-25 12:49:05 +02:00
Pratik Borhade
832fc7af2a Fix #142982: Grease Pencil: Assert when overriding keyframes in dopesheet
Assert when overlapping keys are removed. This is due to drawing count
mismatch, more specifically when drawing is not removed/overwritten but
early check validation caused it. Remove `validate_drawing_user_counts`
from `remove_drawings_with_no_users`. If Drawing is actually removed
(`drawings_to_remove` non empty), validation function will be called at
the end.

Pull Request: https://projects.blender.org/blender/blender/pulls/143057
2025-07-25 12:47:19 +02:00
Sybren A. Stüvel
edc4136c79 Cleanup: fix compiler warning about memset on C++ type
Instead of zeroing out a C++ wrapper for a DNA struct, zero out just the
DNA struct itself.

The C++ wrapper adds no extra fields, and also no virtual functions, so
the old code was already safe. Now it's also semantically correct :)

No functional changes.

Reviewed by Omar, by locally applying my diff.

Pull Request: https://projects.blender.org/blender/blender/pulls/143184
2025-07-25 12:36:05 +02:00
W_Cloud
d15750a059 Geometry Nodes: add inline socket for missing nodes
Add missing inline socket for Set Spline Type,Join Strings,Pack UV Islands and Vector Rotate.

Pull Request: https://projects.blender.org/blender/blender/pulls/142299
2025-07-25 12:27:44 +02:00
Habib Gahbiche
c7421e197a Fix #143156: "RGB to BW" node not found in link drag search
The node is stil specific to the compositor and is not shared with its
Shader counterpart yet, so `ntype.gather_link_search_ops;` should not
be `nullptr`.

Pull Request: https://projects.blender.org/blender/blender/pulls/143174
2025-07-25 12:25:18 +02:00
Jacques Lucke
a5877c5704 Fix: Nodes: use correct structure types in switch nodes
Generally, switch nodes can work on any kind of data. Some additional restrictions
apply though because some types are only allowed to be single values.

Pull Request: https://projects.blender.org/blender/blender/pulls/143163
2025-07-25 12:22:04 +02:00
Pratik Borhade
b4a0cf398e Fix #139183: Stuck in Draw Mode after converting Grease Pencil to Mesh
`OBJECT_OT_convert` can be called outside of object mode from F3 search
menu. This fails/crashes for some conversions. To avoid running into
such situation, edit poll function so that operator is only available in
object mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/139261
2025-07-25 12:10:11 +02:00
Omar Emara
92d5c2078e Render: Add Media Type option
This patch adds a new Media Type option to image format settings, which
is used in the Render Output panel, File Output node, and Image Saving
operation. The option does not provide any new functionality, but
improves the UX of selecting file types by categorizing the existing file
type option into:

- Image.
- Multi-Layer EXR.
- Video.

Each option would then list only the file types that fit that media
type. For Multi-Layer and Video, the file type option is no longer drawn
for now since only one option exist for now, OpenEXR Multi-Layer and
FFMPEG respectively. This also improves the experience by not listing
technical terms like FFMPEG in the UI, but rather use "Video" instead.

The original motivation for introducing this option is the recent
redesign of the File Output node. The problem is that the distinction
between images and multi-layers images is not at all clear, while the
behavior of the node changes quite a bit when multi-layer is chosen.
While now with the new option, the distinction is quite clear.

Implementation-wise, the new option is mostly a UI layer that controls
the available enum items for the file format and callbacks to set a
default format if the existing format doesn't match the media type.
However, core code is unaffected and still transparently reads the image
format only.

Pull Request: https://projects.blender.org/blender/blender/pulls/142955
2025-07-25 11:15:28 +02:00
Mohamed Hassan
c1f52b8e91 Compositor: Improve Fog Glow glare realism
This patch improves the realism of the Fog Glow mode of the Glare node
based on the Photopic model described in:

  Physically-Based Glare Effects for Digital Images" by G. Spencer, P.
  Shirley, K. Zimmerman, and D. P. Greenberg.

This is a breaking change that can't be versioned, but it is worth it
for the superior realism of the new model.

Pull Request: https://projects.blender.org/blender/blender/pulls/140646
2025-07-25 10:09:32 +02:00
tariqsulley
f4b5cbd31b Fix #135908: Extrude Individual Faces "Offset Even" does nothing
Logically a NOP for individual faces, hide the property.

Ref !136275
2025-07-25 16:43:01 +10:00
tariqsulley
9dae336482 Fix #140548: Shift to extend fails in the "Hide Other Collection" menu
Use the invoke operator context so the event is passed to the operator.

Ref !141817
2025-07-25 16:32:49 +10:00
YimingWu
2def8c8b67 Fix #120885: Ensure EXR view_format selection in stereo
When stereoscopy is enabled, OpenEXR and OpenEXR Multilayer supports
different stereoscopy view format, ensure the view format selection
when selecting the output file format, so the value is always valid
when saving the image.

Pull Request: https://projects.blender.org/blender/blender/pulls/120904
2025-07-25 08:26:31 +02:00
Mohamed Hassan
2927388682 Compositor: Add Glare Sun Beams gizmos
Add gizmo for the Sun Beams mode in the Glare node.

Pull Request: https://projects.blender.org/blender/blender/pulls/142685
2025-07-25 08:05:08 +02:00
Campbell Barton
19b59ccaab Fix #143161: Armature select crashes with over 65k objects
Add null check to resolve crash when a "base" can't be retrieved
from the GPU selection index.
2025-07-25 15:58:32 +10:00
Omar Emara
b92b47f628 Refactor: Reduce compositor context pure virtual methods
The compositor context has a number of pure virtual methods that could
be optional or removed altogether, so this patch refactors that by
reducing unnecessary pure virtual methods.

Pull Request: https://projects.blender.org/blender/blender/pulls/143091
2025-07-25 07:50:52 +02:00
Aaron Carlisle
3e63312823 UI: Rename "HDRI Preview Size" to "Reference Spheres Size"
This is a follow up to 8404228aeb
2025-07-24 20:48:03 -04:00
John Kiril Swenson
8c744aa1d5 Fix: VSE: Cannot ignore connected strips' handles with alt if already selected
PR #139075 introduced a regression where holding alt to move strip
handles without other connected strips would not work if the handle was
already selected. Fix by only copying handles to selected strips if alt
is not held.

This also builds on #142916, using `find_neighboring_strip` to simplify
logic and consider other cases too. We now avoid copying handles if it
would interfere with *any* dual handle point, not just those present in
the selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/143149
2025-07-25 02:36:57 +02:00
Harley Acheson
89e5129741 UI: Changes to the Platform Support Warning Message
Some small tweaks to the messagebox shown when users have graphics
hardware or driver that might not work.  The phrase "Your graphics card
or driver has limited support" changed to "Your graphics card or driver
version has limited support" to better indicate the driver has
versioning. "Newer graphics drivers may be available to improve Blender
support." changed to "Newer graphics drivers might be available with
better Blender compatibility." The message saying "Blender will now
close" only shown if Blender will close.

Pull Request: https://projects.blender.org/blender/blender/pulls/142999
2025-07-24 22:44:08 +02:00
Sean Kim
7bab7155ad Fix #142151: Scrape brush 'Plane Offset' not versioned correctly
The general Plane brush is a replacement for the Flatten, Fill, and
Scrape brushes that formerly existed. When the old brush types were
converted to the new type, the 'Plane Offset' usecase was missed due to
the field not being used for the bundled essential brushes.

To preserve brush behavior across 4.4 and 4.5, Scrape brushes with a
given 'Plane Offset' need to have this signed distance inverted.

Unfortunately, as this was discovered after 4.5 was officially released,
and the versioning having no clear indicators that can be used to fix
this with a subsequent version bump, this commit cannot address users
who have already started using 4.5. The best we can do in this case is
fix the incorrect versioning and make a note of the issue in the release
notes so that future users will not continue to experience this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/143020
2025-07-24 21:59:38 +02:00
Sean Kim
ab09dec8fb Fix #142186: Mask Filter smoothing produces artifacts
When we perform the Smooth operation in the Mask filter, we have
historically only applied a raw average of the neighbor values. This can
lead to artifacts in the mesh due to the topology of the affected
vertices.

To ensure a smoother transition at the boundary of the mask, this commit
applies a linear blending between the old and new values.

Pull Request: https://projects.blender.org/blender/blender/pulls/142793
2025-07-24 21:56:25 +02:00
Aras Pranckevicius
bedf19f1ca Cleanup: No longer require VSE Strip struct memory layout to never change
Previously code that was reading Strip data assumed that seqbasep
and channels members would stay at fixed offsets within a struct,
forever into the future. Fix this by inferring their offsets from
the file SDNA data where needed.

Actual Strip DNA layout is not changed in this commit yet.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/142940
2025-07-24 20:37:16 +02:00
Harley Acheson
d6573097eb UI: ARM Win GL Qualcomm driver Error Message Change
When using GPU_DEVICE_QUALCOMM video drivers on Win32 with OpenGL (just
ARM) if the driver is too old a console message says that the driver is
not capable of running "Blender 4.0". This PR just adds "or later".

Pull Request: https://projects.blender.org/blender/blender/pulls/143108
2025-07-24 20:26:26 +02:00
John Kiril Swenson
28ff392b19 Fix: VSE: Copy to selected would interfere with dual handles
After #139075, since dual handle translation always selects two strips
at a time, any later handle movement on one of the strips would affect
both, which is unintuitive and likely not what the user intended.

We can fix this for now by checking for strips that directly border one
another and removing them from the `copy_to` list.

But in the future, if we change selection logic so that strip and handle
selection states are mutually incompatible, we could also fix this by
making sure that dual handle tweaking only selects the handles and not
the strips themselves.

Pull Request: https://projects.blender.org/blender/blender/pulls/142916
2025-07-24 20:12:03 +02:00
Clément Foucault
1611dc2fb3 GPU: Rever mass renaming removing GPUTexture type from python
This was accidentaly commited in 32d64d35bb
2025-07-24 18:19:59 +02:00
Sean Kim
97a5e2ea1b Fix #142963: Crash when using Texture Paint sample color
Introduced in d0b749beb8

Pull Request: https://projects.blender.org/blender/blender/pulls/143015
2025-07-24 16:35:05 +02:00
Germano Cavalcante
cb51fc5471 Fix #141741: Combed particles are affected by occlusion of other particles
Caused by 7688677e29, which replaced `DRW_draw_depth_object` with
`DRW_draw_depth_loop`.

`DRW_draw_depth_object` simply rendered the object without actually
using the DRW manager capabilities.

Now, with `DRW_draw_depth_loop`, the depth is rendered based on what
the engine sees with overlays disabled, which doesn't hide the
particles.

The solution to this issue is to skip particle rendering in the overlay
engine in `DRW_draw_depth_loop`.

Co-authored-by: Miguel Pozo <pragma37@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141981
2025-07-24 16:24:19 +02:00
Hans Goudey
4f372d64d4 Geometry Nodes: Initial very basic list support
This includes a new list structure type and socket shape, a node
to create lists, a node to retrieve values from lists, and a node to
retrieve the length of lists. It also implements multi-function support
so that function nodes work on lists.

There are three nodes included in this PR.
- **List** Creates a list of elements with a given size. The values
  are computed with a field that can use the index as an input.
- **Get List Item** A field node that retrieves an element from a
  a list at a given index. The index input is dynamic, so if the input
  is a list, the output will be a list too.
- **List Length** Just gives the length of a list.

When a function node is used with multiple list inputs, the shorter
lists are repeated to extend it to the length of the longest.

The list nodes and structure type are hidden behind an experimental
feature until we can be sure they're useful for an actual use case.

Pull Request: https://projects.blender.org/blender/blender/pulls/140679
2025-07-24 16:16:40 +02:00
Brecht Van Lommel
ba46217b51 Fix: GPU shader error logging doesn't show shader name or stage
This was relying on the souce file and line printing which is now disabled
by default. Also log the shader source without indent for readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/142882
2025-07-24 16:10:19 +02:00
Hans Goudey
9c9695b103 Refactor: Move ReportList definition from DNA to blenkernel
Ever since [0], ReportList is not actually used in any DNA structs.
That makes sense, since reports are conceptually only necessary
at runtime. Move the definition of the struct to BKE_report.hh, and
fix a bunch of include errors where types were previously available
transitively. Besides adding some clarity, theoretically this change
could reduce compile times because of less header parsing.

[0]: 1bf6d8b0b9

Pull Request: https://projects.blender.org/blender/blender/pulls/138872
2025-07-24 15:59:52 +02:00
Hans Goudey
623d3c04e2 Fix: Set Mesh Normal "Tangent" mode fails with free normals
If free normals already exist, the `custom_normal` attribute already
exists with a different type, so the attribute writer is not created
properly in `mesh_set_custom_normals` and the process fails. Instead,
setting tangent space custom normals should clear existing free normals.

Pull Request: https://projects.blender.org/blender/blender/pulls/142961
2025-07-24 15:50:40 +02:00
Campbell Barton
9a6d95600d Cleanup: use define for action group name size 2025-07-24 22:18:15 +10:00
Campbell Barton
9b05a00b50 Cleanup: use UTF8 string copy for bActionGroup::name
Avoid potential incomplete UTF8 byte sequences.
2025-07-24 22:18:15 +10:00
Campbell Barton
bc69b25382 Cleanup: use UNLIKELY(..) for integer overflow checks 2025-07-24 22:18:15 +10:00
Campbell Barton
21d431d214 Cleanup: minor clarifications for View2D struct members
Avoid including multiple members in one doc-string.
2025-07-24 22:18:14 +10:00
Clément Foucault
475b20fc5d Refactor: GPU: Use macros for TextureFormat conversions
This reduces the risk of errors and code duplication.

Rel #130632

Pull Request: https://projects.blender.org/blender/blender/pulls/142898
2025-07-24 13:56:41 +02:00
Jesse Yurkovich
e739f99468 Fix #110334: int overflow in rna_iterator_array_begin
The calculation for `endptr` would overflow when multiplying `length`
and `itemsize`. A similar issue was spotted for `rna_array_lookup_int`.

Ref !141061
2025-07-24 21:46:14 +10:00
Omar Emara
e34e6373b6 Compositor: Replace Composite node with Group Output node
This patch replaces the Composite node with the Group Output node as the
primary compositor output. The old node was removed and versioned. This
was done for consistency with Geometry Nodes and in preparation for more
generic use of the compositor in VSE modifiers, layered compositing, NPR
multi-stage compositing, and more.

The Group Output node relies on the node tree interface, so we now have
a default interface of a single input and a single output. For now, only
the first input is considered while the rest are ignored, just like the
Geometry Nodes design. Furthermore, the input is required to be of type
color. Warnings and errors are issues if any of those are not met, also
similar to Geometry Nodes.

This introduces a new limitation: Composite outputs can no longer exist
in node groups, since they obviously then act as their respective group
outputs.

A refactor for the compositor scheduler is needed to simplify the logic
after this change, but this will be done in a separate patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/142232
2025-07-24 13:41:56 +02:00
Jonas Holzman
d95c2bc406 GHOST: Rename Metal Context from ContextCGL to ContextMTL
This commit renames the GHOST Metal graphic context class and related
files / references from `GHOST_ContextCGL` to `GHOST_ContextMTL`. When
the Metal backend was first introduced, this context file contained
both the old OpenGL context (CGL, for macOS Core OpenGL API), and the
newer Metal context. Since #110185 all CGL related code was removed
from the class, making it Metal only, and thus rendering the old class
name outdated and potentially misleading. In addition to the rename,
unused OpenGL related forward declarations and old TODOs were also
removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/142519
2025-07-24 13:28:44 +02:00
Omar Emara
dffb8366e0 Fix #142954: Crash when opening file with undefined Translate node
Blender crashes when opening a file with undefined Translate nodes due
to a missing storage. The crash happens during versioning, as the nodes
are not yet undefined at this point. To fix this, we make the versioning
code more corruption proof and skip versioning nodes with no storage.

Pull Request: https://projects.blender.org/blender/blender/pulls/143055
2025-07-24 12:53:55 +02:00
Clément Foucault
b6076e4d80 GPU: Add procedural drawcall in gpu::Batch
This allows to store a number of vertex to draw
per batch without specifying any attribute.

This allows to create batches that are empty but
still holds the amount of geometry to produce.

Needed for new curve drawing #142969.

Pull Request: https://projects.blender.org/blender/blender/pulls/143052
2025-07-24 12:27:10 +02:00
Christoph Lendenfeld
614b6508d4 Anim: Add copy to selected for shapekeys
This adds copy to selected support for Shape Keys.
That means Alt+drag on a property influences all selected.
Also the copy to selected operator is now available in the context menu.

Part of #136838

Pull Request: https://projects.blender.org/blender/blender/pulls/138611
2025-07-24 12:20:10 +02:00