Commit Graph

152480 Commits

Author SHA1 Message Date
Daniel Salazar
750d0df4e7 Shaders: Change default Blackbody node temperature to 6500K
Match the default value in Light Properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/143504
2025-07-29 17:49:05 +02:00
Patrick Mours
6487395fa5 Cycles: Add linear curve shape
Add new "Linear 3D Curves" option in the Curves panel in the render
properties. This renders curves as linear segments rather than smooth
curves, for faster render time at the cost of accuracy.

On NVIDIA Blackwell GPUs, this can give a 6x speedup compared to smooth
curves, due to hardware acceleration. On NVIDIA Ada there is still
a 3x speedup, and CPU and other GPU backends will also render this
faster.

A difference with smooth curves is that these have end caps, as this
was simpler to implement and they are usually helpful anyway.

In the future this functionality will also be used to properly support
the CURVE_TYPE_POLY on the new curves object.

Pull Request: https://projects.blender.org/blender/blender/pulls/139735
2025-07-29 17:05:01 +02:00
Omar Emara
0a1d146389 Fix #143542: Missing Media Type when in saving operator
If the scene is currently set to a Video media type and the user uses
the Save Image As operator, the Media Type in the operator will be
empty. That's because the image saving format is initialized based on
the scene format, but image saving does not support videos, so the enum
is invalid in that context.

This issue already existed before the introduction of media types, but
it happened for the file format field directly.

To fix this, we default to an image type if the scene is set to a video.

Pull Request: https://projects.blender.org/blender/blender/pulls/143549
2025-07-29 16:21:50 +02:00
Lukas Tönne
e676146516 Fix: Deleting instances fails assert on index range
Resizing instances initializes new element attributes, but this is only
valid when the capacity grows. Shrinking produces an invalid index range.

Pull Request: https://projects.blender.org/blender/blender/pulls/143535
2025-07-29 16:00:16 +02:00
Anthony Roberts
0f190b7060 Deps: Windows ARM64: fastjsonschema 2.21.1 and cattrs 25.1.1
As per #141950 and #138940

Pull Request: https://projects.blender.org/blender/blender/pulls/143547
2025-07-29 15:38:41 +02:00
Christoph Lendenfeld
5dfbe1af21 Refactor: Replace PBONE_SELECTED macro with functions
This PR changes the uses of `PBONE_SELECTED` and all the
places where it *should* have been used
with a new function `bone_is_selected` or `...editbone`
and `...pose_bone` specializations.

No functional changes intended.

Do note that there are still places in the code
where this function should probably be called,
but this PR is very careful not to change any behavior,
even if the current behavior is probably wrong.

In preparation for storing pose bone selection state
on the `bPoseChannel`
Related to #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/139496
2025-07-29 14:37:35 +02:00
Sebastian Parborg
475dc7e711 Linux: Deps: fastjsonschema 2.21.1 + cattrs 25.1.1
These are the changes from #141950 as requested by #141945
this contains the following changes:

Attrs 25.3.0
Cattrs 25.1.1
Fastjsonschema 2.21.1
Typing_extensions 4.14.1
2025-07-29 14:27:48 +02:00
Campbell Barton
3de916ca25 RNA: support for marking properties as deprecated
Deprecation meta-data support for RNA properties.

- Properties may have a deprecated note and version.
- Warnings shown when these are accessed from Python.
- A note is included in the generated documentation.

Support for marking functions as deprecated can be added in the future.

Ref !139487
2025-07-29 22:09:59 +10:00
Campbell Barton
c4ba04428c PyAPI: show Python warnings by default when debugging
Show warnings for debug builds or when `--debug-python` is passed in.

Without this, only scripts running in the `__main__` namespace
show warnings - hiding warnings for almost all scripts & add-ons.

This is also needed so deprecation warnings can be shown, see !139487.
2025-07-29 22:09:59 +10:00
Jonas Holzman
8d9ecf8f55 Deps: macOS arm64: Fix Python blake2 wrongly linking to system libb2
Latest Python library commit (cae5307) introduced a wrong system link
to Homebrew's `/opt/homebrew/opt/libb2/lib/libb2.1.dylib`

