Commit Graph

105683 Commits

Author SHA1 Message Date
Clément Foucault
f2b3403145 EEVEE-Next: Gbuffer Read optimizations
This modify most shader using the GBuffer to use the
`ClosureUndetermined`. This in turn reduces the amount
of duplicated data in the `GBufferReader` structure.

The most important part is the usage of fixed array
indices to access the `GBufferReader.closures[]`.
This avoid the struct to be moved from local register
to device memory and remove a huge performance penalty.

Pull Request: https://projects.blender.org/blender/blender/pulls/116772
2024-01-07 04:46:25 +01:00
Clément Foucault
6f51d7332b EEVEE-Next: Refactor Raytracing to support arbitrary closure
This refactors the whole pipeline to be closure agnostic.

This mean we can have only one raytracing step that covers
any closure type. In practice, it means that there is
3 objects having 1 closure each with a different closure
types each, we can run the raytracing once.

This create a huge overhead during the tile classification
stage. This is fixed by #116772 and will be merged separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/116670
2024-01-07 02:52:04 +01:00
Hans Goudey
3eee758c2b Cleanup: Fix build warnings and errors after recent commits
- Add missing include for `std::function` without TBB
- Add include for math define reported in chat (couldn't reproduce that)
2024-01-06 09:06:20 -05:00
Hans Goudey
e90d844dd7 Cleanup: Grammar in comments
"it's own" -> "its own" again. Start new sentences properly.
2024-01-06 09:02:56 -05:00
Hans Goudey
5179e66756 Cleanup: Move array store files to C++ 2024-01-06 09:02:55 -05:00
Jacques Lucke
3b3b1bb1a7 Volume: move volume runtime data to separate allocation
The same is done for other geometry types. This allows us to use C++ types in
the run-time data more easily and avoids dumping runtime data into .blend files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116840
2024-01-06 13:26:59 +01:00
Guillermo Venegas
5b104fb3fa Cleanup: Silence warnings from 1254fee589
Introduced in 1254fee589

Also remove translation from CLOG statements.

Pull Request: https://projects.blender.org/blender/blender/pulls/116836
2024-01-06 06:53:42 +01:00
Jesse Yurkovich
75c71b78ba Cleanup: Use new OIIO valid_file API
Now that OIIO has proper `valid_file` APIs for the formats we care
about, and which take MemReaders, we can remove the code added to TIFF,
PSD, and PNG as part of 5cc8fea7e9.

Additionally, this change eliminates the recent console spew on startup
where the TIFF loader is asked to load non-TIFF files (it is based on
the ordering of the filetype array)[1]. We now make a `valid_file` check
during open to address this.

[1] `: Not a TIFF or MDI file, bad magic number 12150 (0x2f76).`

Pull Request: https://projects.blender.org/blender/blender/pulls/116826
2024-01-06 05:50:04 +01:00
Guillermo Venegas
1254fee589 IO: Add support for Drag and Drop to FileHandlers
Added support to Drag and Drop to file handlers, part of #111242.

If file handlers are registered with an import operator they can now be
invoked with drag and drop path data.

Import operators must either declare a `filepath` StringProperty or both
a `directory` StringProperty and a `files` CollectionProperty depending
on if they support single or multiple files respectively.

Multiple FileHandlers could be valid for handling a dropped path. When
this happens a menu is shown so the user can choose which exact handler
to use for the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/116047
2024-01-06 03:51:45 +01:00
Hans Goudey
09063a3632 Cleanup: Remove some indirect includes in common headers
The idea is to avoid mistakenly depending on indirect includes,
and avoid compile time overhead from unnecessary header parsing.

Pull Request: https://projects.blender.org/blender/blender/pulls/116664
2024-01-06 01:47:39 +01:00
Jesse Yurkovich
ae02096ad6 Cleanup: Warning fix
Fix warning introduced in b0db5363fa

Pull Request: https://projects.blender.org/blender/blender/pulls/116828
2024-01-05 22:44:46 +01:00
Aras Pranckevicius
423e54b000 VSE: Scopes improvements
- Improve the look of them, so they feel less like from year
  1998 (more details and images in the PR).
- Some of the scopes got slightly faster in the process, others
  stayed the same performance (details below).
- Remove VSE Scopes related data from SpaceSeq DNA, move it into
  runtime instead.
2024-01-05 22:03:03 +01:00
Jesse Yurkovich
b0db5363fa Cleanup: Use blender C++ containers for USD
Use Vector, Map, and Set as appropriate.

The remaining uses of the std:: types come from USD APIs.

Pull Request: https://projects.blender.org/blender/blender/pulls/116801
2024-01-05 20:35:55 +01:00
Hans Goudey
0a8129e0cf Cleanup: Make format 2024-01-05 13:59:07 -05:00
Hans Goudey
549a606383 Cleanup: Improve face corner variable name, simplify iteration 2024-01-05 13:26:22 -05:00
Hans Goudey
ecc3656f72 Cleanup: Move remaining draw geometry extraction code to C++ namespace
Overall the transition to C++ in the draw module is awkwardly half
complete, but moving more code to a C++ namespace makes cleaning up
this code in other ways much easier, and the next C++ cleanup steps
are clear anyway.
2024-01-05 13:26:22 -05:00
Hans Goudey
5b55c1dc10 Cleanup: Move five draw headers to C++ 2024-01-05 13:26:22 -05:00
Bastien Montagne
95b30b3516 Build: Ninja: Move 'Unity builds' to heavy pooljobs.
This commit adds a new helper to define expected properties when a
target needs to use the unity build feature.

That new helper does what was already done for existing cases, and in
addition add the target to the Ninja 'heavy' pooljobs if relevant.

Pull Request: https://projects.blender.org/blender/blender/pulls/116791
2024-01-05 18:35:48 +01:00
Sybren A. Stüvel
66cdc112fc Anim: Bone Collections, replace .move_to_parent() with .child_number
Instead of moving bone collections by absolute index, they can now be
moved by manipulating `.child_number`. This is the relative index of the
bone collection within the list of its siblings.

This replaces the much more cumbersome `collections.move_to_parent()`
function. Since that function is now no longer necessary (it's been
replaced by assignment to `.parent` and `.child_number`), it's removed
from RNA. Note that this function was never part of even a beta build of
Blender.
2024-01-05 16:54:46 +01:00
Sybren A. Stüvel
6444eeb14c Anim: test, improve bone collection name tests
The `expect_bcolls()` function now no longer calls the `EXPECT_EQ` macro,
but returns a `testing::AssertionResult` instead. The function call does
need to be wrapped in an `EXPECT_TRUE()` call now, but that also means that
any failure message points directly to the call site.
2024-01-05 16:54:46 +01:00
Omar Emara
9f076edf5d Fix: Filtering does not work in GPU compositor
Texture filtering does not work in the GPU compositor. That's because
filtering is set after textures are bound. It works in the viewport
compositor because the textures come pre filtered from the DRW texture
pool.
2024-01-05 17:38:10 +02:00
Hans Goudey
517feec7ea Cleanup: Improve some mesh topology map variable naming
Avoid unnecessary abbreviations like `pmap` or `vemap`.
2024-01-05 10:35:39 -05:00
Sybren A. Stüvel
d4ce5d6fc9 Anim: add RNA getter for bone_collection.is_visible_effectively
Add an RNA getter for `bone_collection.is_visible_effectively`. This
value could already be derived from other flags, but now that logic sits
in C++ and doesn't require duplicated logic in Python any more.
2024-01-05 15:33:56 +01:00
Sybren A. Stüvel
a9d9c3b116 Cleanup: Anim, typo fix
Typo fix in a comment. No functional change.
2024-01-05 15:33:40 +01:00
Germano Cavalcante
8460b67ef8 Fix #105460: Overlay "Backwire Opacity" is 0.0 in new 3D Views
The ability to adjust the "Backwire Opacity" was mistakenly removed in
version 2.93 (b365cc017a).

As this issue went unnoticed by most users, it appears reasonable to
completely remove this setting from the code.

By making this change, there is no longer a need to define a default
value for `View3DOverlay::backwire_opacity`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116799
2024-01-05 13:59:02 +01:00
Omar Emara
752e416813 Fix: GPU morphological feather erosion differ from CPU
The GPU implementation of the morphological feather erosion operator is
different from the CPU implementation. This is because the CPU does
erosion by doing dilation sandwiched between two inverse functions. So
this patch fixes the different by following the CPU implementation.
2024-01-05 14:21:31 +02:00
Omar Emara
581f2d3c7d Realtime Compositor: Aspect correct mask inputs
This patch implements aspect ratio correction for mask inputs if the
size mode is set to Render Size.
2024-01-05 14:02:19 +02:00
Hans Goudey
4a95ead054 Cleanup: Miscellaneous C++ changes to file handlers
- Move code to C++ namespace for blenkernel
- Remove unnecessary prefixes based on namespace change
- Remove use of `RawVector` for function-scoped static variable
- Use `StringRef` instead of char pointer
- Use safer `STRNCPY` instead of `strcpy` in tests
- Give span instead of vector to users of API

Pull Request: https://projects.blender.org/blender/blender/pulls/116808
2024-01-05 05:35:29 +01:00
Hans Goudey
709dcc50cf Cleanup: Use C++ math functions instead of macros
And remove the unused or now-unused macros.
2024-01-04 15:42:54 -05:00
Hans Goudey
53e2dcadec Cleanup: Remove unnecessary C default argument macro 2024-01-04 15:42:54 -05:00
Hans Goudey
d6cfd7d1f4 Cleanup: Remove unnecessary keywords from C++ headers
- Remove unnecessary `struct`
- Use `using` instead of `typedef`
- Remove `void` from `(void)` as function arguments
2024-01-04 15:07:48 -05:00
Hans Goudey
15ae8c3064 Cleanup: Move remaining window manager headers to C++ 2024-01-04 14:30:21 -05:00
Harley Acheson
1ccc958150 UI: Improved Confirmation Dialog for Clear Recent List
Add a nicer, more informative confirmation dialog to the recently-added
operator that clears the Recent File List.

Pull Request: https://projects.blender.org/blender/blender/pulls/116796
2024-01-04 19:31:32 +01:00
Harley Acheson
f40d4e0bda UI: Improved Operator Confirmations
Allow our current simple confirmations to be customized and extended
with callbacks, allowing different behaviors, different icons, and
showing more information. Makes no changes to any existing dialogs.

Pull Request: https://projects.blender.org/blender/blender/pulls/104670
2024-01-04 18:42:21 +01:00
Jonas Holzman
00ef4f9309 Fix: Do not show WM_OT_clear_recent_files on Splash
New operator to clear recent files list should show in the topbar list,
but not be shown on the Splash screen list.

Pull Request: https://projects.blender.org/blender/blender/pulls/116785
2024-01-04 17:50:03 +01:00
Philipp Oeser
5412bd48a9 Alembic: export render resolution on cameras
Blender's cameras don't have specific resolution configured to them,
instead they use the scene's resolution.
This is a problem when exporting a camera using Alembic. Other software
(like Houdini) expects the resolution parameters on the camera itself.

So now store the scene's resolution on each camera that is exported.
Since this is not part of the concept of a camera in alembic itself,
export these as `userProperties` in a way other software can read this.

Fixes #116375

Pull Request: https://projects.blender.org/blender/blender/pulls/116782
2024-01-04 17:49:28 +01:00
Sybren A. Stüvel
6cfbf9ef2f Anim: hierarchical visibility for bone collections
Bone collection visibility now respects their hierarchy.

A bone collection is only visible when it is marked as visible and all
its ancestors (so parents, greatparents, etc.) are visible. Root bone
collections have no ancestors by definition, and only consider their own
visibility.

The effective ancestors' visibility is stored on each bone collection,
in its `BONE_COLLECTION_ANCESTORS_VISIBLE` flag. This makes it possible
to determine the effective visibility from just the flags of the bone
collection itself.

The `BONE_COLLECTION_ANCESTORS_VISIBLE` flag is now stored, with the
other flags, in `BoneCollection::flags`. This means that it's stored in
DNA, even though it's derived data and should actually be stored in a
runtime struct. However, `BoneCollection` doesn't have any runtime
struct yet, and I don't feel that the introduction of this flag is a
good enough reason to introduce that just yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/116784
2024-01-04 17:43:16 +01:00
Christoph Lendenfeld
29ed7a69e6 Fix: Set active keying set menu showing wrong label
When opening the menu to set/change the
active keying set, the top entry would
show "Active Keying Set" (if there is one).
(Open the menu with Ctrl+Shift+Alt+I)

Clicking this option would unset the active keying set
though as pointed out by Nika Kutsniashvili in #115798

This PR fixes it by splitting the function that dynamically generates the enum.
The core of the function has been extracted, and only the section
that creates the entry for "Active Keying Set" has been changed.

It now reads "Clear Active Keying Set"

Pull Request: https://projects.blender.org/blender/blender/pulls/116189
2024-01-04 16:38:13 +01:00
Omar Emara
41ba876d78 Fix: Compositor Texture node ignores Z component
The compositor Texture node ignores the Z component. Fix that by
defaulting to zero Z and considering the offset and scale in the node.
2024-01-04 17:05:58 +02:00
Sybren A. Stüvel
29be81ec23 Anim: make RNA property bone_collection.parent writable
Moving a bone collection to another parent is now possible in Python by
assigning to `bone_collection.parent`.

Thanks to Sergey for the implementation.
2024-01-04 15:41:19 +01:00
Sybren A. Stüvel
6874c87747 Cleanup: Anim, insert section start/end comments
Insert section comments `/* \{ */` and `/** \{ */` to `armature.cc`.

No functional changes.
2024-01-04 14:55:05 +01:00
Sybren A. Stüvel
d12fa306f7 Refactor: Anim, rename function to ANIM_bone_in_visible_collection()
Rename `ANIM_bonecoll_is_visible(armature, bone)` to
`ANIM_bone_in_visible_collection(armature, bone)`, as that reflects the
actual functionality.

No functional changes.
2024-01-04 14:45:29 +01:00
Christoph Lendenfeld
86555838f1 Fix #116367: Scale snapping not working in Graph Editor
The issue was that the "Affect" options from the 3D viewport
were also used for the Graph Editor.
This was discussed in the Animation & Rigging module meeting.
https://devtalk.blender.org/t/2023-12-21-animation-rigging-module-meeting/32748

The consensus was that the Animation Editors should have their own copy of the "Affect" flags.

For this commit I opted for a more immediate solution that ignores the "Affect" flag in the animation editors.
The adding of the flag can be left for a feature PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116781
2024-01-04 14:03:57 +01:00
Omar Emara
d096927139 Compositor: Fallback to render size for viewing values
Fallback to the render size when a single value is connected to the
viewer node. Giving the user the ability to easily view values.
2024-01-04 11:12:45 +02:00
Philipp Oeser
472cf44166 Alembic: read velocities on Points
This is reusing the generic system from 128eb6cbe9 which at that time
was only done for the mesh reader and is now done for the point reader
as well.

This allows for rendering with proper motion blur for alembic points
(which of course are still imported as meshes - were just lacking the
velocity attribute) when directly rendering as points in Cycles.

Came up in #109185 (where instancing is used - which is still not
supported, this patch is just for direct point rendering in Cycles).

