Commit Graph

108628 Commits

Author SHA1 Message Date
Germano Cavalcante
93e47ad9a8 Fix #120744: Shrink/Fatten Even with Alt not working
Continuation of 3d6bb6ce04

This 'alt' hotkey is captured in the modal map
`TFM_MODAL_PASSTHROUGH_NAVIGATE` in order to appear in the header.
But this modal map is not necessary.
2024-04-17 12:25:00 -03:00
Hans Goudey
b547d82c47 Fix #120734: Light type selector icon missing
c28db1f0a0 exposed the wrong light enum publicly.
It was meant to be the one in `object_add.cc` with the icons.
2024-04-17 08:55:43 -04:00
Hans Goudey
6307e7011d Fix #120594: Mesh vertex position change in RNA missing update tag
With an addon like "animall" the `MeshVertex.co` property can be
animated. However, the animation system doesn't call the property's
update callback, meaning the cached normals aren't invalidated when
the positions change. In this case that is easy to fix by moving the
tag to the "set" callback, though that is not a general solution for
other properties where adding a "set" could cause a performance
regression.
2024-04-17 08:41:37 -04:00
Philipp Oeser
916c4fcdac Fix: Collada import assert with faceless prims
Importing `COLLADAFW::MeshPrimitive::LINES` would assert trying to get
the `material_indices` (these are on the Face Domain -- which does not
exist here).

To resolve, early out if we know we handle LINES.

Probably didnt happen before 45cff837bc

Stumbled over this looking into !120737

Pull Request: https://projects.blender.org/blender/blender/pulls/120738
2024-04-17 14:21:56 +02:00
Philipp Oeser
0bda626ba3 Fix #120721: Collada: Import with loose edges not immediately show them
Exposed by 1ea169d90e

Colladas `MeshImporter::mesh_add_edges` is a copy from `mesh_add_edges`
in `source/blender/editors/mesh/mesh_data.cc` (done in 2c05190374 --
there is a comment to deduplicate this into BKE, but this wont be done
in this patch).

However, as time passed there have been additions to the later, namely:

- 353fe610ed (clearing the mesh runtime caches)
- 12becbf0df (altering selection handling, guess this can be ignored
here since collada generally does not seem to select geometry)

So in order to resolve, now also clear the caches for collada as in
353fe610ed (even though just the subset of just `mesh->runtime-
>loose_edges_cache.tag_dirty()` would also be enough).

Pull Request: https://projects.blender.org/blender/blender/pulls/120737
2024-04-17 14:21:08 +02:00
Sietse Brouwer
91e50380d3 Fix: GPv3: Retrieving drawings for layer returns invalid layer index
The utility function `retrieve_editable_drawings_from_layer()` returned
a drawing index instead of a layer index. This PR fixes that.

Pull Request: https://projects.blender.org/blender/blender/pulls/120722
2024-04-17 13:15:47 +02:00
Clément Foucault
2e8b7d9dba EEVEE-Next: Fix compilation on metal 2024-04-17 12:30:48 +02:00
Clément Foucault
a9b6201381 EEVEE-Next: Make DoF reduce shader use less LDS
This is a cleanup / refactor to avoid using more LDS
and introduces 2 `barrier` calls instead.

All access to LDS are guarded behind accessor function
instead of Macro for readability.

This somehow fixes a GPU hang inside `tree_creature.blend`
when overlays (hdri sphere) are enabled + DoF.

Pull Request: https://projects.blender.org/blender/blender/pulls/120704
2024-04-17 11:23:11 +02:00
Clément Foucault
f2ae04db10 GPU: Implement missing UBO/SSBO bind tracking
This PR adds a context function to consider all
buffer bindings obsolete. This is in order to
track missing binds and invalid lingering states
accross `draw::Pass`es.

The functions `GPU_storagebuf_debug_unbind_all`
and `GPU_uniformbuf_debug_unbind_all` do nothing
more than resetting the internal debug slot bits
to zero. This is what OpenGL backend does as it
doesn't track the bindings themselves.

Other backends might have other way to detect
missing bindings. If not they should be
implemented separately anyway.

I renamed the function to `debug_unbind_all` to
denote that it actually does something related to
debugging.

This also add SSBO binding check for OpenGL as it
was also missing.

#### Future

This error checking logic is pretty much backend
agnostic. While it would be nice to move it at
`gpu::Context` level, we don't have the resources
for that now.

Pull Request: https://projects.blender.org/blender/blender/pulls/120716
2024-04-17 11:06:39 +02:00
Pratik Borhade
2154cf6dcb Fix: Menu search crash when no active base is present
Caused by 003489c693
Crash due to accessing `flag` member of null `base_act`.