Pull Request: https://projects.blender.org/blender/blender/pulls/143541
2025-07-29 14:09:25 +02:00
Brecht Van Lommel
b4417cff35 Build: Change make update to always do git lfs pull
Some users still have issues getting LFS files downloaded properly, though the
exact cause is unclear. Normally with a properly installed git lfs, git pull
should already take care of it.

When for whatever reason that is not the case and files have not been fetched
yet, now do lfs pull which is the same as lfs fetch + lfs checkout. Even when
git pull can not run.

Ref #143461

Pull Request: https://projects.blender.org/blender/blender/pulls/143478
2025-07-29 13:35:03 +02:00
Campbell Barton
0da99335e8 Cleanup: various minor changes to convexhull_2d
- Only use `float2` from blender's namespace
  otherwise reference blender namespace explicitly.
- Improve code comment formatting.
- Replace defines with std::numeric_limits.
- Replace `float[2]` with `float2 &`.
2025-07-29 21:18:09 +10:00
Christoph Lendenfeld
b27c24e88f Fix #141732: Asset Screenshot does not capture for Cycles
When trying to capture an asset preview screenshot of the 3D viewport while in
Cycles render preview mode, the screenshot would not capture any geometry.

It turns out the function used (`ED_view3d_draw_offscreen_imbuf`) is not useful
for cycles because it doesn't give cycles time to render.

Instead of having cycles rendering, potentially taking a long time, we fall back to
a direct screencapture.
This has the disadvantage that the background will not be transparent in this case,
but this is a limitation we can document.
Also, instead of only excluding Cycles, I chose to include only EEVEE. That way,
things will work even when using 3rd party render engines.

Pull Request: https://projects.blender.org/blender/blender/pulls/142241
2025-07-29 12:36:36 +02:00
Jonas Holzman
cae5307a46 macOS arm64: Python: Add fastjsonschema 2.21.1 and cattrs 25.1.1 libraries
Ref: blender/blender#141950
Library Request: blender/blender#141945
5.0 Library changes issue: blender/blender#138940

This commit adds the following Python libraries:
- attrs 25.3.0
- cattrs 25.1.1
- fastjsonschema 2.21.1
- typing_extensions 4.14.1
2025-07-29 12:35:33 +02:00
Bastien Montagne
9de90e49c1 I18N: Updated UI translations from git/weblate repository (73c4fe27024aa0bb7). 2025-07-29 11:47:42 +02:00
Stefan Werner
c81e1d95c1 Cycles: Fixed typo in my last commit 2025-07-29 10:53:13 +02:00
Weizhen Huang
a7042ca30c Fix: warning template-id-cdtor on gcc 2025-07-29 10:41:17 +02:00
Stefan Werner
e7312b1ad5 Cycles: Explicitly setting SYCL device for Embree
This fixes issues when using Embree on mutliple GPUs.
A previous workaround used separate contexts, this one now
lets us keep a single context for all GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/143089
2025-07-29 10:40:28 +02:00
Campbell Barton
77945b7cd2 BLI_convexhull_2d: enable USE_ANGLE_ITER_ORDER_ASSERT
The fix for #143390 allows the assertion that angle iteration is
in-order to be enabled again.
2025-07-29 18:01:58 +10:00
Kace
f955eae545 Compositor: Improve File Output node UI
Makes the File Output node panel similar to the Render Output node.
Instead of a dropdown, color management enum property expanded in UI.
Color management settings are now moved inside a panel.
Add/remove file subpapth buttons moved to the side of UIList.

Resolves #133501

See images in PR description for visual changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133747
2025-07-29 09:55:48 +02:00
Philipp Oeser
c634e065b1 Fix #143182: Inconsistency in Menu order in Texture Painting Workspace
The Image Editor had a different menu order compared to the 3DView (this
came with fb74dcc5d6).
Now made the order in the Image Editor match the one of the 3DView.
Also matches the order in the sidebar now.

