Commit Graph

120055 Commits

Author SHA1 Message Date
Harley Acheson
d379897019 UI: Improvements to Confirmation of Unpack Linked Libraries
A more informative confirmation dialog to confirm that the user wishes
to unpack linked libraries.

Pull Request: https://projects.blender.org/blender/blender/pulls/117154
2024-02-23 02:02:55 +01:00
Hans Goudey
c5d855b497 Cleanup: Use C++ function callbacks for some UI widgets
Use std::function instead of separately allocated arguments and
function pointers. This improves type safety and makes the code less
verbose. It also moves us closer to not having two methods of adding
button callbacks.
2024-02-22 15:53:05 -05:00
Hans Goudey
fdc367f842 Cleanup: Use Vector instead of linked list for data-block sorting utility 2024-02-22 15:34:21 -05:00
Bastien Montagne
b42dc08452 Merge branch 'blender-v4.1-release' 2024-02-22 19:56:59 +01:00
Bastien Montagne
1dca5af712 Core: Libraries: Fix library parenting when libraries are deleted.
So far, when deleting a library (either explicitely, or through e.g.
relocation), its dependencies would get a `nullptr` parent, and
therefore become 'directly used' libraries.

This commit adds a new util to rebuild the libraries hieararchy, and
calls it when a Library ID is deleted.

NOTE: While logic is somewhat similar to what liboverride resync does to
sort the libraries by indirect levels
(`lib_override_libraries_index_define`), there are some key differences
here, notably the fact that if a library has a valid `parent` pointer,
it is not replaced, even if a 'better' parent (less indirect library)
could be found.
2024-02-22 19:25:59 +01:00
Hans Goudey
c78d668f17 Cleanup: Simplify iteration of corners in face in one case
No need to reconstruct the IndexRange. Also use the more
standard name "corner".
2024-02-22 12:59:06 -05:00
Sean Kim
41cfb379af Cleanup: Remove unused SCULPT_OT_set_detail_size operator
This PR removes the unused `SCULPT_OT_set_detail_size` operator and related code.

Addresses cleanup of #108111 now that #118403 is merged in.

Pull Request: https://projects.blender.org/blender/blender/pulls/118591
2024-02-22 18:20:16 +01:00
Weizhen Huang
a3f0ff6184 Cycles: make Principled Hair Huang a near- and far-field model
for a camera ray, compute the actual range of the hair width that the
current pixel covers, and only integrate that subset, to prevent a
ribbon-like appearance in close-up looks.
When the hair covers less than one pixel on the screen or when the ray
is not camera ray, the model works the same as before.

Pull Request: https://projects.blender.org/blender/blender/pulls/116094
2024-02-22 18:18:14 +01:00
Jeroen Bakker
17842d4d40 Fix: CustomData crash in debug builds with empty name
Due to a recent change the name of a layer is passed using a string ref
but the check if it is filled was done by checking if the first char
was zero. This fails as string ref first does the bound checks.

This is fixed by using `!is_empty()`. There might be more places, but this
one fired when loading production files.

Issue introduced by a39e8a4ab9

Pull Request: https://projects.blender.org/blender/blender/pulls/118605
2024-02-22 18:01:06 +01:00
Hans Goudey
77cba3d551 Geometry Nodes: Sample grid node
This simple node finds the values of a volume grid at
positions in the local space used in geometry nodes
evaluation. There are three interpolation modes to
choose how to mix values between neighboring voxels.

For the implementation, first the values are sampled
with the grid's type directly, then implicit type conversions
are used to get the final type. This makes gives us flexibility
in case there aren't exact matches in support between grid
types and Blender types.

Pull Request: https://projects.blender.org/blender/blender/pulls/118397
2024-02-22 17:58:09 +01:00
Hans Goudey
6099252dd4 Instances: Move transforms to attribute
Similar to 2e6223d90f, but potentially 16 times more effective.
The new attribute is named "instance_transform". It isn't displayed in the
spreadsheet since that wouldn't really be useful. This simplifies a lot of
code since it doesn't have to handle transforms specially anymore. But
complexity is added in the store named attribute node and attribute input
node to keep the old "position" attribute working for compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/118531
2024-02-22 17:57:09 +01:00
Richard Antalik
d4925b9775 Cleanup: Refactor VSE movie loading
Original code was very confusing, with seemingly indecisive logic.
I hope, that it is less confusing now, however there is still some
indecisiveness present. This is because multiview configuration may not
be correct, so there must be fallback and only some multiview settings
require loading of multiple files. Perhaps be better wording could be
used for `open_anim_file_multiview()`.
Fortunately this is now expressed within 5 lines of code instead of 100.

