Commit Graph

121840 Commits

Author SHA1 Message Date
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
Clément Foucault
50e876f21d EEVEE: Add correct volumetric support for point clouds
Since 4.5 the point clouds are out of experimental.

The drawing of pointcloud did not allow for correct volume
estimation as the shape are not rendered as closed objects
(i.e. the backfaces were not rendered).

This patch renders the backfaces for the volume occupancy
pass by rendering the pointcloud twice and flipping the
shape alignment matrix. This reverse the winding and
does a backface hit as it would do for a sphere primitive.

This solution even if not perfect avoids adding more
geometry in the Index Buffer. The geometry approach might
be preferable in the future if we find a way to render
the spheres without an IBO or with a JIT generated IBO.

Rel  #141490

Pull Request: https://projects.blender.org/blender/blender/pulls/142095
2025-07-24 12:05:29 +02:00
Clément Foucault
34e176d255 Fix #138191: EEVEE: Bump is incorrect with pixel size greater than 1x
This was caused by the hardware derivatives output being affected
by render resolution. Scaling them back to the full resolution
value fixes the issue.

This also fixes the Wireframe node that also relies on derivatives.

Pull Request: https://projects.blender.org/blender/blender/pulls/142101
2025-07-24 12:04:15 +02:00
Omar Emara
b0db491f24 Fix: Crash when versioning Translate node
Blender crashes when versioning the Translate node due to a nullptr
storage. This happens due to an inverted nullptr check.

Additionally, we remove redundant assignments from other versioning code
for safety.

Pull Request: https://projects.blender.org/blender/blender/pulls/143046
2025-07-24 11:56:07 +02:00
Philipp Oeser
c1df8404e7 Fix #142839: Asset Browser: Copy to Selected on MetaData broken
It was not taking into account actual selection in the asset browser
("selected_assets"), thus failing in bringing things over.
To resolve, add a case for `RNA_AssetMetaData` in
`UI_context_copy_to_selected_list`.
Since "selected_assets" will give us `AssetRepresentation`, we need to
remap to `AssetMetaData` to get this working.

Pull Request: https://projects.blender.org/blender/blender/pulls/142862
2025-07-24 11:32:16 +02:00
Jacques Lucke
70b956ba53 Fix: Nodes: memory leak in extra info tooltips
The issue was that the tooltip function arguments were sometimes allocated but
not freed. The solution is to handle the lifetime of the argument better. The
code now makes a copy of the argument when it's passed to a layout function. In
an idea world, one could just use something like `std::function` instead of
manual memory management, but the API does not support it yet.

This was caused by f3a1d8fad5.

Pull Request: https://projects.blender.org/blender/blender/pulls/143043
2025-07-24 10:35:47 +02:00
Brady Johnston
6f2988f0af Nodes: support interface items lookup by Identifier
Currently, the `NodeTreeInterface` only allows lookup via the item names, and not
their identifiers. This is problematic when there are multiple items with the
same name, they can only be selected via index and not name / identifier.

The following examples are done on a default Geometry Nodes tree that just has a
`Geometry` input and `Geometry` output.

Pull Request: https://projects.blender.org/blender/blender/pulls/140196
2025-07-24 10:25:35 +02:00
Jacques Lucke
6ca5c0fa92 Fix #142290: crash pasting linked ID in its source library
The core issue here seems to be that the pasted object is turned into an Empty
but it still has all the modifiers. Later when the object is copied by the
depsgraph, the modifiers are not copied along, confusing some code.

Right now, this patch is rather defensive, so it solves the specific crash and
maybe similar cases that could come up in the future. One could separately also
clear all modifiers when turning the object into an Empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/143029
2025-07-24 10:22:47 +02:00
Jacques Lucke
df625835c4 Fix #142202: missing anonymous attribute propagation when using some field nodes
Some fields were missing `for_each_field_input_recursive` implementations which
are required for anonymous attribute propagation to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/143031
2025-07-24 10:16:46 +02:00
Aras Pranckevicius
ea9b520a39 Fix: assert in image Luma vectorscope
Commit 9e221a10d3 made it so that IMM shader is unbound
while drawing a scope, and added assert to ensure it is unbound.
But it missed one place where waveform_draw_one is used, and did
not unbind the IMM shader around that.
2025-07-24 10:43:25 +03:00
Alaska
8a6d706d77 Utilities: Add batch files to help launch Blender with different GPU backends
With Vulkan now having general feature parity with OpenGL, but with
some stability issues, it has become more important to offer ways for
users to quickly launch Blender with the OpenGL or Vulkan backend
in case Blender is unable to open with one of them.

