Commit Graph

120055 Commits

Author SHA1 Message Date
Ray molenkamp
39c901407e MSVC: Add cmake option for external manifests
This PR adds a cmake option `WITH_WINDOWS_EXTERNAL_MANIFEST`
which is off by default which addresses the following 2 problems:

The CI env occasionally fails to link the manifest into blender.exe
with mt.exe getting file in use error. The solutions mentioned online
vary wildly between, just rebuild, turn off your AV, use this magic
switch. None of them actually point to a root cause we can address.

When building blender with clang and the visual studio generator
it also somehow doesn't embed the manifest.

If the bots stay problematic this option can be turned on for the CI
environment, and will be automatically turned on when it detects clang
and the visual studio generator being used.

Pull Request: https://projects.blender.org/blender/blender/pulls/111683
2024-04-18 16:57:04 +02:00
Clément Foucault
42c77b2107 EEVEE-Next: UI: Improve volume lightprobe props name and tooltips 2024-04-18 16:48:41 +02:00
Germano Cavalcante
3fc29d8080 Fix #120239: Snap in edit mode is ignoring some self elements
Fix snapping issues caused by commit 1c77779160, where a mesh
representing the edited mesh was introduced.

Mesh snap to vertex now works in the following order:
- Snap to vertices of visible triangles
- Snap to vertices of loose edges
- Snap to loose vertices

The problem arises because in editing mode, faces whose vertices are
being transformed are ignored, marked as hidden in the snap, resulting
in the loss of some vertices in triangles.

The solution involves considering the edges and vertices of hidden
faces as loose elements since, despite being connected to faces, they
are still visible to snap. Two new types of BVHTree were created for
this purpose:

- BVHTREE_FROM_LOOSEVERTS_NO_HIDDEN
- BVHTREE_FROM_LOOSEEDGES_NO_HIDDEN

This modification addresses two related issues:
- snapping in edit mode to vertices and edges of a face being
  transformed
- snapping to mesh with hidden loose elements

Optionally, the first issue could be tackled separately by generating
BVHTrees within the snap system itself and storing them in a
`SnapCache_EditMesh *em_cache`, then passing this cache as a parameter
to the `snap_object_mesh` function.

Pull Request: https://projects.blender.org/blender/blender/pulls/120270
2024-04-18 16:48:19 +02:00
Hans Goudey
b5a82cd722 Cleanup: Unify UV sculpt radius variable naming
Also use const arguments
2024-04-18 10:28:34 -04:00
Jeroen Bakker
e84ab459c7 Vulkan: Use std::endl in vk_to_string
Trying to narrow down why some tests are failing on windows, but not on
linux/mac. These tests use a string compare. This PR adds two modifications
to the current vk_to_string.

- use `std::endl` although not required, it is important to portability
- print vulkan handles in a uniform way.

Pull Request: https://projects.blender.org/blender/blender/pulls/120780
2024-04-18 16:09:26 +02:00
Clément Foucault
f0b1eca9ee Cleanup: EEVEE-Next: Remove unused define 2024-04-18 14:39:10 +02:00
Pratik Borhade
f1955e1c57 Fix #120393: Outliner: Inconsistent dim on hidden items
non object tree elements are not faded in outliner when object or parent
collection is hidden. So in case of non ID_OB, call `element_should_draw_faded`
and pass parent tree element as argument to decide the fade status.
Also faded the icons and hierarchy lines.

Pull Request: https://projects.blender.org/blender/blender/pulls/120397
2024-04-18 14:05:19 +02:00
Hans Goudey
d95b1f120b Mesh: Store BMEditMesh in shared pointer
The main motivation for this is that it's part of a fix for #113377,
where I want to propagate the edit mesh pointers through copied
meshes in modifiers and geometry nodes, instead of just setting the
edit mesh pointer at the end of the modifier stack. That would have
two main benefits:
1. We avoid the need to write to the evaluated mesh, after evaluation
  which means it can be shared directly among evaluated objects.
2. When an object's mesh is completely replaced by the mesh from another
   object during evaluation (with the object info node), the final edit
   mesh pointer will not be "wrong", allowing us to skip index-mapped
   GPU data extraction.

Beyond that, using a shared pointer just makes things more automatic.
Handling of edit mesh data is already complicated enough, this way some
of the worry and complexity can be handled by RAII.

One thing to keep in mind is that the edit mesh's BMesh is still freed
manually with `EDBM_mesh_free_data` when leaving edit mode. I figured
that was a more conservative approach for now. Maybe eventually that
could be handled automatically with RAII too.

Pull Request: https://projects.blender.org/blender/blender/pulls/120276
2024-04-18 13:52:20 +02:00
Clément Foucault
998d0796e4 Fix: EEVEE-Next: Volume Probe: Missing binds in baking
Might fix a few issues related to baking.
2024-04-18 12:48:20 +02:00
Jeroen Bakker
189113c727 Cleanup: Move vulkan specific tests in tests folder
When reviewing the render graph core PR, we discussed where specific
backend tests should be located. The code style is clear that it
needs to be located in a tests folder next to the code it tests.