Unsure about the status of https://archive.blender.org/developer/D11591
but until that lands, having velocities for points sounds useful enough
to support this now.

Fixes #95945

Pull Request: https://projects.blender.org/blender/blender/pulls/116749
2024-01-04 09:25:24 +01:00
Harley Acheson
0b0e0601a1 UI: Recent Menu Previews
Recent Menu item tooltips showing details and preview image.

Pull Request: https://projects.blender.org/blender/blender/pulls/112644
2024-01-04 00:46:48 +01:00
Clément Foucault
0cda1f4c0d EEVEE-Next: Bypass shadow update pipeline if shadow is disabled
This avoid a lot of overhead but also allows smaller GPU
captures & replay.
2024-01-04 11:00:06 +13:00
Jonas Holzman
a1bcba0598 UI: Implement a Clear Recent Files List Operator
Add a "Clear Recent Files List" item to the bottom of the File / Open
Recent List.

Pull Request: https://projects.blender.org/blender/blender/pulls/116494
2024-01-03 21:26:15 +01:00
Aras Pranckevicius
10bea077ae Fix: VSE: image strip outline sometimes not matching image
This is only visible for very low resolution image strips; the math was
operating on integers as image size but doing division by two to get the
outline. For non-even image sizes the outline could be off by a pixel due
to rounding.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116605
2024-01-03 21:20:03 +01:00
Brecht Van Lommel
364beee159 Tests: add option to build one binary per GTest file
Bundling many tests in a single binary reduces build time and disk space
usage, but is less convenient for running individual tests command line
as filter flags need to be used.

This adds WITH_TESTS_SINGLE_BINARY to generate one executable file per
source file. Note that enabling this option requires a significant amount
of disk space.

Due to refactoring, the resulting ctest names are a bit different than
before. The number of tests is also a bit different depending if this
option is used, as one uses gtests discovery and the other is organized
purely by filename, which isn't always 1:1.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114604
2024-01-03 18:35:50 +01:00