Commit Graph

101891 Commits

Author SHA1 Message Date
Jacques Lucke 17e2186dd9 Cleanup: fix missing include 2023-12-20 21:32:59 +01:00
Hans Goudey 19b46e0816 Cleanup: Make format 2023-12-20 14:54:50 -05:00
Harley Acheson 13208038da UI: Show "No results found" for empty searches
For menu and operator searches, and for File and Asset Browser
filtering, show "No Results Found" when there is nothing to show.

Pull Request: https://projects.blender.org/blender/blender/pulls/116201
2023-12-20 20:53:48 +01:00
Hans Goudey 4f8d584325 Cleanup: Inconsistent struct vs. class declaration warning 2023-12-20 14:14:11 -05:00
Miguel Pozo 7288201e96 EEVEE-Next: Partial World LightPath node support 2023-12-20 20:04:44 +01:00
Aras Pranckevicius 1be8b51b11 VSE: display audio waveforms by default
As outlined in #115274 design task, at this point VSE timeline audio
waveform processing/rendering is no longer a performance issue,
so make it on by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/116334
2023-12-20 19:51:23 +01:00
Hans Goudey edf8a776ac Cleanup: Use forward declarations to replace includes of BKE_attribute.hh
Remove most includes of this header inside other headers, to remove unnecessary
indirect includes which can have a impact on compile times. In the future we may
want more dedicated "_fwd.hh" headers, but until then, this sticks with the
solution in existing code.

Unfortunately it isn't yet possible to remove the include from `BKE_geometry_set.hh`.
2023-12-20 13:25:28 -05:00
Hans Goudey 7f24972911 Cleanup: Use accessor functions for point cloud positions 2023-12-20 13:25:28 -05:00
Hans Goudey 19001c9e6c Cleanup: Move attribute domain enum to C++ header, use enum class
Each value is now out of the global namespace, so they can be shorter
and easier to read. Most of this commit just adds the necessary casting
and namespace specification. `enum class` can be forward declared since
it has a specified size. We will make use of that in the next commit.
2023-12-20 13:25:28 -05:00
Hans Goudey 2618c1d71d Cleanup: Use utility to fill default attribute values
See f5adfa6acd
2023-12-20 13:25:28 -05:00
Bastien Montagne 25ab53a4af Cleanup: Remove LibOverride Template experimental feature.
This was added at the start of the project, as a way for the source
library to control what would be overridable by the user of the data
(production files).

The implementation never went beyond the experimental area, and only
exposed in the python API then. The idea has been superseeded by the
'cherry-pick' design, so there is no point in keeping this code any
longer.
2023-12-20 17:57:24 +01:00
Hans Goudey 399e8264e6 Cleanup: Remove unused paint struct
Also remove documentation of obvious function arguments.
2023-12-20 10:29:52 -05:00
Jacques Lucke 70a53a815e Cleanup: avoid openvdb include in general in common header 2023-12-20 15:59:44 +01:00
Jacques Lucke 59c84ee95b Cleanup: extract function to show missing openvdb error message 2023-12-20 15:58:56 +01:00
Jacques Lucke a72e7a220d Volumes: refactor volume grid storage
This refactors how volume grids are stored with the following new goals in mind:
* Get a **stand-alone volume grid** data structure that can be used by geometry nodes.
  Previously, the `VolumeGrid` data structure was tightly coupled with the `Volume` data block.
* Support **implicit sharing of grids and trees**. Previously, it was possible to share data
  when multiple `Volume` data blocks loaded grids from the same `.vdb` files but this was
  not flexible enough.
* Get a safe API for **lazy-loading and unloading** of grids without requiring explicit calls
  to some "load" function all the time.
* Get a safe API for **caching grids from files** that is not coupled to the `Volume` data block.
* Get a **tiered API** for different levels of `openvdb` involvement:
  * No `OpenVDB`: Since `WITH_OPENVDB` is optional, it's helpful to have parts of the API that
    still work in this case. This makes it possible to write high level code for volumes that does
    not require `#ifdef WITH_OPENVDB` checks everywhere. This is in `BKE_volume_grid_fwd.hh`.
  * Shallow `OpenVDB`: Code using this API requires `WITH_OPENVDB` checks. However, care
  is taken to not include the expensive parts of `OpenVDB` and to use forward declarations as
  much as possible. This is in `BKE_volume_grid.hh` and uses `openvdb_fwd.hh`.
  * "Full" `OpenVDB`: This API requires more heavy `OpenVDB` includes. Fortunately, it turned
  out to be not necessary for the common API. So this is only used for task specific APIs.

