Commit Graph

117289 Commits

Author SHA1 Message Date
Ray Molenkamp
a0d9826b3c Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132336
2024-12-25 23:32:15 +01:00
Ray Molenkamp
4dcef4421c Cleanup: CMake: Modernize bf_functions dependencies
Pretty straightforward

- Remove any bf_functions paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132335
2024-12-25 19:46:31 +01:00
Ray Molenkamp
a23aab3ddc Cleanup: CMake: Modernize bf_blenloader dependencies
Pretty straightforward

- Remove any bf_blenloader paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132334
2024-12-25 18:40:41 +01:00
Ray Molenkamp
c331c6b50e Cleanup: CMake: Modernize bf_blentranslation dependencies
Pretty straightforward

- Remove any bf_blentranslation paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132311
2024-12-25 17:40:25 +01:00
Omar Emara
459c940284 Cleanup: Remove redundant ntreeCompositExecTree
Removes ntreeCompositExecTree since it just calls COM_execute.
2024-12-25 08:38:28 +02:00
Ray Molenkamp
54604efdfd Cleanup: CMake: Modernize bf_windowmanager dependencies
Pretty straightforward

- Remove any bf_windowmanager paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132310
2024-12-24 22:40:38 +01:00
Harley Acheson
0ba91e9870 Fix #102347: Maximum Width for Status Bar Report Banners
This report shows a long report (measures 19,714 pixels) overflowing in
such a way that the banner shows nothing across the entire width of the
window. This PR just adds a maximum width to the banner size so it will
show a subset of the report correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/132307
2024-12-24 19:28:49 +01:00
SensArice
1098f434b0 Geometry Nodes: Find in String node
Add a node that finds the number of times a substring occurs in a string,
and the position of the start of the first match.

See the PR description for more rational and details.

Pull Request: https://projects.blender.org/blender/blender/pulls/129270
2024-12-24 17:12:19 +01:00
Hans Goudey
949b9638f5 BLO: Add read/write utility functions for int16 arrays
Pull Request: https://projects.blender.org/blender/blender/pulls/132306
2024-12-24 17:05:26 +01:00
Bastien Montagne
d7dd21996c Cleanup: Document that IDType.name is also used in linked ID paths. 2024-12-24 14:01:08 +01:00
Omar Emara
d8ede978ca Fix: Compositor: Reading multi-layer images is not thread safe
Reading an EXR multi-layer image in the compositor is not thread safe.
That's because the code access the render result without holding a
reference to it. To fix this, acquire the render result when accessing
the render result structure.

Pull Request: https://projects.blender.org/blender/blender/pulls/132300
2024-12-24 12:55:46 +01:00
Aras Pranckevicius
33ef338aca Cleanup: split ffmpeg movie writing into smaller source files, debug print cleanups
- Split off audio related code out of movie_write.cc into
  movie_write_audio.cc
- Rename very generic PRINT debug logging macro name to FF_DEBUG_PRINT,
  and use "ffmpeg:" prefix in the printed messages
- Other tiny simplifications

Pull Request: https://projects.blender.org/blender/blender/pulls/132233
2024-12-24 11:36:54 +01:00
Omar Emara
118dc65baa Fix #132210: Cryptomatte doesn't work with image sequences
The Cryptomatte node doesn't work with image sequences that starts at a
non-zero frame. That's because the typename of the Cryptomatte is not
necessary updated at a frame that exists in the sequence, so the node
fails entirely.

To fix this, we always compute the typename at the frame of the first
image in the sequence.
2024-12-24 10:58:35 +02:00
Ray Molenkamp
b7407aabb5 Cleanup: CMake: Modernize bf_gpu dependencies
Pretty straightforward

- Remove any bf_gpu paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132286
2024-12-23 21:38:19 +01:00
Hans Goudey
e315816dc5 Cleanup: Resolve unused function warnings without ffmpeg 2024-12-23 15:22:51 -05:00
Ray Molenkamp
a7c39896c6 Cleanup: CMake: Modernize bf_blenkernel dependencies
Pretty straightforward

