Commit Graph

120055 Commits

Author SHA1 Message Date
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
Hans Goudey
0e15649bf8 Cleanup: Remove unused dynlib files
This has been unused since the game engine was removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132186
2024-12-20 20:38:40 +01:00
Brecht Van Lommel
63b4d7ba03 Fix: Uninitialized variable in MTLSafeFreeList
Found by address sanitizer. My understanding is that this bug could cause
too much flushing, but not wrong behavior or crashes. See aca9c131fc.

Pull Request: https://projects.blender.org/blender/blender/pulls/132141
2024-12-20 20:03:41 +01:00
Falk David
a7d3ced570 Refactor: VSE: Rename Strip to StripData
This renames the `Strip` struct to `StripData` and also renames
the `Sequence::strip` member to `Sequence::data`.

This is a first step towards naming the `Sequence` struct to `Strip`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132165
2024-12-20 18:02:31 +01:00
Hans Goudey
c5ba8bd7c2 Fix #125098: uv_seam attribute not accessible procedurally
When moving UV seams from special custom data types to attributes,
I considered them similar to mesh selection or visibility which are
"internal" attributes that aren't accessible procedurally and are
hidden from the UI. In retrospect that was the wrong decision; users
expect UV seams to behave more like bevel weights, and that makes sense.

This PR makes UV seams accessible in modifiers (geometry nodes) by
removing the leading period from the attribute name that indicated their
internal status.

The change of the attribute name is a breaking change of the API to some
extent, even though it's technically only mesh data. To mitigate that
issue, the `mesh.attributes["name"]` lookup function is modified to
support both the old and new names. Versioning code renames the
attribute to the new name when loading older files, and renames the
new name to the old name when saving files. That handling will be
removed as a breaking change in 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/129803
2024-12-20 16:47:15 +01:00
Jacques Lucke
c860697515 Fix #103440: spreadsheet does not show result of gpu subdivision
Fix is to just use the proper function to get the `GeometrySet` from an object.
2024-12-20 16:38:37 +01:00
Omar Emara
5a4b5a571f Refactor: Compute distortion bounds deltas independently
This patch refactors the BKE distortion deltas bound computation to
compute each of the bounds independently. This is done to support cases
where the distortion is not symmetric and thus would need to grow the
image in a non-symmetric way.
2024-12-20 16:17:39 +02:00
Richard Antalik
6b5f078b47 Fix #131930: Fake retiming keys aren't realized when adding new key
When adding retiming key to split strip, causes, that new retimed
segments are spanning to exiting retiming keys or strip content bounds.

Realize fake keys at handles before adding new key instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/132166
2024-12-20 14:00:30 +01:00
Hans Goudey
5b053c98de Fix #114872: Point density texture requires face corner byte color
Typically we are more flexibl with the attribute domain and type,
especially in the context of color attributes. This node still used
the old "vertex color" concept (only byte colors on the face corner
domain). It should have been updated for color attributes. Now the
nodes uses the attribute API to retrieve the attribute which
automatically interpolates the domain and type.

Also fix the node's use of the active color attribute to use the new
string based system rather than CustomData. It's incorrect to use the
active color rather than the default, but changing that might break
existin files.

Pull Request: https://projects.blender.org/blender/blender/pulls/132149
2024-12-20 13:54:08 +01:00
Aras Pranckevicius
0e37a287b1 Cleanup: simplify MovieProxyBuilder implementation
No need for empty base class with derived FFmpegIndexBuilderContext,
just use one MovieProxyBuilder
2024-12-20 14:36:16 +02:00
Omar Emara
15e56d169a Refactor: Multi-thread distortion bounds delta computation
This patch multi-threads the distortion bounds delta computations.
Additionally, it removes the 5-step approximation which was used. The
result of this function will be cached in the compositor and the problem
domain is relatively small.
2024-12-20 14:34:08 +02:00
Aras Pranckevicius
560caf63fd Cleanup: rename index_context -> proxy_builder in movie proxy builder code 2024-12-20 14:30:13 +02:00
Aras Pranckevicius
e99252d7fd Refactor: more cleanups and renamed to movie/ffmpeg related files
- All movie related public headers now have MOV_ prefix instead of
  IMB_movie_.