This PR moved the tests folder from next to the files they test to
a tests folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/120777
2024-04-18 12:47:23 +02:00
Clément Foucault
23348d4a5c GL: VertBuf/IndexBuf: Add missing SSBO bind tracking
Fix false positive errors with `--debug-gpu`.
2024-04-18 12:33:42 +02:00
Clément Foucault
c601569702 Fix: EEVEE-Next: Displacement: Revert object scaling on output
This was introduced by f371624b2e
but this breaks the render test. Need another approach to match
cycles with object scaling.
2024-04-18 12:30:03 +02:00
Clément Foucault
5b3bf8f4c9 Fix: EEVEE-Next: Volume: Missing nullptr checks
This was a misusage of the API as it is clearly
written that these functions can return `nullptr`.

Fixes #114131
2024-04-18 12:21:16 +02:00
Clément Foucault
d31b459927 GL: UniformBuf: Fix wrong positive missing resource error
This happened when the buffer was bound as a SSBO as the
slot was not marked as used.

We do not tag the unbind as we never call `unbind` for
SSBOs. Also we don't track what target type the UBO is
bound to. This could be improved later.
2024-04-18 12:21:16 +02:00
Jeroen Bakker
076ca1530a Vulkan: Cleanup debugging tools
- Removed ignored message ids as this is also part of vkconfig which should be used
  This is also adviced by the Vulkan Tools WG.
- Also initialize logging when platform doesn't have debugging extensions.

Pull Request: https://projects.blender.org/blender/blender/pulls/120776
2024-04-18 12:00:35 +02:00
Sergey Sharybin
2b475272a0 Cleanup: Unused parameters and function warnings on macOS
Pull Request: https://projects.blender.org/blender/blender/pulls/120775
2024-04-18 10:33:10 +02:00
Campbell Barton
7047715c6b Fix #104798: Slow frame-change with objects in the scenes collection
Avoid re-copying the scene when the scene is tagged for frame change.

For scenes with many objects scrubbing & jumping between first/last
caused noticeably worse performances.

Resolve by:

- Returning false from need_tag_cow_before_update when the recalc flag
  is ID_RECALC_FRAME_CHANGE.
- Change deg_graph_tag_parameters_if_needed to consider
  ID_RECALC_FRAME_CHANGE a clean flag.

Ref !104801
2024-04-18 13:49:18 +10:00
Campbell Barton
9cb3a17352 Linux: freedesktop support for file type association
Support freedesktop file association on Linux/Unix via the command line
arguments: `--register{-allusers}` `--unregister{-allusers}` as well
registration actions from the user preferences.

Once registered, the "Blender" application is available from launchers
and `*.blend` files are assoisated with the blender binary used for
registration.

The following operations are performed:

- Setup the desktop file.
- Setup the file association & make it default.
- Copy the icon.
- Setup the thumbnailer (`--register-allusers` only).

Notes:

- Registering/unregistering for all users manipulates files under
  `/usr/local` and requires running Blender as root.
  From the command line this can be done using `sudo`, e.g.
  `sudo ./blender --register-allusers`.
  From the GUI, the `pkexec` command is used.

- Recent versions of GNOME execute the thumbnailer in a restricted
  environment (`bwrap`) requiring `blender-thumbnailer` to be copied
  into `/usr/local/bin` (synlinks don't work).
  So thumbnailing copies the binary rather than linking and only works
  when registering for all users.

Ref !120283
2024-04-18 11:19:00 +10:00
Campbell Barton
c0e4de8457 PyAPI: support evaluating an expression as a string or None
Utility functions will be used as part of !120283.
2024-04-18 10:35:51 +10:00
Hans Goudey
4666af64a6 Cleanup: Geometry Nodes: Use accessor function for bmain 2024-04-17 16:19:28 -04:00
Hans Goudey
18c5e99f92 Cleanup: Geometry Nodes: Use accessor function for self object 2024-04-17 16:18:58 -04:00
Hans Goudey
29ac593363 Cleanup: Use C++ Vector for color band samples 2024-04-17 12:51:36 -04:00
Hans Goudey
f39c30dc60 Cleanup: Move eyedropper_colorband.cc to proper C++ namespace 2024-04-17 12:51:36 -04:00
Hans Goudey
504992cb0e Fix #120302: Color Ramp eyedropper update crash
Caused by c5d855b497 `eyedropper_colorband_init` wasn't
updated for the change from `UI_but_funcN_set` to `UI_but_func_set`
in `colorband_buttons_layout`.

Now store the RNA pointer and property in the button itself to avoid
the error-prone use of `func_argN`.
2024-04-17 12:51:36 -04:00
Hans Goudey
5b040b12ea Cleanup: Decrease variable scope in UV sculpt 2024-04-17 11:56:05 -04:00
Hans Goudey
46c35b1690 Cleanup: Use switch for UV sculpt tools 2024-04-17 11:56:05 -04:00
Hans Goudey
a19005efb0 Cleanup: Return early in UV sculpt 2024-04-17 11:56:05 -04:00
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