Further this can be improved by checking if the file exists, since now
VSE crashes when right eye image is missing, because loading code
does not try to actually open the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/118580
2024-02-22 17:48:40 +01:00
Brecht Van Lommel
624e0b1519 Merge branch 'blender-v4.1-release' into main 2024-02-22 15:12:40 +01:00
Bastien Montagne
f15f57c5ea GPv3: Add layer 'pass_index' attribute.
Add this data as a layer attribute. It's usage was already implemented
by the modifier filtering generic code, but data itself did not yet
exist in GPv3 data.

Also add RNA accessors and handle it in conversion code.

Pull Request: https://projects.blender.org/blender/blender/pulls/118495
2024-02-22 14:53:48 +01:00
Christoph Lendenfeld
a102d3e454 Fix #99635: Make last frame of motion path range inclusive
The issue described was that the motion path didn't display the last frame
of a scene.

This PR makes the user facing motion path range inclusive on both ends.
E.g. when the user specifies a motion path from 1-24 the will now get all 24
frames, whereas previously the motion path would end at frame 23.

This also makes the `Scene Frame Range` option work properly since that
had the same issue. Now it displays the actual full scene range.

Internally, the `bMotionPath` is still exclusive on the upper bound.
It is just the `bAnimVizSettings` range that has been modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/118611
2024-02-22 14:44:26 +01:00
Sergey Sharybin
e3b9ccc7b2 Merge branch 'blender-v4.1-release' 2024-02-22 14:43:01 +01:00
Jacques Lucke
e2d809fa91 Fix: show invalid links when separate group input nodes have different linked menu items
Previously, these invalid links would not show as invalid even though they don't work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118610
2024-02-22 14:40:21 +01:00
Brecht Van Lommel
056becae8a Merge branch 'blender-v4.1-release' into main 2024-02-22 14:36:13 +01:00
Sebastian Parborg
8aed44471e Merge branch 'blender-v4.1-release' 2024-02-22 14:28:04 +01:00
Jeroen Bakker
5a4877bbdd EEVEE-Next: Update reflection probes when resolution changes
When the resolution of the reflection probes changes the change
was only applied when the reflection probes where updated. To improve
the workflow this change will tag the reflection probes when the
resolution is modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/118607
2024-02-22 14:26:40 +01:00
Brecht Van Lommel
8dfb87d1af Fix: Update tests data path to new directory 2024-02-22 14:25:54 +01:00
Sebastian Parborg
b5c8505f5a Fix: Always print warnings when file/folder renaming fails
Rewrite the code so that users get an error message when trying to
rename something to an existing file in the file browser. Before this
change Blender would not print any notifications on why the rename
failed if a file with the same name already existed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118571
2024-02-22 14:24:33 +01:00
Sebastian Parborg
b4610f8fc0 Fix #116049, #117754: Renaming fails on linux with certain filesystems
Not all filesystems on linux supports the RENAME_NOREPLACE flag.
If we get a EINVAL return value, retry with a non atomic operation.

RENAME_NOREPLACE was introduced in 050d48edfc, so this is a regression
fix as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/118571
2024-02-22 14:23:54 +01:00
Sergey Sharybin
396348eea9 Merge branch 'blender-v4.1-release' 2024-02-22 13:51:48 +01:00
Sergey Sharybin
3dc832a904 Switch SVN to Git submodules using Git-LFS
This change makes it so build system and update utilities for Blender builds
are using pre-compiled libraries and other resources attached as Git modules
instead of using checkout of SVN repositories in the parent folder.

The directory layout:
```
  * release/datafiles/
    * assets/        -> blender-assets.git
      * publish/
      * ...
      * README.txt
  * lib/
    * darwin_x64/    -> lib-darwin_x64.git
    * darwin_arm64/  -> lib-darwin_arm64.git
    * linux_x64/     -> lib-linux_x64.git
    * windows_x64/   -> lib-windows_x64.git
  * tests/
    * data/         -> blender-test-data.git
```

The changes about configuring the actual Git sub-modules are not included
into this patch, as those require repository to actually exist before it
can be used.

The assets submodule is enabled by default, and the rest of them are
disabled. This means that if someone runs `git submodule update --init`
they will not get heavy libraries. The platform-specific and tests
related submodules are enabled when using `make update` or `make test`.

All the submodules are tracked: this means that when new commits are
done to the submodule, the blender.git repository is to be updated to
point them to the new hash. This causes some extra manual work, but it
allows to more easily update Blender and its dependencies to known good
state when performing operations like bisect.

