153133 Commits

Author SHA1 Message Date
Sean Kim
8723bd4f58 Cleanup: Change BKE_paint_brush_set to take in const reference
Some checks failed
Close GitHub Pull Requests / Close Pull Requests (push) Has been cancelled
Changes the overload from accepting `const AssetWeakReference *` to
`const AssetWeakReference &` to more strongly indicate proper usage. We
should not have a usecase for setting a null `AssetWeakReference`

Pull Request: https://projects.blender.org/blender/blender/pulls/144821
2025-08-20 00:01:04 +02:00
Casey Bianco-Davis
f5952fd178 Fix: Grease Pencil: Pen Tool does not work with multiple layers
The problem was that `threading::parallel_for` will return a range containing multiple elements even though the grain size is `1`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144826
2025-08-19 22:54:28 +02:00
Sean Kim
6e82e403df Fix: Image Editor can have no default active brush
Prior to this commit, determining the default brush asset used for a
particular mode was based on the object's mode. This is slightly
incorrect for the Image Editor, since it may be in Paint Mode no matter
the underlying object type. To fix this, use the runtime `PaintMode`
enum for determining these default values instead of `eObjectType` and
store the `PaintMode` on `PaintRuntime` for easy access.

Additionally, inside the toolsystem, prevent accidentally unsetting
the default brush by checking for the presence of the asset when
loading an `AssetWeakReference`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144765
2025-08-19 22:44:24 +02:00
Brecht Van Lommel
c7e2368d6c Fix #144528: Cycles renders OpenVDB grids with rotation wrong
Pull Request: https://projects.blender.org/blender/blender/pulls/144825
2025-08-19 21:39:30 +02:00
Damien Picard
abf743c380 Keymap: Consistent hotkey for Jump to Previous/Next Keyframe
Use "Up Arrow" to jump to the next keyframe, and "Down Arrow" for the
previous keyframe, to be consistent within Blender and other software.

See PR for details.

Pull Request: https://projects.blender.org/blender/blender/pulls/140301
2025-08-19 21:08:57 +02:00
Brecht Van Lommel
28f93d5443 Fix #144569: Cycles NanoVDB rendering broken with oneAPI
Wrong assumption about packed_int3, and not caught because the assert was in
the wrong place.

Pull Request: https://projects.blender.org/blender/blender/pulls/144803
2025-08-19 18:41:53 +02:00
Brecht Van Lommel
b5606b5634 Fix #144599: Cycles OSL node with external script does not update
Some code got lost in the refactor for OSL cameras.

Pull Request: https://projects.blender.org/blender/blender/pulls/144808
2025-08-19 18:33:37 +02:00
Clément Foucault
869fc2cf4e GPU: Shader: Add Shared Variable in shader create info
This allows to control the type of data inside the create infos for
easy variation of the same shader.

Also this wraps the last global shader resource usage for the future
SRD.

Pull Request: https://projects.blender.org/blender/blender/pulls/144769
2025-08-19 18:27:49 +02:00
Damien Picard
ced8281c32 I18n: Allow translation of two formatted reports using dynamic types
Two formatted reports introduced in e239c7f43c used a type defined at
compile time using the PRId64 macro. Translation failed for these
messages, because the message was extracted as:

"No keyframes removed from % strip(s)"

and the type was lost at the time formatting happened.