At the core of the new API is the `VolumeGridData` type. It's a wrapper around an
`openvdb::Grid` and adds some features on top like implicit sharing, lazy-loading and unloading.
Then there are `GVolumeGrid` and `VolumeGrid` which are containers for a volume grid.
Semantically, each `VolumeGrid` has its own independent grid, but this is cheap due to implicit
sharing. At highest level we currently have the `Volume` data-block which contains a list of
`VolumeGrid`.

```mermaid
flowchart LR
  Volume --> VolumeGrid --> VolumeGridData --> openvdb::Grid
```

The loading of `.vdb` files is abstracted away behind the volume file cache API. This API makes
it easy to load and reuse entire files and individual grids from disk. It also supports caching
simplify levels for grids on disk.

An important new concept are the "tree access tokens". Whenever some code wants to work
with an openvdb tree, it has to retrieve an access token from the corresponding `VolumeGridData`.
This access token has to be kept alive for as long as the code works with the grid data. The same
token is valid for read and write access. The purpose of these access tokens is to make it possible
to detect when some code is currently working with the openvdb tree. This allows freeing it if it's
possible to reload it later on (e.g. from disk). It's possible to free a tree that is referenced by
multiple owners, but only no one is actively working with. In some sense, this is similar to the
existing `ImageUser` concept.

The most important new files to read are `BKE_volume_grid.hh` and `BKE_volume_grid_file_cache.hh`.
Most other changes are updates to existing code to use the new API.

Pull Request: https://projects.blender.org/blender/blender/pulls/116315
2023-12-20 15:32:52 +01:00
Hans Goudey 5f527fdc89 Fix #116373: Error using foreach_get on MeshLoopTriangle loops
Turns out the array length needs to be set after the DNA.
2023-12-20 08:40:27 -05:00
Aras Pranckevicius 408bc52bed Cleanup: fix Linux/gcc build 2023-12-20 15:27:28 +02:00
Aras Pranckevicius b8ada36518 Cleanup: move image_intern.h -> .hh 2023-12-20 15:07:48 +02:00
Bastien Montagne 1ae10de6b2 Cleanup: Make all 'Experimental -> Debug' preferences OFF by default.
Form a logic PoV, it makes more sense to have all 'debug' options
disabled as the 'normal' situation.

This commit merely invert the RNA-exposition of two settings (Asset
Indexer and Override auto-resync).
2023-12-20 13:10:35 +01:00
Hans Goudey 8dd8f932e2 Cleanup: Rename Mesh loop_data to corner_data
Related to #110434, efbee2d606, 7c69c8827b
2023-12-19 20:39:05 -05:00
Clément Foucault ad6e68d12f Fix: EEVEE-Next: Lights do not render with Metal
Related to #116128. This is just a workaround and
not a full fix. There seem to be something bad in
the backend.
2023-12-20 14:32:12 +13:00
Hans Goudey efbee2d606 Mesh: Rename totvert, totedge, and totloop fields
Use the standard "elements_num" naming, and use the "corner" name rather
than the old "loop" name: `verts_num`, `edges_num`, and `corners_num`.
This matches the existing `faces_num` field which was already renamed.

Pull Request: https://projects.blender.org/blender/blender/pulls/116350
2023-12-20 02:21:48 +01:00
Hans Goudey 01dbe11ea6 Cleanup: Grammar, redundant "private" in class 2023-12-19 19:58:53 -05:00
Harley Acheson 6007838bb2 UI: Set Initial Background Color Darker
With the popularity of dark themes, and the fact that our default theme
is dark, make the initial background color (before the program fully
loads) a darker shade of grey. {0.25f, 0.25f, 0.25f} versus current
{0.55f, 0.55f, 0.55f}. Also set Windows class background brush to the
same color to remove a potential flash.

Pull Request: https://projects.blender.org/blender/blender/pulls/115968
2023-12-20 01:36:11 +01:00
Harley Acheson 25c69d20b9 Fix #116196: Edge selection with hidden Asset Shelf
When the Asset shelf is active but hidden, the mouse cursor will give
feedback about a moveable edge above the asset shelf area. This just
alters `region_azone_edge_poll` to check for edges belonging to
regions that hide with a previous region that is now hidden.

Pull Request: https://projects.blender.org/blender/blender/pulls/116233
2023-12-20 01:21:18 +01:00
Harley Acheson 5741f7b8a9 Fix #114461: Check Interactivity in button comparisons
Implementation of Julian Eisel's idea of including interactivity in
button comparisons to avoid bad label matches.

