Commit Graph

107074 Commits

Author SHA1 Message Date
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
Enrique-de-la-Calle
bd783c8c1b Fix #113812: disabled Bake simulation if cache is not enabled
Currently, baking to disk does not work when caching is disabled. So better
force the user to enable the cache before attempting to bake.

Pull Request: https://projects.blender.org/blender/blender/pulls/114601
2024-02-21 14:12:55 +01:00
Hans Goudey
f8cf609526 Cleanup: Use C++ Math functions 2024-02-21 07:57:56 -05:00
Omar Emara
44778bdf41 Compositor: Unify Denoise node between CPU and GPU
The CPU compositor always adds a filter for normal and albedo even if
they don't contain any data, that is, when they are not connected to
anything, by inflating a buffer with the editor value, which is not even
accesible to the user. In anycase, such a solid color will not help do
anything in the denoise operation.

This patch aligns the implementation by only adding the abeldo and
normal filter if they contain actual data, speeding up the operation in
the process.

Pull Request: https://projects.blender.org/blender/blender/pulls/118553
2024-02-21 13:23:04 +01:00
Julian Eisel
56fa8c59af Fix possible infinite recursion in asset catalog tree building
PR #118382 exposed an issue where creating a catalog with non-existing
parents would trigger an endless recursion. When creating the missing
parents, the tree would be rebuilt, which would again try to create the
missing parents, for which the tree would be rebuild, etc. It just
happend to work fine for creating single catalogs with existing parents.

Rather than rebuilding the tree immediately, tag the asset library as
having "dirty" catalog data, and let code requiring the up-to-date
catalog tree (node tool menus) ensure the tree is updated if needed.

The asset library loading API should be made clearer and generally
better defined/designed, currently it's all a bit messy & confusing.

Pull Request: https://projects.blender.org/blender/blender/pulls/118463
2024-02-21 13:02:37 +01:00
Aras Pranckevicius
e76b848697 Cleanup: Video: change bMovieHandle function to take ImBuf as input
Towards #118493: make movie writing functionality take ImBuf instead
of int* to pixel data.

While at it, make other bMovieHandle functions use "bool" return type
when it is strictly a success/failure result.

Pull Request: https://projects.blender.org/blender/blender/pulls/118559
2024-02-21 12:57:36 +01:00
Jason Fielder
eac8c381a0 Metal: Fix EEVEE sync issue on render
When a sync primitive signal existed
in its own command buffer, the command
buffer execution was skipped as the empty
flag was previously still set to true.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/118557
2024-02-21 12:53:42 +01:00
Aras Pranckevicius
31869d6857 Cleanup: ImBuf: remove various unused functions
IMB_double_x, IMB_double_y, IMB_double_fast_x, IMB_double_fast_y,
imb_filterx are not used by anything. Looks like they all come
from "initial revision, 22 years ago" and probably unused for decades.
2024-02-21 13:47:50 +02:00
Philipp Oeser
11db0b9dad Fix #118524: Loopcut crashes when not near an edge
Caused by 1c0f374ec3

When `EDBM_edge_find_nearest_ex` does not find a nearest edge in
`loopcut_mouse_move`, then  `loopcut_update_edge` will set
`RingSelOpData` `ob` to nullptr (rightfully so).

This would then crash in `ringsel_draw` (because we are trying to call
`object_to_world()` on the nullptr).

Prior to 1c0f374ec3 this was also "wrong", but
`EDBM_preselect_edgering_draw` would early out before using garbage
data.

Now guard against this and dont call `EDBM_preselect_edgering_draw` at
all if we dont have valid input.

Pull Request: https://projects.blender.org/blender/blender/pulls/118549
2024-02-21 12:38:06 +01:00
Campbell Barton
f6adf4b1c5 Extensions: support dropping file-paths
Dropping a zip file from the file-system now calls the drop function
which can use the "Install from Disk" logic.
2024-02-21 21:58:04 +11:00
Jeroen Bakker
e6eecdf614 EEVEE-Next: Voronoi colors are pure emissive
The voronoi texture node only sets the first 3 components of the
color. The alpha value is never set. Normally this is covered
when using it in a shader node, but when directly connected to
the AOV output, the color was stored as a pure emissive color.

This resulted in incorrect colors in the viewport and image renders.

This is a partial fix for #118494

Pull Request: https://projects.blender.org/blender/blender/pulls/118497
2024-02-21 11:32:29 +01:00
Falk David
543194db70 CMake: Add build option to disable experimental features
This adds an option `WITH_EXPERIMENTAL_FEATURES` which is `ON` by default.
Sometimes it's usefull to be able to turn off all experimental features
during development for testing purposes. This option is still enforced to be
`OFF` for release cycles other than `alpha`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118513
2024-02-21 09:57:40 +01:00
Omar Emara
c409f2f7c6 Compositor: Unify Blur operation across CPU and GPU
This patch unifies the implementation of the separable Blur operation
across CPU and GPU. The difference is due to the fact that the CPU code
ignores pixels that are across the image boundary and adjusts the
weights accordingly, while the GPU code assumes extended boundaries.

Like the rest of the Blur nodes the CPU implementation is adjusted to
assume extended boundaries until an option to change the boundary
condition is added. The alpha version of this operation will be handled
in a separate patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/118517
2024-02-21 07:31:14 +01:00
Omar Emara
69920a0680 Compositor: Use original hue in Hue Correct node
Currently, the Hue Correct node uses the adjusted hue when adjusting the
saturation and value of the input, so if the user adjusted the reds to
become blue, in order to change the saturation of the same area, one
would need to adjust the blues, which would overlap with the existing
blues.

This is contrary to how other compositing software like GIMP and Natron
do it, and it is less intuitive. So this patch changes the node to use
the original hue to the saturation and value curves as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/118487
2024-02-21 07:19:13 +01:00
Campbell Barton
01b1864604 Extensions: initialize default extensions repositories
Initialize a remote repository pointing to
https://extensions.blender.org and a local repository to use for
local (side-loaded) extensions installed from the file-system.
2024-02-21 16:15:03 +11:00