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
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
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
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
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
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
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.
- 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
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
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
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`.
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.
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.
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
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
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
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
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
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.
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