Ref #108978

Pull Request: https://projects.blender.org/blender/blender/pulls/117946
2024-02-22 13:50:55 +01:00
Jacques Lucke
50709ca253 BLI: add named constructors for IndexRange
Unless you're very familiar with `IndexRange`, it's often hard to know what
e.g. `IndexRange(10, 15)` means. Without more context, one could think
that it means `10-14`, `10-15` or `10-24`. This patch adds named constructors
to `IndexRange` to make the behavior more obvious when writing and when
reading the code. With those one can use `IndexRange::from_begin_end(10, 15)`,
`IndexRange::from_begin_end_inclusive(10, 15)` or `IndexRange::from_begin_size(10, 15)`
respectively. While being a bit more verbose, the explicitness makes code easier to
understand and also allows abstracting away some common index computations.

The old unnamed constructor that takes a begin and size is not removed by this patch,
as that would make the patch significantly bigger. I think it's reasonable to generally
use the named constructors going forward and to change the existing usages of the
old constructor over time.

Pull Request: https://projects.blender.org/blender/blender/pulls/118606
2024-02-22 12:57:10 +01:00
Campbell Barton
a292dc3117 Cleanup: update code comments to match refactor
Rename comments, missing from 6d491da0be
2024-02-22 22:40:51 +11:00
Campbell Barton
d4aedd89d0 Cleanup: spelling in comments 2024-02-22 22:40:46 +11:00
Campbell Barton
da40fcdd15 Cleanup: quest unused argument warnings without FFMpeg 2024-02-22 22:36:11 +11:00
Campbell Barton
2303df95b0 Merge branch 'blender-v4.1-release' 2024-02-22 22:15:43 +11:00
Campbell Barton
20c729b902 Fix missing info space redraw when modal operators report while running 2024-02-22 22:12:02 +11:00
Jacques Lucke
e8cd77b415 BLI: make IndexMaskSegment it's own class instead of an alias
`IndexMaskSegment` has more invariants (sorted unique indices) than a plain `OffsetSpan`.
This also allows us to add methods to `IndexMaskSegment` that wouldn't fit in `OffsetSpan`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118603
2024-02-22 11:46:45 +01:00
Jeroen Bakker
e70e9e3cf9 GPU: Report on vertex attribute conversions
Blender uses some vertex attributes that are not (and sometimes
never) supported by a GPU. OpenGL silently converted these changes
but for Metal/Vulkan we need to convert then when uploading the
data.

This PR will write to console invalid usages which we should remove
from Blender code-base. Note it is still possible to create attributes
that still need conversions by using the PyGPU API.
2024-02-22 11:13:16 +01:00
Bastien Montagne
e850cca0a7 GPv3: Conversion: Initial animation handling.
Add generic handling of all potential FCurves, with custom callbacks to
perform the actual conversion (typically, some RNA paths will need to
be updated).

Currently implements only remapping of modifiers' animation.

This commit only handles Object-level animations, GreasePencil
data will be handled in a separate commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/118500
2024-02-22 10:53:43 +01:00
Philipp Oeser
6b8a7a17d7 Fix #118600: GPv3: hook modifier looses its object upon file reload
foreach_ID_link was missing treatment of GreasePencilHookModifierData
object.

Pull Request: https://projects.blender.org/blender/blender/pulls/118601
2024-02-22 10:16:56 +01:00
Aras Pranckevicius
b261654a93 VSE: Reduce playback stalls when new video clips start playing
When starting to play back a movie strip, there was a "oh, let's figure out if
this is a video file?" check, immediately followed by "let's initialize the
machinery to decode a video file". The first one is kinda redundant, since if
it will happen to not be a video file, the latter check will nicely fail.

Addressed that by removing (seemingly unused at all?) functionality from
`ImBufAnim`, now it is only used for video file playback. Details:

- It looks like `ImBufAnim` is only ever used to play back "video files", so
  remove all the other modes of operation from it ("image sequence").
- Which makes `ImBufAnim::curtype` be not needed, it only needs to store state
  of whether it's initialized already.
- Which means there's no need to call `imb_get_anim_type` (which does very
  costly `isffmpeg`) when starting to play ImBufAnim.
- Remove some other variables from `ImBufAnim` that were just flat out unused.

In Gold previs playback between 1:41-1:55, on Windows/Ryzen5950X:
- Slowest 3 frames went from 276, 195, 168ms -> 222, 174, 147ms (saves 20+ ms
  per frame). All of these frames are camera cuts where multiple new video
  clips start playing.
