Commit Graph

107088 Commits

Author SHA1 Message Date
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
Michael Kowalski
2816ca4e0e Merge branch 'blender-v4.1-release' 2024-02-21 11:46:58 -05:00
Bastien Montagne
d5e2d96a8b Fix mistake in todays own LibQuery work (3fdae6e56d).
Forgot to also initialize new filtering callback in internal struct.
Did not cause any issue in practic, since this new feature is not yet used.
2024-02-21 17:25:39 +01:00
Hans Goudey
3759fb6e56 Cleanup: Move, copy construction and assignment to AssetWeakReference
Complete the rule of 5 for the asset weak reference class and remove
a separate copy function. While adding RAII behavior to a DNA struct
directly isn't so common, this seems better than doing it half-way.
2024-02-21 10:45:24 -05:00
Hans Goudey
1844ae2d0b Fix: Missing keymap for paint operators in curves sculpt mode 2024-02-21 10:34:27 -05:00
Falk David
572cac7a11 Fix #118404: Crash in grease pencil transform code
The code wrongly used the `ob_eval->data` to try and get the
`GreasePencil` data.
The `ob_eval` only needs to be used to access the transform
to get the `layer.to_world_space`
2024-02-21 16:24:01 +01:00
Michael Kowalski
1d0bbefbb7 USD: Fix varying interpolation import
This addresses issue #93052.

Now converting the USD "varying" interpolation type to
the "point" domain type when importing USD attributes.

There have been some inconsistent opinions in the USD
developer community about whether "varying" interpolation
is equivalent to "corner" or "point" domains for meshes.
However, DCCs such as Unity and Houdini assume that the
number of entries for attributes with "varying" interpolation
is the same as the number of points, and this change allows
Blender to import such assets without error.

Pull Request: https://projects.blender.org/blender/blender/pulls/118539
2024-02-21 16:07:17 +01:00
Sietse Brouwer
fc5e2b94bc Fix: GPv3: Functions like retrieve_editable_drawings can return duplicates
GPv3 utility functions `retrieve_editable_drawings()` and friends could
return duplicate drawings when multi frame editing is enabled and the
scene time is different than the selected frames.

This PR fixes that.

Pull Request: https://projects.blender.org/blender/blender/pulls/118566
2024-02-21 16:01:32 +01:00
Lukas Tönne
02687d7609 Fix #118334: Missing tags for GPv3 layers to update frames storage
Changes to the drawings array require an update of the `drawing_index`
stored in frames. Subsequently the frame storage data (for writing to
files) also needs to be updated. This was missing in the
`remove_drawings_with_no_users` function, which can lead to invalid
`drawing_index` after loading the file again.

A regression test has been added for this case.

Also fixed a minor memory leak when all the drawings are removed.
The drawing array ends up empty but still has a pointer allocated.
Fixes should avoid this (nullptr when `drawing_array_num` is zero) but
also make sure the array pointer is handled anyway instead of assuming
nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/118569
2024-02-21 16:00:52 +01:00
Falk David
53d9cd4bbb Fix: GPv3: Missing tags on the frames map
There were some places in the code that wrote to the frames,
but didn't tag the changes. This could result in the changes
getting lost when the file is saved (or changes getting lost during undo).
2024-02-21 15:20:26 +01:00
Bastien Montagne
0c8dd09e04 Core: Remove assert about non-Main tag for embedded collections.
Given current tag/flag handling situation (see also #88555 and #90610),
it is not yet possible to ensure matching tags between embedded data and
their owner ID. Furthermore, a non-main Scene should also tag its master
collection as non-main, so current test was not correct anyway.
2024-02-21 15:01:20 +01:00
Bastien Montagne
3fdae6e56d Core: LibQuery: Add a 'filter' callback to BKE_lib_query_unused_ids Api.
This will allow for more control over which ID should actually be marked
as unused/to be deleted.

Also some general minor cleanups and refactor, most notably:
* Add a constructor to internal `UnusedIDsData` struct, which can
  directly use the public `LibQueryUnusedIDsData` parameters struct.
* Add default values to trivial data in `LibQueryUnusedIDsData`.

No expected behavioral changes in this commit.
2024-02-21 15:01:20 +01:00
YimingWu
0dc617aac7 Fix #118492: GPv3: Noise modifier weight influence
The vertex weight influence was missing for grease pencil v3 noise
modifier due to missing API at first. Now added back.

Pull Request: https://projects.blender.org/blender/blender/pulls/118545
2024-02-21 14:59:06 +01:00
Germano Cavalcante
de4cb56165 Merge branch 'blender-v4.1-release' 2024-02-21 10:32:36 -03:00
Germano Cavalcante
bdc9767e09 Fix: wrong index returned for edge endpoints snapping
This value is not currently being used.
But it can cause problems for those who use Snap Gizmo in Python.
2024-02-21 10:31:18 -03:00
Sean Kim
28dae0c917 Sculpt: Add dyntopo size edit support for BRUSH and RELATIVE modes
This PR adds support for the `SCULPT_OT_dyntopo_detail_size_edit`
operator for the `Brush Detail` and `Relative Detail` modes,
replacing the old generic radial menu.

## Changes
* Triangle grid shown for all detailing modes
* Support for modal left / right scaling and sampling added
* Status bar updates with current value while editing the parameter.

## Limitations
* The brush size percent value is no longer shown in the 3D viewport
when using this modal.
This will be added with later functionality in #106243

Addresses #108111

Pull Request:
https://projects.blender.org/blender/blender/pulls/118403
2024-02-21 14:24:42 +01:00
Hans Goudey
eb484188dd Cleanup: Move asset filter settings out of DNA
There's no reason for this struct to be declared in DNA when it isn't
saved to files.

Pull Request: https://projects.blender.org/blender/blender/pulls/118285
2024-02-21 14:23:17 +01:00
YimingWu
2225ce8202 GPv3: Hook modifier
Migrates the Hook modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/118452
2024-02-21 14:20:47 +01:00