Pull Request: https://projects.blender.org/blender/blender/pulls/143222
2025-07-29 09:53:52 +02:00
Philipp Oeser
cba028f052 Fix #143421: python error using freestyle.utilities.get_strokes()
Codewise, it seems we just need to import the Operators type and use
that.

Pull Request: https://projects.blender.org/blender/blender/pulls/143432
2025-07-29 09:53:35 +02:00
Campbell Barton
87f9fd8fb3 Fix #143390: Incorrect results from BLI_convexhull_aabb_fit_points_2d
Resolve an error in `BLI_convexhull_2d` where *almost* overlapping
points could result in the hull including *concave* points.
This tended to happen with larger polygons in the range of 100-500.

The regression is likely caused by [0] since this optimization
relies on the input not having any concave coordinates.

[0]: 888c4d0766
2025-07-29 07:35:53 +00:00
Campbell Barton
c737c30b38 Cleanup: spelling in comments (make check_spelling_*) 2025-07-29 10:39:50 +10:00
Hans Goudey
1557d5c388 Fix: Potential null pointer dereference in attribute accessors
`AttributeIter::get()` could potentially use the `accessor` field
which wasn't set for curves or mesh vertex groups. "is_builtin"
can also be explicitly set for this case.
2025-07-28 17:59:01 -04:00
Hans Goudey
a358e1c53d Fix: Some enum item buttons don't function after recent cleanup
Caused by ecd8de4bea
2025-07-28 15:32:31 -04:00
Clément Foucault
55a0e427c5 GPU: Remove mip render workaround and recursive downsample
Recursive downsample was only used by workbench DoF
which can be expressed using mip view instead.