This commit adds three new batch files to help with this:
- `blender_factory_startup_vulkan.cmd`
  - Launches Blender with factory settings, but with Vulkan enabled.
    Useful for helping test if a Vulkan crash at startup is related to
    a addon.
- `blender_startup_opengl.cmd`
  - Simply launches Blender with the OpenGL backend. It does not change
    any other settings. Useful in case a user has complex user
    preferences, enabled Vulkan for testing, and now Blender crashes on
    startup. Now they want to switch back to OpenGL and they don't want
    to lose their complex user preferences by using
    `blender_factory_startup.cmd`
- `blender_startup_vulkan.cmd`
  - Simply launches Blender with the Vulkan backend. It does not change
    any other settings. Useful for people that encounter #127835 after
    a Windows update. This issue can be worked around by using Vulkan.
    But if you are experiencing the issue and are on the OpenGL
    backend, you can't use the Blender interface and so you can't
    easily switch to the Vulkan backend without the command line
    or a script like this.

Pull Request: https://projects.blender.org/blender/blender/pulls/142169
2025-07-24 09:15:52 +02:00
Aras Pranckevicius
71ad809bbe Fix #141095: VSE thumbnails drift horizontally when resizing the timeline vertically
Looks like almost everywhere else, the v2d mask size is calculated
as "v2d->mask size plus one". This is the zoom ratio that the V2D
resizing tries to keep constant, etc.

However the VSE timeline drawing code, when calculating the pixel
scaling factors, used the v2d->mask size without adding +1.
This resulted in a very slight zoom ratio change when resizing the
timeline area, which is made larger because thumbnails are often more
wide than narrow, and many of them are laid out next to each other.

Pull Request: https://projects.blender.org/blender/blender/pulls/142952
2025-07-24 08:52:44 +02:00
Aras Pranckevicius
09a47a9a88 Cleanup: remove manually-ran IMB_performance_test
The performance test was added in 6d93bf6b44, but I don't think
anyone has ever ran it since then. And due to how IMB library
depends on BKE, this drags in "almost all of blender" into the test
executable, resulting in non-trivial link times that everyone
pays for. Just remove it.
2025-07-24 09:51:00 +03:00
Jesse Yurkovich
cd6c338ba5 Fix #142972: FBX/USD import crash filling shape key data on empty mesh
The call to `BKE_keyblock_convert_from_mesh` can leave the KeyBlock's
data field null if the passed in mesh has no verts.

Continue to allow the shape keys to be created, but do not attempt to
actually fill them in with data. This seems to match the old FBX
importer's behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/142995
2025-07-24 08:43:14 +02:00
Aras Pranckevicius
0347e72778 Cleanup: fix compile warning 2025-07-24 09:37:46 +03:00
Mattias Fredriksson
1affb8de2f Cleanup: simplify OBJ export_frame() into separate functions
Separates export_frame() into individual functions for opening file streams
and writing .mtl and .obj data. This makes the code clearer in what and when
data is written to each stream by not interleaving .obj/.mtl writing. It also
simplifies the logic by separating out handling/branching for file streams
and .mtl writing.

Pull Request: https://projects.blender.org/blender/blender/pulls/142918
2025-07-24 08:34:21 +02:00
Jacques Lucke
a57709ca25 Fix #142828: broken socket usage inference for some nodes
The issue was an oversight in f7f18cd0c7.

This patch also adds some unit tests that would have caught this error.

Pull Request: https://projects.blender.org/blender/blender/pulls/143026
2025-07-24 08:13:34 +02:00