- All movie related public functions now have MOV_ prefix as well,
  instead of IMB_movie_ or IMB_anim_.
- IMB_anim.hh -> MOV_read.hh (also ImBufAnim -> MovieReader), and
  various utility functions not related to playback were split off
  into MOV_util.hh.
- Other function name tweaks for clarity, e.g. IMB_suffix_anim
  -> MOV_set_multiview_suffix and so on.
- All except one usages of MOV_get_fps (nee IMB_anim_get_fps) were
  ultimately just converting returned value into a float. So make
  MOV_get_fps just return that directly. For the (exactly just one)
  place that needs numerator and denominator, have
  MOV_get_fps_num_denom.
- Code comments on the public header functions.
- Removed never-used code paths inside movie timecode proxy building
  file.

It might be easier to review each commit separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/132145
2024-12-20 13:23:08 +01:00
Bastien Montagne
eb8632e71f Fix #132029: Purge can delete actualy used linked Objects.
Work-around the issue until we actually have correct refcounting usage
handling of Objects: For now, consider all linked objects used by
another used ID as used, even if their usercount is null.

NOTE: This _may_ have side-effects on liboverride (especially the resync
process), by leaving more 'unused' data behind. Since these are linked
though, and presumably not instanced in the Scene, this is probably an
acceptable compromise.

Pull Request: https://projects.blender.org/blender/blender/pulls/132076
2024-12-20 11:42:06 +01:00
Jacques Lucke
5af0a965f7 BLI: optimize Vector move-construction for common cases
This optimizes the move-constructor for `blender::Vector` when all of the
following are true:
* The source and destination vector have exactly the same type.
* The stored type is trivial.
* The inline buffer is `<= 32` bytes large (this value is a heuristic that could
  be changed).

The basic idea of the optimization is that under these circumstances one can
just copy the entire inline-buffer over instead of only copying it partially
based on the vector size. While that can mean that more bytes have to be copied,
the machine code that does the copying can be more efficient due to less
branching and the hardcoded size.

The performance impact is quite measurable. Note that the speedup depends on how
many elements are in vector and thus how many elements of the inline buffer are
used. The following table shows the move construction performance of a
`Vector<void *, 4>`. Starting at 5 elements, the performance doesn't change much
anymore, because the inline buffer is just ignored.

| Elements | Old  | New  |
|----------|------|------|
| 0        | 20.3 | 14.6 |
| 1        | 22.7 | 21.5 |
| 2        | 36.4 | 21.6 |
| 3        | 36.4 | 21.5 |
| 4        | 36.5 | 21.6 |
| 5        | 21.4 | 21.1 |
| 6        | 21.3 | 21.1 |
| 7        | 21.4 | 21.1 |
| 8        | 21.5 | 21.0 |
| 9        | 21.4 | 20.9 |
| 10       | 21.3 | 20.9 |

The binary size stays effectively unchanged (< 2kb change).

Pull Request: https://projects.blender.org/blender/blender/pulls/131841
2024-12-20 11:36:44 +01:00
Bastien Montagne
4b89a0047f Doc: Updated comments for the 'corner space' of custom normals. 2024-12-20 11:13:19 +01:00
Jesse Yurkovich
175ad18368 USD: Import subdivision edge creases and UV/Boundary smoothing options
Import edge crease values and properly configure any added subdivision
modifiers with correct UV and boundary settings. These were already
exported so this now completes our subdivision support.

Pull Request: https://projects.blender.org/blender/blender/pulls/131569
2024-12-20 01:31:31 +01:00
Gerard Taulats
f63fbccf76 Fix: Snap to text origin
Fixes bug where "Snap to vertex" tool would snap to text origins when it shouldn't.

Introduced from ab3e470b35

