Commit Graph

149350 Commits

Author SHA1 Message Date
Hans Goudey
91c340a1a5 Cleanup: Remove redundant break after return in switch 2025-05-04 22:07:23 -04:00
Hans Goudey
beadd08fb7 Fix: A few small issues with spreadsheet row filters
- int2 and short2 filters were completely disfunctional
- Don't use threshold for integer comparisons; it's not in the UI
- Filter with geometry set name for instance "Name" column
2025-05-04 22:07:23 -04:00
Nicola
33bef53c3e Sculpt: Use box test to select BVH nodes affected by Clay Strips
Implements a box test to select nodes affected by Clay Strips. The ratio
of nodes selected compared to the sphere test depends heavily on the
mesh, but is generally between 50% and 70%. This results in better
performance and reduces memory usage.

Pull Request: https://projects.blender.org/blender/blender/pulls/138170
2025-05-05 04:01:01 +02:00
Clément Foucault
c0f191f580 GPU: Make polylines vertex shader use C++ shader compilation
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/138411
2025-05-05 00:44:34 +02:00
Jesse Yurkovich
223aca7703 Build: Fix overzealous line wrap for COMPILER_CODE_COVERAGE_CXXFLAGS
Broken by f48b4e3abf

Pull Request: https://projects.blender.org/blender/blender/pulls/138379
2025-05-04 21:37:28 +02:00
Mattias Fredriksson
8d06479d24 Fix #137057: Sample Single Point Curves
Fixes behavior for #137057 when sampling single point curves.
Previous behavior just checked the evaluated length cache size and
called fill_invalid(), it will now fill using the point value and terminate.

Pull Request: https://projects.blender.org/blender/blender/pulls/138153
2025-05-04 16:31:58 +02:00
Nika Kutsniashvili
5dd53fdb29 Fix: Avoid relative imports in UI code
Relative imports are intentionally avoided in UI code (`scripts/startup/bl_ui`) because it makes it impossible to run individual files in isolation.

Common workflow for making mock-ups and quick UI edits is to load the UI file in Blender's text editor with "Edit Source" operator, make changes, and run the script to see the changes. But in the current version it's impossible because files include relative imports, which don't allow Python to run scripts individually.

Pull Request: https://projects.blender.org/blender/blender/pulls/138246
2025-05-04 13:26:03 +02:00
илья _
aa2ca33da2 Fix #137064: Nodes: Some nodes have a blank header when no datablock is selected
Similar to Mix node in #135535, some nodes did not properly implement a
callback to provide a UI node name.

Pull Request: https://projects.blender.org/blender/blender/pulls/137065
2025-05-04 11:37:07 +02:00
Jacques Lucke
5dd37abfbf Fix: Nodes: new empty frame node is always at origin
Now, when a new frame node is added while no node is selected,
it will be added at the cursor.
2025-05-04 09:40:22 +02:00
YimingWu
884ef238c0 Fix #136397: Line Art: Skip dupli objects with include_objects
Previously to handle unevaluated objects in line art "load all"
iteration, a `include_objects` variable is added in depsgraph
iteration settings, and this was only processed by object iterator
but not for any of the dupli objects. Now `make_duplis_collection`
will also handle `include_objects`

The only case where this border case can lead to crash is that a
line art grease pencil object is inside one of the dupli collection,
which isn't a valid use in the first place. But this fix makes it
more robust.

Pull Request: https://projects.blender.org/blender/blender/pulls/137323
2025-05-04 08:20:06 +02:00
Jacques Lucke
327ac569b2 Geometry Nodes: show node timings for import nodes 2025-05-04 05:44:52 +02:00
Aaron Carlisle
ebeb5cc2fc Fix: Missing UI class registration
This was missing in ad9b5a1b00
2025-05-03 22:38:08 -04:00
Sean Kim
6ec5ad88b9 Fix: Making a brush local doesn't set user count correctly
When copying a brush from a linked library to the current main, the fake
user flag is set, but the user count is set to 0. This later means that
saving such a file does not persist the brush datablock, and the
associated invariants are violated.

Related to / Found in #138105

Pull Request: https://projects.blender.org/blender/blender/pulls/138243
2025-05-04 01:25:05 +02:00
Aaron Carlisle
c92abb6af1 Icons: Match SVG height for Add/Remove icons
Adjust the height of the remove icon SVG to match the add icon, ensuring consistent sizing across UI elements.

This resolves alignment issues when pairing SVG icons with text or font-based elements. A height of 1100px was chosen to vertically center the icon cleanly in Blender's UI without introducing fractional pixel offsets.