Pull Request: https://projects.blender.org/blender/blender/pulls/120730
2024-04-17 10:51:01 +02:00
Jacques Lucke
c00c1b8e23 Geometry Nodes: remove experimental option for matrix socket and nodes
This makes the matrix socket and initial set of corresponding nodes non-experimental.
That means, they'll be part of the next release.

Pull Request: https://projects.blender.org/blender/blender/pulls/120539
2024-04-17 10:34:13 +02:00
Campbell Barton
f8197098c6 Cleanup: spelling in comments 2024-04-17 14:18:33 +10:00
Harley Acheson
15002ad384 BLF: Remove No Op Code in blf_str_offset_from_cursor_position
I added code in #120673 that included a line that is a no op. This
removes that code, replacing it with a comment to my future self why
I shouldn't do a particular thing that could break in an unlikely
state that won't happen for a while.

Pull Request: https://projects.blender.org/blender/blender/pulls/120728
2024-04-17 04:59:41 +02:00
Campbell Barton
01101dcaf9 Cleanup: use const references instead of copy-by-value 2024-04-17 11:36:44 +10:00
Campbell Barton
cf37424203 Cleanup: use const pointers, quiet cppcheck unreadVariable warning 2024-04-17 11:36:38 +10:00
Campbell Barton
8680976dc9 Cleanup: match function/declaration names 2024-04-17 11:36:36 +10:00
Campbell Barton
bfc8477a42 Cleanup: use ATTR_WARN_UNUSED_RESULT for allocating RNA functions 2024-04-17 11:36:35 +10:00
Campbell Barton
54e4cb8b0c Cleanup: clarify names for the a string and it's static buffer
Use the "_buf" suffix for a static buffer so it's not confused with
the value which should be used (which might not match the buffer).
2024-04-17 11:36:33 +10:00
Campbell Barton
0a8a3bc15a Fix misuse of RNA_struct_name_get_alloc
Callers to RNA_struct_name_get_alloc weren't accounting for allocation
which is unlikely as the fixed sized buffers used in these cases were
large.

- CTX_data_dir_get_ex & context_path_add_generic
  would use uninitialized stack memory.
- OverrideRNAPathTreeBuilder::build_path & ensure_entire_collection
  would leak memory.
2024-04-17 11:36:32 +10:00
Sean Kim
d3fb68f518 Icons: Add Sculpt gesture icons
This PR updates the main repo to contain the new icons from blender/blender-assets#4

Pull Request: https://projects.blender.org/blender/blender/pulls/120718
2024-04-16 23:11:16 +02:00
Harley Acheson
6091127a29 UI: Remove Redundant Hidden File Check for Linux/Mac
Removal of an unnecessary check for hidden "dot" files on Linux/Mac.
This check is not needed here because the same call is used earlier -
in filelist_readjob_list_dir - which would have set FILE_ATTR_HIDDEN
for dot files.

Pull Request: https://projects.blender.org/blender/blender/pulls/120711
2024-04-16 22:45:33 +02:00
Hans Goudey
38f70e9cf2 Cleanup: Use Span for despgraph build argument 2024-04-16 16:40:05 -04:00
Clément Foucault
3d59514729 EEVEE-Next: Fix discrepancy between lookdev and forward
They both use the same materials so they need the same
resources.
2024-04-16 20:10:07 +02:00
Clément Foucault
95996737c3 EEVEE-Next: Remove support for renderpass for forward opaque objects
This make the feature set harder to understand from a user
perspective. This removes a lot of code complexity.
2024-04-16 20:08:29 +02:00
Clément Foucault
5b1f5a5aa7 Cleanup: DRW: Remove uneeded dependency of debug shaders on draw_view
This fix a missing bind error for the debug draw
and print shaders.
2024-04-16 19:47:39 +02:00
Clément Foucault
d2df694439 EEVEE-Next: DoF: Avoid out of bound access in scatter vertex shader
As noted in the comment, it is very unlikely to happen.
But since we can run into undefined behavior if it does
better make the access safe.
2024-04-16 19:30:21 +02:00
Bastien Montagne
420508b235 Fix (unreported) LibOverride: Assert when clearing a liboverride.
The viewlayer was not properly ensured to be synced after a remapping in
the operator code.
2024-04-16 19:12:56 +02:00
Bastien Montagne
003489c693 Fix #120701: Overrides: Running Make Override operator in viewport without a selection created duplicates.
Forbid running liboverride operators when there is an active but not
selected object. Code is not designed to handle this case.
2024-04-16 19:12:56 +02:00
Bartosz Kosiorek
b1fb8eccb4 UI: Add tooltips to inputs of Color shader nodes
Pull Request: https://projects.blender.org/blender/blender/pulls/119576
2024-04-16 19:07:08 +02:00
Hans Goudey
2685c666ec Cleanup: Sculpt: Use C++ Set and Array for geodesic distances
Pull Request: https://projects.blender.org/blender/blender/pulls/120708
2024-04-16 18:43:31 +02:00
Hans Goudey
4fcc8f2320 Cleanup: Use FunctionRef for sculpt flood fill callback 2024-04-16 18:43:29 +02:00
Hans Goudey
8546449582 Cleanup: Sculpt: Move flood fill struct to namespace 2024-04-16 18:43:29 +02:00
Bastien Montagne
4dc53709b2 Fix #120703: Overrides: Missing 'override' Color overlay for some UI widgets.
Outliner's 'Restrictions' set of icon buttons would not show the
'liboverridden' teal-blue background.
2024-04-16 18:38:39 +02:00
Bastien Montagne
c3ee098c78 Fix #120655: GPv3: Conversion: invalid handling of generated 'offset radius' nodetree.
Previous code would re-create a node-tree everytime conversion code was
called (on main file read, but also on all link/append operations).