Pull Request: https://projects.blender.org/blender/blender/pulls/131767
2024-12-19 23:48:10 +01:00
Harley Acheson
8b386af223 Refactor: Move blender::bke::preferences Function Doc
Just moving a comment to immediately before a function declaration
rather than before a namespace block.
2024-12-19 13:22:42 -08:00
Harley Acheson
b801615431 Fix #123702: Don't Change TransOpt Flags with Language If Current Profile
We are currently setting all the Language "affect" options when
changing Language (Tooltips, Interface, Reports, New Data). This is
so that setting a language in a NEW config from the Quick Setup splash
screen will have those enabled. This PR keeps that but allows loading
old configs and keeping those options (#123702 & #112054). It also
allows changing language in Preferences without those changing as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/132046
2024-12-19 22:13:23 +01:00
Harley Acheson
88f8e1798c Refactor: Separate Function to Test for Current Preferences File
We have two uses of identical code that checks to see if we have a
current preferences file (false for first run of new version). This PR
extracts that to new function `blender::bke::preferences::exists()` as
there will soon be a third use (#132046). Otherwise no behavior change.

Pull Request: https://projects.blender.org/blender/blender/pulls/132140
2024-12-19 21:12:49 +01:00
Gerard Taulats
f7aa58dbab Fix #132062: Proper Snap to Volume memory free
Resolve MEM_new/MEM_freeN mismatch.

Pull Request: https://projects.blender.org/blender/blender/pulls/132138
2024-12-19 21:05:19 +01:00
Hans Goudey
1940e8283b Fix #91022: Property editor node link menu shows hidden node groups 2024-12-19 15:04:03 -05:00
Hans Goudey
be70e52e5b Cleanup: Remove useless loop in node property editor linking menu
Nothing happened in this loop.
2024-12-19 15:02:24 -05:00
Hans Goudey
9686092cd5 Cleanup: Quiet unused variable warning without ffmpeg 2024-12-19 15:01:02 -05:00
Hans Goudey
aa50f0ba07 Cleanup: Use LISTBASE_FOREACH macro for node groups 2024-12-19 15:01:02 -05:00
Miguel Pozo
7655784981 Fix #128388: GPU: Always forward viewport/layer from geometry shader
Ensure `gl_ViewportIndex` and `gl_Layer` are properly forwarded from the
geometry shader, and don't write to them from the vertex shader if
there's a geometry shader stage.

Fixes the Displacement "dicing" render tests on Nvidia OpenGL.

Pull Request: https://projects.blender.org/blender/blender/pulls/131875
2024-12-19 20:22:06 +01:00
Hans Goudey
e3981bad76 Geometry Nodes: Avoid rebuilding point cloud BVH trees in sample nearest
Currently the node rebuilds the target point cloud BVH tree on every call,
potentially thousands of times if the field is evaluated on many elements.
Instead, build the BVH tree once and store it in the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/132073
2024-12-19 18:22:31 +01:00
Hans Goudey
d11d9e1648 Cleanup: Use unique_ptr for point cloud BVH trees 2024-12-19 18:22:29 +01:00
Hans Goudey
d75afd32ef Refactor: Split BVH tree data creation function
Instead of a single function that handles all the BVH tree types,
split the BVHTreeFromMesh creation to separate functions.
2024-12-19 18:22:29 +01:00
Hans Goudey
e719cb078b Fix: Use correct BVH cache for snapping utility 2024-12-19 18:22:29 +01:00
Hans Goudey
fc970a5178 Refactor: Mesh: Deduplicate and simplify BVH construction
Currently there are three entry points to building BVH trees for mesh
ata: the caches on the mesh, an older set of functions used in the mesh
remap code, and a new set of functions used in some geometry nodes
sampling nodes. This commit unifies their implementations and switches
some functions from bit spans to index masks for representing a
selection of geometry.
2024-12-19 18:22:29 +01:00
Hans Goudey
9fc11c5aa9 Cleanup: Remove unused include from BVH header 2024-12-19 18:22:29 +01:00
Hans Goudey
671fa08e72 Cleanup: Return Mesh BVH data by value 2024-12-19 18:22:29 +01:00
Hans Goudey
625bd70dd7 Cleanup: Remove unused variable 2024-12-19 18:22:29 +01:00