- In the whole playback, total amount of time taken by `imb_get_anim_type`:
  234ms -> zero! Since that is no longer used.
- There are still stalls when starting to play a movie clip, and that is
  actually initializing ffmpeg things. But now at least right before
  "initialize ffmpeg" there's no additional redundant work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118503
2024-02-22 09:24:35 +01:00
Omar Emara
2bd80f4b7a Realtime Compositor: Implement Legacy Cryptomatte
This patch implements the Legacy Cryptomatte node for the Realtime
Compositor. The only difference in logic between the new and legacy
Cryptomatte nodes is the source of the layers, so we share the same code
using a base class and specialize layer retrieval as needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118570
2024-02-22 07:39:42 +01:00
Campbell Barton
95a8731884 Extensions: treat dropping known repository prefixed URL's as extensions
extensions.blender.org is using redirects which which means the
file-extension can't be used to detect dropping extensions.
Add an additional check which tests the URL shares a prefix with a
known remote repository.
2024-02-22 12:59:50 +11:00
Hans Goudey
b3479a970a Cleanup: Use FunctionRef for outliner operation callback 2024-02-21 16:53:00 -05:00
Hans Goudey
7290950a5d Fix: Correct name for UV sculpt tool property 2024-02-21 16:53:00 -05:00
Jacques Lucke
a6f5b285d5 Merge branch 'blender-v4.1-release' 2024-02-21 22:24:57 +01:00
Jacques Lucke
a1b95f69fa Revert "Fix #116082: support changing interface socket bl_socket_idname"
This reverts commit 42faf9d242.

This caused #118529. Better figure out a fix first before committing this again.
2024-02-21 22:23:32 +01:00
Miguel Pozo
b9419afdbf Fix: EEVEE-Next: Viewport region sync 2024-02-21 21:21:12 +01:00
Aras Pranckevicius
f4f708a54f VSE: Skip rendering lower strips that are behind opaque strips above them
Often in previs setups, you have several "variations" of image/movie strips
for review, where the topmost one completely covers the others under it. VSE
rendering already had an optimization where if there's a fully opaque strip
that covers the whole screen, then the lower strips are skipped from
processing/rendering. However, it was not handling the case of non-fullscreen
strips (e.g. you'd have a Color strip near top & bottom for letterboxing, and
an opaque strip "in the middle").

This adds a simple "occluder tracking", and skips strips that are completely
covered by any single opaque strip that is above it (like outlined in #117790
task).

Playback of Gold previs between 1:42 and 1:55, on Windows/Ryzen5950X:
- Average frame time 28.5ms -> 23.8ms
- Median frame time 24.1ms -> 21.5ms
- Two slowest frames: 263->189ms, 194->178ms

Rendering the Gold previs movie: 325s -> 304s (93% of previous time)

Pull Request: https://projects.blender.org/blender/blender/pulls/118396
2024-02-21 20:16:44 +01:00
Clément Foucault
c3a2c536f8 EEVEE-Next: Do not use mip 1 for lightprobe sample in raytracing 2024-02-21 19:53:23 +01:00
Germano Cavalcante
db754790b7 Fix: snap gizmo state returning to default values after unhidden
This didn't present a problem currently because the measure tool gizmo
coincidentally uses the default snap settings.
2024-02-21 14:22:45 -03:00
Germano Cavalcante
6d491da0be Cleanup: miscellaneous improvements in knife code
- Remove unused members.
- Use C++ vector types.
- Rename variables.
- Avoid redundant calls.
- Pass the modified value as a function return parameter.
2024-02-21 14:22:45 -03:00
Bastien Montagne
4e544e5e59 Merge branch 'blender-v4.1-release' 2024-02-21 18:19:01 +01:00
Bastien Montagne
243f125fa2 Fix #107946: Blender crashes when relocating a library to another library that uses the same "2nd-level" library.
The issue here is that the `parent` pointer of indirectly linked
libraries would not be propoerly cleared when their current parent was
deleted.

Note that this fix will leave effectively indirectly linked libraries
shown as directly used ones in the UI, until the blendfile is saved and
reloaded. This is not a new issue though, deleting a parent library in
the Outliner has the same effect.
2024-02-21 18:17:27 +01:00
Harley Acheson
b02f0cf206 Refactor: Store BLF Glyphs in blender::Map
Store the GlyphBLFs in a blender::Map rather than our current hash
table, which is an array of 257 ListBases.

Pull Request: https://projects.blender.org/blender/blender/pulls/118528
2024-02-21 18:17:21 +01:00