Worse, it would assing a local generated nodetree to converted linked
GPv3 objects.

This commit solves both issues in a similar way as what was done for the
legacy mesh 'auto smooth' generated node tree.

It also slightly refactors the conversion code by adding a single struct
containing all 'runtime' conversion data (two mappings currently). This
struct is then passed to internal conversion functions as reference.
2024-04-16 18:01:15 +02:00
Bastien Montagne
f465943872 Cleanup: GPv3 conversion: Remove unused public functions.
Not sure why, several functions exclusively used internally by the GPv3
conversion code were exposed in its header, made them static now.
2024-04-16 18:01:15 +02:00
Bastien Montagne
ddb2519339 BKE mesh legacy conversion: use new BKE_node_tree_add_in_lib when needed.
The creation of a special nodegroup for the legacy 'auto smooth'
conversion used to handle 'setting the library' part itself.

Use instead the recently introduce `in_lib` variants of ID creation API.

On top of simplifying the code, this commit also fixes 'linked'
generated nodetrees always getting a `.001` suffix added to their names.
2024-04-16 18:01:15 +02:00
Bastien Montagne
fda3900722 BKE node: Add a new in_lib function to create nodetrees within a library.
While not common, some places of the code (like readfile versionning)
may have to generate new IDs for linked data.
2024-04-16 18:01:15 +02:00
Miguel Pozo
cec57e9138 Fix: Draw: EEVEE-Next shadow flickering and other uninitialized bounds fixes
Always check if the DrawManager ObjectBounds are valid.
Initialized invalid bounds to NaN in debug builds for easier debugging.

Pull Request: https://projects.blender.org/blender/blender/pulls/120591
2024-04-16 17:19:13 +02:00
Julian Eisel
19dbcf5fc1 Assets: Speed up iterating over asset libraries
Essentially this avoids the file browser entry cache mechanism for when
we only want the list of assets, and don't need the preview image. The
speedup should become bigger the bigger the asset library is, see #120494.

When iterating over assets, we would do that through the `AssetHandle`
type, which is just a wrapper around a cached file in the file browser
backend (for historic reasons). So first we'd have to ensure this entry
is actually cached, which involved some lookups and a bunch of
allocations, which would easily add up.

In fact, for as long as we don't need the asset-handle (usually to get
the preview), we have the needed data easily available already, without
requiring a cached file in the file browser backend.

See the pull request for benchmark results.

Pull Request: https://projects.blender.org/blender/blender/pulls/120699
2024-04-16 17:08:49 +02:00
Aras Pranckevicius
9962c50b54 BLI: factor out BLI_path_has_hidden_component, fix it and speed it up
Factors out utility function "does the path contain any hidden file/folder
components?" function out of innards of UI code (edit_file,
is_hidden_dot_filename) into a BLI function BLI_path_has_hidden_component
and then:
- Adds unit test coverage to it, which uncovered some inconsistencies
- Fix the behavior inconsistencies:
  - A path component that is just a dot (.), was not considered hidden.
    Unless it was the first folder component (now this is fixed).
  - A path component that ended in a tilde (~) was considered hidden.
    Unless it was the first folder component (now this is fixed).
- Speedup the function by not doing several recursive scans over the
  string; instead all the logic is done in a single string scan.

Synthetic HasHiddenComponents_Performance test: 6.0s -> 1.1s for 50M calls
on Mac M1 Max.