Pull Request: https://projects.blender.org/blender/blender/pulls/116228
2023-12-20 01:14:10 +01:00
Campbell Barton c455f76267 Cleanup: remove redundant casts, use const casts 2023-12-20 10:11:01 +11:00
Germano Cavalcante 9fbc096522 Fix #116342: crash when moving GP3 keyframe
Caused by 7f626e08e1

It is necessary to use a safer way to identify whether `TransData2D`
points to an int value.
2023-12-19 17:19:05 -03:00
Richard Antalik c9fc69d10b Cleanup: Fix build warnings introduced in e02eeaf888 2023-12-19 19:54:21 +01:00
Hans Goudey d093c9075d Cleanup: Check for null before copying datablocks
Avoid relying on the null check inside of `BKE_id_copy_ex`,
which shouldn't really be there.
2023-12-19 13:31:43 -05:00
Hans Goudey 2da88752be Cleanup: Avoid uninitialized variable warning 2023-12-19 13:31:42 -05:00
Philipp Oeser 55963c2811 Fix #116346: USD importer ignores camera near clipping plane
Seems the actual change somehow got swallowed in 7a9284107d / !112905
[the corresponding clamping comment is already there :)].

Now just add back.

Thx @Matt-M for the initial investigation.

Pull Request: https://projects.blender.org/blender/blender/pulls/116353
2023-12-19 19:00:11 +01:00
Aras Pranckevicius a95dd8438d VSE: add option to display half of audio waveform
Default is "full" waveform display. Adds overlay option to display absolute
value of the signal as upper half only. Part of design task #115274

Pull Request: https://projects.blender.org/blender/blender/pulls/116344
2023-12-19 18:52:38 +01:00
Aras Pranckevicius 4805b4f13f VSE: more intuitive UI control for waveform display mode
Use a more consistent radio selection for waveform display, not an
enum-radio hybrid. Part of design task at #115274

Pull Request: https://projects.blender.org/blender/blender/pulls/116336
2023-12-19 18:49:28 +01:00
Damien Picard faefaa4447 I18n: extract and disambiguate a few messages
Extract:
- Compositor error messages.
- `bUnitDef`s were broken after cleanup commit 2b77cd726d. Since each
  unit's "display name" is now preceded by a consistent "name_display"
  comment, the regex which extracts the unit is greatly simplified.
  It now relies on the presence of the comment instead of the struct
  order.
- "Preset" menu and "Apply Preset" button from the curveprofile
  template.
- Operator labels from the catalog context menu.

Disambiguate:
- "Bake Data": can mean "Which data to bake" (verb), or "The data that
  were baked" (noun).
- "Cache" in the Simulation Nodes panel is a verb, not a noun.
- "Mix" in the snapping menu is a noun, not a verb.
- "Top" and "Bottom" can mean the upper part of an object or the
  highest point or element of something like a menu or list.

Pull Request: https://projects.blender.org/blender/blender/pulls/115963
2023-12-19 18:41:09 +01:00
Aras Pranckevicius 4ef5d9f60f ffmpeg: optimize ffmpeg_postprocess
After doing regular movie frame decoding, there's a "postprocess" step for
each incoming frame, that does deinterlacing if needed, then YUV->RGB
conversion, then vertical image flip and additional interlace filtering if
needed. While this postprocess step is not the "heavy" part of movie
playback, it still takes 2-3ms per each 1080p resolution input frame that
is being played.

This PR does two things:
- Similar to #116008, uses multi-threaded `sws_scale` to do YUV->RGB
  conversion.
- Reintroduces "do vertical flip while converting to RGB", where possible.
  That was removed in 2ed73fc97e due to issues on arm64 platform, and
  theory that negative strides passed to sws_scale is not an officially
  supported usage.

My take on the last point: negative strides to sws_scale is a fine and
supported usage, just ffmpeg had a bug specifically on arm64 where they
were accidentally not respected. They fixed that for ffmpeg 6.0, and
backported it to all versions back to 3.4.13 -- you would not backport
something to 10 releases unless that was an actual bug fix!

I have tested the glitch_480p.mp4 that was originally attached to the
bug report #94237 back then, and it works fine both on x64 (Windows)
and arm64 (Mac).

Timings, ffmpeg_postprocess cost for a single 1920x1080 resolution movie
strip inside VSE:
- Windows/VS2022 Ryzen 5950X: 3.04ms -> 1.18ms
- Mac/clang15 M1 Max: 1.10ms -> 0.71ms