This commit instead uses fmt to format the message, which deals with
using the proper int type depending on the platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/144374
2025-08-19 18:16:18 +02:00
Bastien Montagne
59201ddc28 BPY props: Fix own mistake in recent refactor.
New code from 134d66201a was using uninitialized variable. Not sure how
I missed the compiler warning... :(
2025-08-19 17:49:46 +02:00
Bastien Montagne
134d66201a Cleanup: BPY prop: Move get/set... py callbacks into own scope.
Moving the python call itself into a dedicated sub-scope allows to
ensure local variables (arguments) do not risk leaking into the
rest of the code after being released.

Also use helper macro `PyTuple_SET_ITEMS`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144798
2025-08-19 17:16:31 +02:00
Hans Goudey
8b7a0b307b Cleanup: Make AttributeStorage method const 2025-08-19 10:23:13 -04:00
Omar Emara
fee17f40a2 Nodes: Lower main socket priority of menu sockets
This patch lowers the priority of menu sockets from the maximum priority
to the lowest priority. That's because menu sockets are nearly never the
main socket.

The current state is blocking the adoption of menu sockets in the
compositor, since most of the compositor nodes have color and float main
sockets, which currently have lower priority than menu sockets, making
node link insertion fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/144779
2025-08-19 16:18:58 +02:00
Weizhen Huang
c672aa9ef4 Cleanup: Cycles: Check if background light is enabled in one place.
`world_use_portal` is not needed anymore, now that we always add world
as object (b20b4218d5).
We now check if background light is enabled only in
`test_enabled_lights()`, depending on the sample settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/144710
2025-08-19 15:58:19 +02:00
Weizhen Huang
d866517708 Fix #144639: light missing update because it was disabled
the `light->is_enabled` check was only intended for background light,
for other light types we need to recompute the contribution at each
update.
2025-08-19 15:58:17 +02:00
Miguel Pozo
da7bcfc642 Fix #144441: EEVEE: Wrong projection matrix with Walk Navigation + Overscan
Disable overscan if we need to use the v3d winmat as-is.

Pull Request: https://projects.blender.org/blender/blender/pulls/144724
2025-08-19 15:12:54 +02:00
Weizhen Huang
83dcaf0501 Fix #144610: Cycles: do not convert open volume mesh to sdf
because we can't determine the interior. Sample densities in the whole
bounding box instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/144732
2025-08-19 13:26:11 +02:00
Brecht Van Lommel
f41a0d5ab9 Fix: Cycles OptiX + OSL fails to render images with OSL releases
It works with the beta we are using to build Blender 4.5, but the official
release is a bit different. This fix was tested to work with OSL 1.14.7.

Thanks to Paul Zander for finding the OSL commit that lead to this.

Pull Request: https://projects.blender.org/blender/blender/pulls/144715
2025-08-19 13:22:07 +02:00
Sergey Sharybin
660f6ae0ec Fix #144681: Add support for inactive color spaces
So far only active color spaces were queries from the OpenColorIO, which
made sense from the list of spaces displayed in the menus. However, some
logic requires knowing more details about color spaces used by displays,
for example to check if it is data, or whether color space matches the
display one.

This change makes it so our OpenColorIO integration handles inactive color
spaces by storing them in a separate array. Config::get_color_space will
now work for both active and inactive color spaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/144780
2025-08-19 12:37:24 +02:00
Bart van der Braak
075c2eca06 Fix #144483: Use-after-free when splitting View3D opened Asset Shelf
`asset_shelf::regiondata_duplicate()` first creates a shallow copy of
the `AssetShelf`, including its `AssetShelfSettings` member. So the
contained pointer point to the same memory.

While this is a rather unusual case for a copy assignment operator to
consider, I think this is fine since the API allows these shadow copies.
This is a bit of a consequence of mixing C and C++ style memory
management.

Pull Request: https://projects.blender.org/blender/blender/pulls/144613
2025-08-19 12:26:13 +02:00
Bastien Montagne
a3c4b0b07a Fix #144749: Crash on opening a file with a Sculpt toolsettings gravity object.
Mistake in code is at least 2 years old, interesting that this was never
noticed/reported before...

Candidate for LTS's backport.
2025-08-19 12:12:47 +02:00
Campbell Barton
8e85423f63 Refactor: simplify zero stripping in units code
Passing negative precision to internal units functions made the code
difficult to follow, especially when the precision is being
adjusted/clamped.

While the public API remains unchanged, detect the negative precision
early and assign it to a boolean which is passed as an argument.

Also improve doc-strings.
2025-08-19 09:37:38 +00:00
Pratik Borhade
1b5c896346 Fix #144371: Prevent inserting keyframes on linked action
When action is linked/overridden, it should not be editable. In this
situation, exit early from `insert_keyframes` to avoid inserting keys on
linked ID.

Pull Request: https://projects.blender.org/blender/blender/pulls/144416
2025-08-19 10:10:41 +02:00
илья _
3a6a663a15 Fix: Zero division exception in ca60419b3a
Pull Request: https://projects.blender.org/blender/blender/pulls/144770
2025-08-19 10:00:41 +02:00
Christoph Lendenfeld
c80834fbf7 Anim: Draw Time editor minor lines on full frames
For Todo: #138764
This follows a fix that tried to address this issue, but got negative feedback #139398

At certain zoom levels the animation editors in 4.5 would draw lines on subframes.
The previous patch fixed that by drawing less lines, but that got pushback from artists.
This patch restores the previous behavior, but ensures that major lines are *always* drawn
on even frame numbers, thus allowing minor lines to be drawn between
them on full frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/142858
2025-08-19 09:39:16 +02:00
Jeroen Bakker
e83cce910d Fix #144700: Incorrect operator model draw example
The example script for the Model Draw Operator was out of date. It
didn't used the polyline shader. This PR updates the example to use the
polyline shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/144722
2025-08-19 07:42:44 +02:00
nutti
99aa76035d Fix: typo in mathutils.Vector doc-string
Ref !144731
2025-08-19 02:36:42 +00:00
Campbell Barton
087c442567 Build: unbreak lite builds (WITH_TBB=OFF) 2025-08-19 12:31:17 +10:00
илья _
ca60419b3a Mesh: Avoid mutex lock in hot loop for custom normals
Use a thread local buffer to gather info about the custom normal space
for each corners group in threading to concatenate them later. This
avoids need to lock a mutex to write into a buffer shared betwen threads
in the corner groups traversal hot loop.

The performance improvement depends on the mesh size and the number of
CPU threads. In some files there might be no change, in other files an
improvement of over 2x was observed, mostly because we can now remove
the compromise from c8a4026984.

Pull Request: https://projects.blender.org/blender/blender/pulls/144660
2025-08-19 03:46:03 +02:00
John Kiril Swenson
5a0c0826b7 VSE: Support adding multiple images
Before, trying to add multiple strips would always create an image
sequence. This patch allows images to be added in bulk, just like movie
& sound strips.

A new "Image Sequence Detection" property has been added which works
like the image editor. Toggling it off will always import individual
images and never create image sequences.
If it's on, you can also optionally "Use Placeholders" to fill in gaps,
which exhibits the same behavior as before (placeholders will show as
pink in the preview until you have the files on your system in the right
folders).

You can even add both image sequences and regular images at the same
time. Only caveat is that this doesn't work if the regular images are
interspersed within sequence frames in the file browser view when you
add them. I.e., all frames of a sequence should be listed without any
regular frames in between (but the sequence frame numbers don't have to
be in order). This can usually be ensured on all sort types (like date,
name).

NOTE: This patch also replaces the "end_frame" property on image /
effect strips with "length," to support behavior when multiple strips
are involved. This is a breaking change for the API, but is a fairly
small change and will be included in the release notes.

The "length" property allows one to adjust all image strips' lengths at
once. It does nothing for image sequences, however, since their lengths
are defined by their image count.

Pull Request: https://projects.blender.org/blender/blender/pulls/143974
2025-08-19 00:09:04 +02:00
John Kiril Swenson
644fcd6bfb Cleanup: VSE: Reorganize and clean up sequencer add code
- Deduplicate `scale_fit_methods` enum
- Reorder functions, polls, and code to locations that make sense
- Rename some functions to remove `seq` terminology in favor of `strip`
- Renames `len` in `LoadData` to `count` for images
- Add clarifying comments and improve descriptions
2025-08-18 15:10:42 -06:00
John Kiril Swenson
4254730b20 Cleanup: VSE: Add Doxygen sections to sequencer_add.cc 2025-08-18 15:10:41 -06:00
Hans Goudey
76c5bdf0be Refactor: Clear Panel and ARegion runtime pointers when writing files
Avoid writing unnecessary pointers to blend files.

Pull Request: https://projects.blender.org/blender/blender/pulls/144743
2025-08-18 20:56:40 +02:00
Hans Goudey
178eca9427 Refactor: Move various window manager runtime pointers out of DNA
All of these pointers were cleared on file read. It's clearer to just
move them to the runtime struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/144729
2025-08-18 20:44:44 +02:00
Brecht Van Lommel
2615cecf10 Refactor: Cycles: Align log levels with CLOG
WORK -> DEBUG
DEBUG, STATS -> TRACE

Pull Request: https://projects.blender.org/blender/blender/pulls/144490
2025-08-18 20:22:44 +02:00
Brecht Van Lommel
6d6c950750 Fix #144543: Cycles NanoVDB render error with empty volume grid
Thanks to Weizhen for finding the cause.

Pull Request: https://projects.blender.org/blender/blender/pulls/144735
2025-08-18 20:21:44 +02:00
Brecht Van Lommel
05c7ec3a2f Fix: View transforms do not match display device in image save
In the image save operator, the view transforms did not match the display.

Use RNA ancestors to guess the right matching view and display settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/144734
2025-08-18 20:20:59 +02:00
Hans Goudey
56646137fe Refactor: Move some wmWindowManager runtime lists out of DNA
Mainly for the purpose of #127706, though there's plenty more runtime
data to move to the runtime struct out of DNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/144691
2025-08-18 16:13:07 +02:00
Hans Goudey
a5d5eca487 Cleanup: Sequencer: Replace seqbasep variable access with function
With the aim of removing `seqbasep` to remove the complicated logic for
repairing pointers within the `Strip` struct when loading files and undo
steps, this commit just moves access of the variable behind a function.
In the future the function will retrieve the list from a Strip pointer,
for now it just returns the existing pointer.

Overall motivation is that blend file pointer manipulation is incompatible
with the changes required for #127706.

Pull Request: https://projects.blender.org/blender/blender/pulls/144624
2025-08-18 15:39:58 +02:00
Clément Foucault
e05089362c GPU: Shader: Add support for enum class
In the process, refactor the enum processing
using the new parser.

Pull Request: https://projects.blender.org/blender/blender/pulls/144704
2025-08-18 13:50:49 +02:00
Jacques Lucke
a065d16ef4 Fix: Geometry Nodes: crash accessing empty instances 2025-08-18 13:16:58 +02:00
Clément Foucault
dce0fa115f GPU: Shader: Preprocess: Improve error reporting
This makes the new parser code output correct errors.

Also simplify error logging.

Simplify a few things inside the parser interface.
Add debug string to the `Token` and `Scope`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144708
2025-08-18 12:02:26 +02:00
Bastien Montagne
7997ff94dc I18N: Updated UI translations from git/weblate repository (5aae94a85f408). 2025-08-18 11:58:43 +02:00
Jeroen Bakker
066280446c Vulkan: Enable maintenance4 in VMA
VK_KHR_maintenance4 is enabled when available. VMA isn't aware that we
enabled it and could still use less optimized code-paths. This PR will
inform VMA that it can use the optimized code-paths.

The improvement is that we can decide in which memory area a specific
resource will be allocated, without the need of allocating the resource
header (VkImage/VkBuffer).

Pull Request: https://projects.blender.org/blender/blender/pulls/144552
2025-08-18 09:52:08 +02:00
Aaron Carlisle
ecba348b73 Docs: Update RNA to user manual URL mapping 2025-08-18 00:21:07 -04:00
Jesse Yurkovich
d4b0f02f72 Fix: Incorrect attribute type check during USD shape import
Accidentally changed in 1f92fd7577 and only noticed because there was a
suspicious drop in code coverage for the affected file.

Fix and add tests to ensure it doesn't happen again.

Pull Request: https://projects.blender.org/blender/blender/pulls/144702
2025-08-18 06:16:57 +02:00
Harley Acheson
35d84e3336 UI: Warning When Dragging Non-Blend File Onto Executable
Dragging a non-Blend file onto the Blender executable currently
silently fails with Blender just aborting. With this PR any files used
as file argument will load Blender and show a warning if the file does
not exist or is not a blend file. Blend files that cannot be read are
treated as they are now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139128
2025-08-18 02:18:39 +02:00
Sean Kim
98869c514a Fix: Annotate tool in Image Editor shows brush properties & errors
Pull Request: https://projects.blender.org/blender/blender/pulls/144658
2025-08-18 01:16:42 +02:00
Sean Kim
1c8bee7da2 Fix: Grease Pencil panels / buttons not displaying
Introduced with a combination of 6957242a53 and 4434a30d40

Pull Request: https://projects.blender.org/blender/blender/pulls/144654
2025-08-18 00:27:35 +02:00
илья _
dba072ef93 Mesh: Avoid quadratic vertex valence complexity for corner normals
We have a set of corners around some vertex. They have arbitrary
connectivity between each other and form a set of linked lists through
shared smooth edges. We have to linearly traverse each of these lists to
mix the normals. And as a way to iterate over all these lists mixed in
some index space we use a mask of already visited corners. So we take
the first non-checked corner by mask lookup. And this lookup starts from
the beginning every time even if we know there is no way to find any
elements before current one. In a synthetic example with 20k fan fill
of circle this gives a 8x speed up.

Pull Request: https://projects.blender.org/blender/blender/pulls/144649
2025-08-17 20:11:40 +02:00