More real world test (setup as in #120494): out of whole build_catalog_tree
time, the time taken by BLI_path_has_hidden_component drops from 37% down
to 28%

Pull Request: https://projects.blender.org/blender/blender/pulls/120541
2024-04-16 16:51:31 +02:00
Germano Cavalcante
5b7bc88571 Revert "Refactor: Select Engine: Draw actual indices instead of 'Original Indices'"
This reverts commit 157c4cfbc1.

Functions like `DRW_select_buffer_bitmap_from_circle` and
`DRW_select_buffer_bitmap_from_poly` need to be adapted too.
2024-04-16 10:22:52 -03:00
Hans Goudey
fda57f8e84 Fix: Vertex normal calculation broken in array modifier
Mistake in 6023a6a423
2024-04-16 09:14:50 -04:00
Brecht Van Lommel
07922a99e9 UI: Tweaks to collection export
* Remove embossing from preset / export / delete buttons.
   For example modifiers also don't have emboss for X, and presets
   never do. So it seems consistent.
* Remove duplicated preset buttons, only have the one in the header
  like other panels in properties editor.
* Use property separate layout without boxes for file path.
* Show info message when exporting a single or all collections,
  otherwise it's not obvious that something happened when clicking
  the button.

Pull Request: https://projects.blender.org/blender/blender/pulls/120667
2024-04-16 15:02:33 +02:00
Germano Cavalcante
157c4cfbc1 Refactor: Select Engine: Draw actual indices instead of 'Original Indices'
The selection engine renders `uint` texture where each element of the
geometry is represented as an index.

When the geometry have modifiers, the original index was used for the
texture.

However this is not necessary for the select engine to work. The real
mesh indexes can be used in the texture and, only at the end, the
original index can be retrieved on the CPU itself.

Advantages of this approach:
- Optimizes the code to generate selection buffers.
- Makes the select id texture more informative as it identifies the
  real elements instead of the original ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/119977
2024-04-16 14:58:01 +02:00
Jason Fielder
05cd235f90 FIX: EEVEE Next Non-shadowing directional light hang
Resolves GPU hang caused by erroneous processing of
directional lights which should not cast shadows.
Resolves GPU hang with the Tree Creature asset and
could possibly resolve #120038.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120696
2024-04-16 14:57:07 +02:00
Jeroen Bakker
f789619e65 Vulkan: Share descriptor set layouts between shaders
Previously all shaders had its own descriptor set layout handle. This makes it
difficult to see if currently bound resources can be reused when switching shaders.
To work around this limitation, the vulkan backend rebound the resources over
and over again.

This PR is part of the render graph where changing shaders can reuse previous
bound resources. This PR only makes sure that the layout handles are the same
so we can identify 'compatible' pipelines. The behavior to limit rebinding of
resources will be added as part of the render graph in a later commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/120562
2024-04-16 14:00:49 +02:00
Jacques Lucke
d1634b2a4a UI: support adding a search weight to menu entries for menu-search
The goal is to support better search experience in the cases where we want to
explicitly influence the ordering instead of relying only on general heuristics.
We used to support this already at some point I think, but not anymore since we
started using menu-search.

The implementation is fairly straight forward. It mainly just forwards the
search weight from the menu definition to the search code through various
required steps. The main annoying thing is that changing the signature of e.g.
`uiItemFullO_ptr` is fairly involved. Even using default parameters for these
functions is a bit annoying and becomes fairly unreadable and error-prone on the
call-site. For now, I worked around this by storing the search weight on the
`uiLayout` and to copy it to the `uiBut` from there. That seems preferable until
we have a better solution for adding parameters to all the `uiItem*` functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/120572
2024-04-16 12:18:45 +02:00
Omar Emara
757da9dbc1 Cleanup: Remove redundant compositor arguments
The compositor execute functions have a `rendering` argument to specify
if the compositor is executing as part of the render pipeline. But the
render context argument is null if we are not rendering, so the
`rendering` arguement is redundant and can be removed.

Additionally, we no longer use use_file_output as a hack to detect
rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/120659
2024-04-16 09:11:39 +02:00
Omar Emara
2cf8b5c4e1 Compositor: Improve interactivity for GPU compositing
This patch improves the interactivity of the GPU compositor for
interactive node tree edits by waiting on GPU work to finish to support
more granular canceling.

This does have a performance penalty, but it does not affect final
rendering and it seems worth it because even though it is slower it will
feel faster for users.

Pull Request: https://projects.blender.org/blender/blender/pulls/120656
2024-04-16 09:10:36 +02:00
Campbell Barton
ad48827244 Fix duplicate gpencil_sculpt_tool property in PAINT_OT_brush_select
Operator properties must be unique, this caused a warning generating
Python API docs.
2024-04-16 16:10:37 +10:00