- Remove any bf_blenkernel paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132282
2024-12-23 20:08:37 +01:00
Aras Pranckevicius
25f4a496ea Cleanup: Movie proxies now more C++ and cleaner output printing
As the individual commits say:
- Use Set instead of GSet for tracking proxy builder processed paths
- Use Vector<MovieIndexFrame> to store entries in MovieIndex
- Clearer stdout/stderr printing in movie proxy generation
- Instead of unlink(), use BLI_delete() which does proper utf8 path
  conversion on Windows.

Pull Request: https://projects.blender.org/blender/blender/pulls/132174
2024-12-23 18:23:49 +01:00
Ray Molenkamp
2992c63bc3 Cleanup: CMake: Modernize bf_bmesh dependencies
Pretty straightforward

- Remove any bf_bmesh paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132203
2024-12-23 17:47:25 +01:00
Hans Goudey
c10ef088a6 Refactor: Replace node types GHash with C++ container
Use VectorSet and Map instead of GHash. This can improve
performance, but the main point is to improve type and memory
safety and simplify code.

Pull Request: https://projects.blender.org/blender/blender/pulls/132240
2024-12-23 17:45:15 +01:00
Jacques Lucke
8dd559853a Nodes: improve API for dealing with nodes and sockets in a compute context
This extends the `NodeInContext` and `SocketInContext` types with some useful
methods to reduce boilerplate when using them in #132219. Also it moves the
inline functions to the bottom of the file to make the API easier to read.

Pull Request: https://projects.blender.org/blender/blender/pulls/132276
2024-12-23 17:03:43 +01:00
Jacques Lucke
d2485239f8 BLI: add Map.lookup_try method
This adds a new `Map.lookup_try` method that returns a `std::optional<Value>`
for a given key. If the key is not in the map, `std::nullopt` is returned. If it
is in the map, then a copy of the value is returned. Note that the copy is
necessary because `std::optional` can't contain reference types.

This method helps a lot in #132219 to reduce boilerplate.

Pull Request: https://projects.blender.org/blender/blender/pulls/132278
2024-12-23 17:03:32 +01:00
Hans Goudey
80f5b3ad21 Fix #121262: Curves Bezier subdivision uses free handles (unlike legacy curves)
I had written a comment years ago mentioning that this behavior would be
preferrable, but I mistakenly assumed it was complicated to implement.
It turns out the sampled points subdividing a Bezier segment will have
symmetric "aligned" handle positions. Generally it's better to keep the
handles aligned where possible since the editing experience is a bit better.

In geometry nodes this shouldn't make an important difference because
the handle types are changed as necessary for in the set handle position
node.

Pull Request: https://projects.blender.org/blender/blender/pulls/132204
2024-12-23 16:31:02 +01:00
Hans Goudey
8968faff10 Fix #132242: Assert in UV seam layer name versioning
Only attribute custom property names are expected to be unique.
But also, it isn't worth asserting over this here, so just use the
regular "add" method instead of "add_new".

Pull Request: https://projects.blender.org/blender/blender/pulls/132277
2024-12-23 16:29:30 +01:00
Bastien Montagne
4be060eee6 Writefile: clear runtime data before writing ID.
Avoids some binary noise in saved files, and will some day allow us to use runtime data on read without having to explicitly clean it up (unless we refactor this into an allocated pointer instead!).

Pull Request: https://projects.blender.org/blender/blender/pulls/132190
2024-12-23 16:18:22 +01:00
Jacques Lucke
4e879ed64d Fix #89387: improve handling of unavailable links
A link is unavailable when any of its sockets are unavailable. Sometimes such
links are in a weird inbetween state between being there and not being there at
all. Generally, they should be considered to not be there, but sometimes it's
still useful if they automatically come back when toggling the availability of
sockets. We don't have a replacement for this functionality yet.