The mip render workaround was creating GL error on startup
and is not needed anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/143246
2025-07-28 19:05:36 +02:00
Jacques Lucke
5f132d3f07 Nodes: support storing internal data in Bundle
Currently, bundles can only store socket values of Geometry Nodes. However, it
can make sense to store other kinds of data too. Specifically, this patch adds
support for storing arbitrary internal data in a bundle. This is useful when
storing e.g. the physics world when implementing a proper physics solver for
Geometry Nodes (like in #143171).

One can still see that the data exists in Geometry Nodes in the tooltip, but one
can't extract it. Built-in nodes can still read that data.

Storing built-in data in bundles can also be done as an alternative to having a
new "internal data socket" as we talked in a workshop in the past:
https://code.blender.org/2024/11/geometry-nodes-workshop-october-2024/#internal-data-sockets

A bundle still has to be copyable. Internal data is expected to use implicit
sharing. That way copying it just requires increasing the user count of the
data.

Pull Request: https://projects.blender.org/blender/blender/pulls/143472
2025-07-28 19:05:18 +02:00
Brecht Van Lommel
f03ac5ec4b Fix #142876: Cycles crash with OSL and interactive updates
Update use_shading, use_camera and the shading system pointers in the same
location, so that when the render is interrupted they are in a consistent state.

The added null pointer checks are not strictly needed, but just in case it
goes out of sync for another reason.

Pull Request: https://projects.blender.org/blender/blender/pulls/143467
2025-07-28 18:43:57 +02:00
Aras Pranckevicius
04cb3c1bbd VSE: Faster Histogram scope calculation
Histogram was calculated by copying the rendered image, transforming it
into display space, and calculating the histogram on that. On large
resolutions, this copy+transform+free of the temporary image was taking
up majority of the time. Especially for default use case when the
display transform is a no-op.

Change the code so that display transform, if needed, is done directly
inside histogram calculation, without needing a full-size temporary image.

Performance of histogram calculation, on Ryzen 5950X (Windows), on
a 4K resolution image, with default color management settings:
- PNG (SDR): 3.9 -> 0.9ms
- EXR (HDR): 41.3 -> 6.3ms

With display colorspace (P3) that is different than the sequencer
colorspace (sRGB):
- PNG (SDR): 25.3 -> 11.3ms
- EXR (HDR): 64.9 -> 10.6ms

It also fixes calculation of histogram on float (HDR) images that have
alpha channel; the histogram was wrongly calculated on premultiplied
color values, which was not consistent with how it was calculated
on the byte images.

Pull Request: https://projects.blender.org/blender/blender/pulls/143175
2025-07-28 18:39:01 +02:00
Habib Gahbiche
794f33b8d6 Cleanup: use version_node_add_empty to add nodes in versioning
Pull Request: https://projects.blender.org/blender/blender/pulls/143476
2025-07-28 18:31:25 +02:00
Weizhen Huang
ea45c776fd Cycles: introduce dual types
to replace some uses of dfdx/dfdy/differentials.
No functional change expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/143178
2025-07-28 17:34:24 +02:00
Weizhen Huang
345d23bff8 Cleanup: Cycles: add more float3 util functions
and vectorize `wrap` and `safe_fmod`.
2025-07-28 17:34:21 +02:00
Weizhen Huang
48777385c2 Cleanup: Cycles: simplify computation of dPdx and dPdy
`sd->dPdu`, `sd->dPdv`, `sd->du` and `sd->dv` are computed from
`sd->dP` by constructing a local frame, so both results are the same, subject to some numerical differences.

This avoids constructing the local frame again, so might be faster.
2025-07-28 17:34:21 +02:00
Weizhen Huang
f9a65ebbea Cleanup: Cycles: Deduplication svm bump functions 2025-07-28 17:34:21 +02:00
Hans Goudey
32c9bd8b81 Cleanup: UI: Remove unused min/max arguments to uiDefIconTextBut
These min and max arguments are unused, 0 is passed everywhere.
2025-07-28 11:27:52 -04:00
Hans Goudey
ecd8de4bea Cleanup: UI: Remove unnecessary button arguments
Passing the current enum value as a float to the "min" argument
doesn't seem to do anything. It's also the only place that the min
and max arguments to `uiDefIconTextBut` are used.
2025-07-28 11:27:52 -04:00
Hans Goudey
3936d7a93e Fix #142485: Shading artifacts with free custom normals and scale transform
When transforming a geometry, we often apply the transposed inverse
to normals / custom normal data. However, that matrix can still contain
scale from the original matrix. That scale has to be removed so we can
avoid also scaling the normals.

I used the opportunity to remove the duplication between mesh and curves
processing of the custom normals, and to formalize an optimization to
skip the final normalization of each vector if the transform is such
that it isn't necessary. The new functions don't fit beautifully into
their public headers, but I don't know of a better place for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/142896
2025-07-28 17:25:34 +02:00
Sergey Sharybin
07bf1bd87b OpenSubdiv: Switch away from GLSL on Apple
Use MTLPatchShaderSource to provide the patch basis shader source on
all Apple platforms. The immediate advantage of this change is ability
to use GPU subdivision on iOS. Another advantage is that it moves us
further away from frameworks which got deprecated by Apple and it might
save us some headache in the future.

Also tweak backend-specific defines to match definitions from OpenSubdiv.
The annoying difference is that OSD_PATCH_BASIS_METAL is defined by the
OpenSubdiv as 1 in the very beginning of the base code, which is not done
for the OSD_PATCH_BASIS_GLSL is not defined by the OpenSubdiv at all.

Ref #143445

---

TODO:
- [X] Check it works correctly on macOS
- [x] Check it works correctly on Linux

Pull Request: https://projects.blender.org/blender/blender/pulls/143462
2025-07-28 16:54:10 +02:00
Jacques Lucke
63954843c2 Nodes: add utility to get virtual array for list
Pull Request: https://projects.blender.org/blender/blender/pulls/143469
2025-07-28 16:43:48 +02:00
Jacques Lucke
cf9939d3f2 Fix: Nodes: support choosing list socket shape for supported types 2025-07-28 16:28:05 +02:00
Jacques Lucke
5168ee1036 Nodes: use better color for closures
Change colors according to #143056.

Pull Request: https://projects.blender.org/blender/blender/pulls/143465
2025-07-28 16:11:36 +02:00
Sybren A. Stüvel
301a86d700 Modeling: new shape key operator Make Basis
Add a new operator "Make Shape Key the Basis Key", shown in the Shape
Key menu as "Make Basis". Effectively this does the same thing as moving
the active shape key to the top of the list of shape keys: applying it
to the mesh.

This operator is added now, because !141930 will prevent moving shape
keys to the top of the list. This hopefully prevents accidentally making
other keys the basis key, which can cause issues that are hard to
recover from.

Pull Request: https://projects.blender.org/blender/blender/pulls/143200
2025-07-28 15:28:21 +02:00
Sergey Sharybin
38f867814f Fix #143191: 10/12 bit videos import much too dark
Originally reported for ProRes codec, but it affects multiple
other codecs: any format which is read as >= 10bit had the issue.

A regression since 93be12fde0.

The cause of the issue is that movie clip and image data-blocks
did linearization on their side, which was quite hidden to find.
Now the color management is done on the movie reader level.

Additionally, added regression test to catch such issues early
on in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/143435
2025-07-28 15:14:23 +02:00
W_Cloud
3cd40bae9f Geometry Nodes: Change socket name based on node category and support component type.
The socket name should clearly indicate the type of component being processed.
The socket names for most nodes with geometry tag are clear, with the exception of these few nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/142358
2025-07-28 15:07:00 +02:00
Bartosz Kosiorek
fe96b2a613 Fix #107679: Smoke simulation adaptive domain shrinks too much
* Take into account heat grid in addition to density and fuel, as this is used for
  displaying smoke in Blender.
* Lower adaptive domain threshold from 0.02 to 0.002, to fix visual issues with
  small smoke density that can still be visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/139940
2025-07-28 14:15:07 +02:00
Habib Gahbiche
445eceb02a Nodes: Remove "Use Nodes" in Shader Editor for World
Part of https://projects.blender.org/blender/blender/pulls/141278

Blend files compatibility:
If a World exists and "Use Nodes" is disabled, we add new nodes to the
existing node tree (or create one if it doesn't) that emulates the
behavior of a world without a node tree. This ensures backward and
forward compatibility.

Python API compatibility:
- `world.use_nodes` was removed from Python API => **Breaking change**
- `world.color` is still being used by Workbench, so it stays there,
although it has no effect anymore when using Cycles or EEVEE.

Python API changes:
Creating a World using `bpy.data.worlds.new()` now creates a World with
 an empty (embedded) node tree. This was necessary to enable Python
scripts to add nodes without having to create a node tree (which is
currently not possible, because World node trees are embedded).

Pull Request: https://projects.blender.org/blender/blender/pulls/142342
2025-07-28 14:06:08 +02:00
YimingWu
272178d001 Fix #143420: Grease Pencil: Handle empty result in dash modifier
The dash modifier creates final result by combining filtered/processed
and unfiltered strokes, but this result could be empty. The code assumes
valid joined geometry when it's sometimes not the case. This patch did
a null check and it worked as it should.

Pull Request: https://projects.blender.org/blender/blender/pulls/143424
2025-07-28 13:38:08 +02:00
Brecht Van Lommel
fa007002b1 Refactor: Logging: Move G.quiet to CLOG, replace some printfs
* Replace G.quiet by CLG_quiet_set/get
* CLOG_INFO_NOCHECK prints are now suppressed when quiet, these were
  typically inside a if (!G.quiet) conditional already.
* Change some prints for blend files, color management and rendering to
  use CLOG, that were previously using if (!G.quiet) printf().

Pull Request: https://projects.blender.org/blender/blender/pulls/143138
2025-07-28 13:36:13 +02:00
Bartosz Kosiorek
b1d5c35f3a Physics: Change default shape for Bubble and Foam particles, to increase visibility
Change default shape of Bubble and Foam, to be able to notice potential
artifacts in the Viewport. The shape for bubble was changed to circle, and
the shape for Foam was changed to cross.

It allows users to notice and fix artifacts in early stages for reports like:
#79995 #81011 #85533 #97063

Pull Request: https://projects.blender.org/blender/blender/pulls/138681
2025-07-28 13:33:04 +02:00