No visual differences are expected in Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/137438
2025-05-03 17:21:06 -04:00
Hans Goudey
71ac8eee68 Cleanup: Use const arguments for realize instances function
OrderedAttributes was passed by value unnecessarily.
2025-05-03 15:25:24 -04:00
Guillermo Venegas
9e5151d294 Refactor: UI: Replace uiLayoutSplit with class method uiLayout::split
This converts the public `uiLayoutSplit` function to an object oriented
API (`uiLayout::split`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

`uiLayout::split` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.

Pull Request: https://projects.blender.org/blender/blender/pulls/138361
2025-05-03 20:51:42 +02:00
Mukhesh
5055a4e5a3 FIX: Select operators in Sequencer Preview
Behavior of select all operator invoked by shortcut was inconsistent
with menu. This was, because operator context was not set.

Also the selection in timeline is cleared when running this operator
as not doing it may cause unexpected behavior for users.
Selection invert also follows the same behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/137713
2025-05-03 02:20:56 +02:00
Campbell Barton
7d97ba4c5f Cleanup: use float2, int2 types for cursor drawing callbacks
Ref !138172
2025-05-02 23:01:29 +00:00
Campbell Barton
0d6a0dfa29 Cleanup: reduce right-shift in Python iterators 2025-05-03 08:57:44 +10:00
Andrej730
db78c031c5 PyDoc: add types to property doc-strings in bpy.types
Also correct type for Object.children_recursive.

Ref !138346
2025-05-03 08:45:53 +10:00
Andrej730
24dc0482ac PyAPI: minor optimization using iterators for contains checks
Avoid building a list to perform a __contains__ check.

Ref !138346
2025-05-03 08:45:14 +10:00
Hans Goudey
ae2c601a0c Fix: Curves split/separate points operators lose vertex group status
The fix is only clearly correct if `copy_data_to_geometry` returns by value.
2025-05-02 14:39:20 -04:00
Guillermo Venegas
5dc86dacda Refactor: UI: Replace uiLayoutBox with class method uiLayout::box
This converts the public `uiLayoutBox` function to an object oriented
API (`uiLayout::box`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

`uiLayout::box` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.

Pull Request: https://projects.blender.org/blender/blender/pulls/138334
2025-05-02 19:46:26 +02:00
Bastien Montagne
b1fd91c2c0 Fix #138329: Workbench Material color type broken for meshes with no material.
Regression from 368c737fe7. Forgot to fully move to using
`BKE_id_new_nomain` at some point for default materials, instead
of doing more low-level set of 'alloc liblock, initialize it with
default values'.
2025-05-02 18:58:15 +02:00
Miguel Pozo
f24ad7a470 Build: Add WITH_OPTIMIZED_BUILD_TOOLS
Enable optimizations on Debug builds for executables used for the build
process (datatoc and glsl_preprocess) and enable unity builds for
shader preprocessing targets.

Debug: From 28.9s to 5.7s
Release: From 4.9s to 3.5s

Pull Request: https://projects.blender.org/blender/blender/pulls/138274
2025-05-02 18:33:44 +02:00
Hans Goudey
37dcdb2b6a Depsgraph: Avoid quadratic overhead when building collection relations
Checking whether relations already existed was a bottleneck when building
collection -> object hierarchy relations. The duplicate checking would be
unnecessary since an object can only be in a collection once, but this function
to build relations can be called multiple times for the same collection.

To avoid the need to check for duplicates, only run the relation creation
once for each collection. The `BuilderMap` gives a simple way to do that.
Note that because a collection might be built separately as a non-layer
collection, there may still be duplicate hierarchy relations.

Building a Depsgraph for 60k simple objects became 1.86x faster, from 2.39
to 1.29 seconds.

Pull Request: https://projects.blender.org/blender/blender/pulls/137737
2025-05-02 17:51:10 +02:00
Brecht Van Lommel
204050d1a3 Fix #115714: Change OpenColorIO abort to CLOG_ERROR
OpenColorIO exceptions would abort when WITH_ASSERT_ABORT is enabled.
But these do not generally indicate a bug in Blender. They may just be a
blend file using an unknown color space, or an error loading the
configuration file, which we can handle gracefully.
2025-05-02 17:39:56 +02:00
Brecht Van Lommel
321e9e049e Fix: USD material reader uses fixed colorspace names
For other OpenColorIO configurations these may not exist or have a
different meaning.
2025-05-02 17:39:56 +02:00
Brecht Van Lommel
af4a7efaed Fix #138262: Movie file colorspace can't be changed
Regression from recent ccd7bc2078, restore previous logic and add
comments.
2025-05-02 17:39:56 +02:00
Laurynas Duburas
45a2634917 Fix: Curves: "Separate" in point selection mode loses boundary segments
The current code doesn't include selection boundary points in non-
selected curves after separation, causing some segments to be lost.
Legacy curves do include those points. The second issue is with cyclic
curves. The current version leaves the separated part cyclic, though
the more intuitive behavior would be cut off the result. This is also
different from legacy curves. This commit fixes both issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/135035
2025-05-02 17:30:02 +02:00
Sergey Sharybin
5b29ba488f Color management: Implement shader to convert to scene linear
Previous conversion to scene linear was done in the display transform
shader. Having a separate shader to convert texture to scene linear
allows drawing input textures with different color spaces into a
viewport and apply display transform on all of them.

Currently unused, but is required for !138094. It could also be used
in the future to avoid host-side linearization in the image engine.

Internally it uses a lot of the same logic for shader caching and
binding, but the code is refactored a bit to make it easier to have
a stronger separation in the future if needed.

Ref #138094

Pull Request: https://projects.blender.org/blender/blender/pulls/138308
2025-05-02 16:51:46 +02:00
Sergey Sharybin
a26ed85adf Fix: Wrong ID type used to create Lookdev world
Fixes incorrect render of lookdev on macOS.
There might have been some other issues caused by the mistake, hard to say,
seems to be hitting some platform-specific behavior and such.
2025-05-02 16:30:44 +02:00
Julien Duroure
0fa57b7774 glTF Exporter: Restore animation hook after slots management 2025-05-02 16:19:59 +02:00
Falk David
a1b92f91b7 Fix #137990: Grease Pencil: Crash when creating library override
There were two issues:
* Some rna properties to access members in the layer tree were missing
  `PROPOVERRIDE_NO_COMPARISON`.
* In `rna_Attributes_noncolor_layer_skip` the wrong `AttributeOwner`
  was created.

Pull Request: https://projects.blender.org/blender/blender/pulls/138324
2025-05-02 16:15:34 +02:00
Hans Goudey
ed68c0a635 Cleanup: Clarify instances almost unique IDs cache
Use the safer VArraySpan instead of get_internal_span(). And remove
the size check for the output data. If the callback inside `ensure` is
called it means that recomputing the data is necessary, regardless of
the array's current size.
2025-05-02 10:11:29 -04:00
Julien Duroure
c52b5387ba glTF exporter: Add mapping parameter in gather_image_hook
This is a breaking change for this hook in 4.5
2025-05-02 16:03:22 +02:00
Sybren A. Stüvel
f6167aab31 Anim: name new action slots after the last-used slot
When creating a new action slot for a data-block, via the '+ New' button
of the slot selector, use the name of the slot that was last used by
that data-block. Previously, it would always use the name of the
data-block, interfering with slot auto-selection when toggling between
Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/138326
2025-05-02 16:03:00 +02:00
Julien Duroure
a5834743f3 glTF exporter: Refactor image uri management
Now uri is precalculated, to be able to change it in a hook
2025-05-02 15:58:46 +02:00
Julien Duroure
eee3c96a8f Fix: glTF: Avoid crash when object is another scene is not in object mode 2025-05-02 15:56:15 +02:00
Julien Duroure
61e6c91c4e Fix: glTF: Fix regression - bone flat hierarchy export 2025-05-02 15:53:53 +02:00
Julien Duroure
743a6ae2a5 Fix: glTF: Fix active/inactive UI for ShapeKeys animation panel 2025-05-02 15:49:16 +02:00
Julien Duroure
bc8a39fba0 glTF: Better error handling when image is not found 2025-05-02 15:42:33 +02:00
Julien Duroure
f879c37a06 glTF: Cleanup function name 2025-05-02 15:40:58 +02:00
Julien Duroure
caaf148d50 Fix: glTF Exporter: Fix Track export when Apply Modifier 2025-05-02 15:38:29 +02:00
Julien Duroure
ee6e978d07 Fix: glTF exporter: Fix exporting Vertex Color for Unlit Materials 2025-05-02 15:35:32 +02:00
Julien Duroure
23e16f3371 Fix: glTF: Fix crash in animation pointer when no SpecularColorFactor can be found 2025-05-02 15:32:57 +02:00
Julien Duroure
3e8aabcd0b glTF importer: add option to import scenes as Collection(s) or Scene(s) 2025-05-02 15:30:18 +02:00
Julien Duroure
6e689ec59c glTF exporter: Clamp Normalized Vertex Color values 2025-05-02 15:27:43 +02:00
Sergey Sharybin
b1c8f90b32 Math: Use lvalue ref-qualifier for compound assignment operators
The goal is to make issues like the ones fixed in #138310 become visible
much earlier in the development cycle.

This PR covers the most obvious places where it could be applied. There
are probably more places, but they can be covered later.

Pull Request: https://projects.blender.org/blender/blender/pulls/138315
2025-05-02 15:25:32 +02:00
Julien Duroure
705ba465bb glTF importer: New option to import unused materials & images 2025-05-02 15:25:04 +02:00