This patch changes behavior so that unavailable links are treated as not being
there at all in two places:
* When deciding whether to draw an input socket value.
* When deciding what to do when drawing from a socket (to create a link from it
  or detach existing links). This is done by simply removing unavailable links
  when starting to drag from a corresponding socket. This allows all of the
  existing logic to stay the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/132184
2024-12-23 16:11:23 +01:00
Hans Goudey
f4acdbaf85 Fix #101014: Broken mix shader node links when opening particular old file
For some reason, the file in this report had its second mix shader socket with
the identifier "Socket.001" instead of the current "Socket_001". The age of
the file roughly corresponds to when we switched to the node declaration
system. I'm not sure why it has `.` instead of `_`, since the old socket template
system also used `_` as the deliminator. I vaguely remember some issue like
this but it's been a while and I can't find anything online.

The fix is to just manually change the socket identifier. The subversion bump
isn't conceptually necessary, it's just to stop the versioning from running
more often than necessary once the file is saved again.

Pull Request: https://projects.blender.org/blender/blender/pulls/132199
2024-12-23 16:10:14 +01:00
Jacques Lucke
748d98dff2 Nodes: add utility method to get ranges of socket indices
The `socket->index_in_tree()` method provides a unique index for that socket
in the node tree (it's a cached runtime value). By construction, all input/output
sockets of a node have consecutive numbers, but this (sometimes useful) fact
is currently not exposed in the API.

This patch adds new `input_socket_indices_in_tree` and
`output_socket_indices_in_tree` methods to get the range of indices for all
inputs or outputs of a node.
2024-12-23 15:16:30 +01:00
Jacques Lucke
8569338246 Nodes: add utility method to SocketValueVariant to check for single values
This is consistent with e.g. `is_volume_grid`.
2024-12-23 15:11:18 +01:00
Jacques Lucke
85879d0c53 Cleanup: remove unused include
Accidentally added in 8bec7dce35.
2024-12-23 15:04:31 +01:00
Jacques Lucke
8bec7dce35 Nodes: avoid O(n^2) when looking up interface input indices
Previously, the code was O(n^2) because it iterated over all interface sockets,
and for each it tried to find the corresponding index by iterating over all
inputs again. Now, a `VectorSet` is used to make finding the index `O(1)`. The
new utility function may also be useful elsewhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/132272
2024-12-23 15:01:07 +01:00
Omar Emara
159424053b Fix: Cryptomatte image user is missing frame update
The image user of the Cryptomatte node does not have an up to date frame
number. That's because the BKE image user walker function which is used
to update image user frames numbers was missing handling for the node.
To fix this, add a case for the Cryptomatte node.

This is a partial fix for #132210.

Pull Request: https://projects.blender.org/blender/blender/pulls/132271
2024-12-23 14:06:26 +01:00
Jacques Lucke
413b1bf655 Cleanup: simplify passing context to node functions
This helps in the future when passing more data through these functions.
For example, socket/panel usage information in #132219.
2024-12-23 12:50:00 +01:00
Jacques Lucke
54d3dd5783 Cleanuo: typo 2024-12-23 12:21:00 +01:00
Jacques Lucke
1b806891a6 Cleanup: simplify layout panel api usage for node group panels
Use the existing `uiLayoutPanel` instead of manually reimplementing it.
2024-12-23 11:39:49 +01:00
Omar Emara
00ee917fdf Fix #129319: Movie Distortion node is cropped
The Movie Distortion node output is cropped to the bounds of the
original input. This patch fixes that by extending the bounds depending
on how the distortion extends the image bounds.
2024-12-23 11:25:05 +02:00
Andrej730
406fe689fd PyDocs: Fix Vector.angle_signed signature
From the current signature it appears as `fallback` argument is not
optional. Changed it to have a default `None` value, similar to
`angle(other, fallback=None)`.

Noticed this issue working with fake-bpy-module that generates typing
based on Blender docs - https://github.com/nutti/fake-bpy-module/issues/326.

Pull Request: https://projects.blender.org/blender/blender/pulls/132052
2024-12-23 02:57:06 +01:00
Jesse Yurkovich
9ebb73070d USD: Enable 'quatf' Primvar types during Import
Importing USD `quatf` types was erroneously left disabled after recent
work this past summer for better attribute support. It is already
correctly enabled and validated for Export.

The `half` and `double` variants must still be skipped for now though.

Pull Request: https://projects.blender.org/blender/blender/pulls/132252
2024-12-22 23:02:41 +01:00
Jesse Yurkovich
eac1ade956 Fix #132077: Prevent stack-use-after-return inside USD_create_handle
Commit 0df5d8220b made a change to have the `USDStageReader` only keep
a reference to the ImportSettings struct. This isn't safe to do because
there's scenarios where the ImportSettings might be defined as a stack
variable but the reader outlives the lifetime of that variable. This
happens inside `USD_create_handle` where the reader is returned to the
caller for instance.

Fix this, and the original issue which lead to the change causing the
regression, by having `USDStageReader` own ImportSettings directly so
it's more obvious that it is A) tied to the lifetime of the reader and
B) can no longer become out of sync with a caller's own ImportSettings
data (since that no longer exists).