Pull Request: https://projects.blender.org/blender/blender/pulls/116309
2023-12-19 18:28:51 +01:00
Miguel Pozo 0e3dbcfae0 Fix: EEVEE-Next: Volume closure evaluation
Uninitialized data and missing weights after d73050114b
2023-12-19 17:59:12 +01:00
Richard Antalik e02eeaf888 Fix #115305: Sound equalizer not applied when rendering
This was caused by 5c76c7bf84, which only updated sound when tagged by
`ID_RECALC_AUDIO`. On undo or rendering, this flag is missing.

Update equalizer when recalc is flagged by `ID_RECALC_COPY_ON_WRITE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116282
2023-12-19 17:38:29 +01:00
Miguel Pozo a2317726ca Fix: EEVEE-Next: World.has_volume()
Regression from #115284
2023-12-19 17:25:16 +01:00
Hans Goudey a0f8a6dae8 Fix #116351: Assert in sculpt mode with no faces 2023-12-19 10:56:30 -05:00
Miguel Pozo b6fab947d1 Fix #114168: EEVEE-Next: Viewport image render sampling
Support sample accumulation in viewport image rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/116198
2023-12-19 16:13:45 +01:00
Miguel Pozo b1e83f8323 Draw: Reuse GPUViewport when doing viewport render animations
Allows supporting motion blur for EEVEE-Next viewport render animations.
It should also provide a slight performance improvement.

Pull Request: https://projects.blender.org/blender/blender/pulls/116199
2023-12-19 16:12:30 +01:00
Philipp Oeser 17acedf965 Cleanup: correct outdated comment 2023-12-19 15:54:32 +01:00
Jacques Lucke 5d610ad43a Fix #116308: muted nodes don't do type conversion correctly
A similar issue was fixed in the commit below for inserting implicit
conversions for links, but it wasn't corrected for conversions in
muted nodes.

Caused by e1d0d70911
2023-12-19 15:50:10 +01:00
Philipp Oeser cc03661686 Cleanup: comment style 2023-12-19 15:47:18 +01:00
Philipp Oeser 85bf6814c7 Fix #116325: crash assigning non-valid `material.paint_active_slot`
Similar to 64e955f522 (but extended a bit).

Fix by preventing access of non-existent (or out of bounds)
`TexPaintSlot`.

In the future, we should probably even prevent it further by using
`RNA_def_property_int_funcs` (but that is for a later commit).

Pull Request: https://projects.blender.org/blender/blender/pulls/116345
2023-12-19 15:46:03 +01:00
Hans Goudey 7c69c8827b Mesh: Rename MLoopTri variable names, and functions
Make the naming consistent with the recent change from "loop" to
"corner". Avoid the need for a special type for these triangles by
conveying the semantics in the naming instead.

- `looptris` -> `corner_tris`
- `lt` -> `tri` (or `corner_tri` when there is less context)
- `looptri_index` -> `tri_index` (or `corner_tri_index`)
- `lt->tri[0]` -> `tri[0]`
- `Span<MLoopTri>` -> `Span<int3>`
- `looptri_faces` -> `tri_faces` (or `corner_tri_faces`)

If we followed the naming pattern of "corner_verts" and "edge_verts"
exactly, we'd probably use "tri_corners" instead. But that sounds much
worse and less intuitive to me.

I've found that by using standard vector types for this sort of data,
the commonalities with other areas become much clearer, and code ends
up being naturally more data oriented. Besides that, the consistency
is nice, and we get to mostly remove use of `DNA_meshdata_types.h`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116238
2023-12-19 14:57:49 +01:00
Jeroen Bakker 3f33b06dde Fix #116229: Fix EEVEE GLitches on Legacy AMD Platforms
According to the issue not all legacy AMD platforms that required the
high quality normals workaround where enabled. I have not been able to
reproduce the issue due hardware availability.

This PR will enable the workaround for all HD ATI GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/116340
2023-12-19 14:35:28 +01:00
Julian Plak b85011aee0 Geometry Nodes: initial display of attribute values as text in 3d viewport
Previously, attribute values were only visualized as color overlay in the 3d viewport.
Now it's possible to optionally show the attribute values as text. This can be enabled
in the `Viewer Node` overlay settings in the 3d view.

This is just the first initial version. More work towards making it look better
will be done next.

Pull Request: https://projects.blender.org/blender/blender/pulls/115664
2023-12-19 13:30:16 +01:00
Jacques Lucke e0aa05996f Fix: normalize option not shown in noise texture node
Caused by f7e8021b2a.
2023-12-19 12:56:37 +01:00