Pull Request: https://projects.blender.org/blender/blender/pulls/132095
2024-12-22 21:35:12 +01:00
Sean Kim
d05a359946 Cleanup: make format
Missed in 5d0dfd6f5a.
2024-12-22 15:02:02 -05:00
Andrej730
5d0dfd6f5a Doc: Add info about IDProperty Pointers not supporting Embedded IDs.
This was lacking in API documentation so far, and was source of confusion, see e.g. #129393.

Pull Request: https://projects.blender.org/blender/blender/pulls/132218
2024-12-22 18:17:12 +01:00
Hans Goudey
42fc3922aa Cleanup: Move node ID hash utilities to bke namespace 2024-12-22 10:52:08 -05:00
Hans Goudey
c62a032fab Cleanup: Use C++ math API for some object dimensions and bounds functions
To enable a fix and further cleanup in this area.
2024-12-20 19:29:18 -05:00
Harley Acheson
0add2857a3 Fix #117427: Adjust Alert Popup Widths
The complaint mentions three popup alert dialogs that have fixed width
and are difficult to translate to some languages and fit. for both
create_autorun_warning and create_opengl_usage_warning these become
sized to fit their longest string length. The third is just too narrow,
so create_save_file_overwrite_dialog is made 30% wider, to be more in
line with other dialogs with three buttons.

Pull Request: https://projects.blender.org/blender/blender/pulls/132098
2024-12-21 01:21:08 +01:00
Hans Goudey
cc2e0808eb Cleanup: Remove unused math C-API functions
Pull Request: https://projects.blender.org/blender/blender/pulls/132183
2024-12-20 21:47:00 +01:00
Hans Goudey
3d0988a719 Cleanup: Move some math C-API usage to C++ API
Mostly part of an attempt to remove some of the lesser-used
parts of the C math API.
2024-12-20 21:46:59 +01:00
Hans Goudey
fb27343867 Fix: Curves sculpt selection paint brush type ignores strength pressure 2024-12-20 15:34:58 -05:00
Hans Goudey
853443a390 Cleanup: Formatting 2024-12-20 15:27:03 -05:00
Hans Goudey
90cfc4d89f Cleanup: Remove unused color conversion function
Unused for 14 years.
2024-12-20 15:05:56 -05:00
Hans Goudey
ab53a84299 Cleanup: Remove unused qsort utility functions 2024-12-20 15:05:56 -05:00
Hans Goudey
70a86b14c0 Cleanup: Repace BLI_range.h with Bounds<float>
Pull Request: https://projects.blender.org/blender/blender/pulls/132181
2024-12-20 21:05:40 +01:00