The `groups_map` array (which indicates the group an element belongs
to) is only intended to reduce loops when creating groups, speeding up
that part of the code.
But on the downside, it requires more memory usage, and adds one more
step to access groups (`groups_offs[groups_map[i]]` instead of just
`groups_offs[i]`).
So removing that array decreases memory usage and speeds up access in
another part of the code.
The profile showed a +6% advantage when the Weld modifier affects large
portions of the mesh.
But it also showed a loss of around -0.6% in performance for cases
where the Weld modifier affects small parts of the mesh.
The biggest benefit is to save memory and speed up some cases.
The term capture is associated with video/screen capture.
Prefer the term backup as it's clear that information is stored
to support restoring it later.
Word ordering for wmTimer API wasn't consistent.
- Use "WM_event_timer_" / "WM_event_timers_" prefix.
- Rename "wm_window_timer" to "wm_window_timers_process"
because it wasn't clear what the function did from its name.
- Rename "wm_window_process_events" to "wm_window_events_process"
for consistency with "wm_window_timers_process".
Displaying the warning on file load depended on `wm->winactive`
being set, and didn't work when loading a file from the file-open
window or when loading files using a command-line argument.
Resolve using the first window as a fallback.
This happens to resolve#109770, although not freeing timers on exit
is likely to be an issue under other circumstances.
Sampling nodes produce fields, but can be used for
single values. If this used in simulation, this will not work
correctly, not similar as other singles. Just compute these
fields as single to store in Simulation Output node.
Pull Request: https://projects.blender.org/blender/blender/pulls/109879
The `BKE_bvhtree_from_pointcloud_get` function have requirements for
input point cloud argument and initialization of `BVHTreeFromPointCloud`
can be skipped. Due to `BVHTreeFromPointCloud` is not initialized by
default constructor, it can contains garbage data. To check if tree is
initialized field of `BVHTreeFromPointCloud`, return argument shouldn't
be ignored. `[[nodiscard]]` attributes is added.
Pull Request: https://projects.blender.org/blender/blender/pulls/109892
The Voronoi distance output is clamped at 8, which is apparent for distance
metrics like Minkowski with low exponents.
This patch fixes that by setting the initial distance of the search loop to
FLT_MAX instead of 8. And for the Smooth variant of F1, the "h" parameter is set
to 1 for the first iteration using a signal value, effectively ignoring the
initial distance and using the computed distance at the first iteration instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/109286
Although we had only 190 developers, the script
was accusing a total of 365 developers (with 188 inactive).
There were two problems here:
* The gitea API was only using the `limit` paramater when an explicit
page was passed.
* There was a bug with the get_next_page code, that would skip the last
page.
I now made the page always an explicit argument passed to fetch_single.
With this fix we now get: 190 developers with 98 inactive.
Doing so avoids having duplicated logic for working with pixel
data which is being passed throughout the render pipeline.
Notable changes:
- ImBug can now store GPU texture.
This is not very finished part of the API, which will be
worked further to support tiling for very-high-res images.
- Implicit sharing is removed from the image buffer, as it is
no longer needed.
There should be no functional changes on user level with this
change.
Ref #108618
Pull Request: https://projects.blender.org/blender/blender/pulls/109788
This isn't really helpful at this point, and is ugly/distracting when
starting Blender. It's not that bad if more menus show up with a
bit of a delay anyway.
The "No Cache" simulation nodes option effectively changes the cache
to work in a "realtime mode" where there are only two states, the
current and previous frame. Whenever the current frame doesn't
increase, the previous state should reset. This didn't happen
properly, and it was hard to verify because the code was shared
with the regular "cache on" mode.
Instead, separate the caching more in the code, using a different
struct to store the two "realtime" states. Also clarify that we
don't support animation of the "No Cache" option by disabling
support for that in RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/109741
Logic in FileBrowser and/or `BKE_blendfile_library_path_explode`
probably changed at some point, and the generic 'invalid filetype' error
message was reached before the path is compared to current blendfile path.
There's quite a few libraries that depend on dna_type_offsets.h
but had gotten to it by just adding the folder that contains it to
their includes INC section without declaring a dependency to
bf_dna in the LIB section.
which occasionally lead to the lib building before bf_dna and the
header being missing, while this generally gets fixed in CMake by
adding bf_dna to the LIB section of the lib, however until last
week all libraries in the LIB section were linked as INTERFACE so
adding it in there did not resolve the build issue.
To make things still build, we sprinkled add_dependencies wherever
we needed it to force a build order.
This diff :
Declares public include folders for the bf_dna target so there's
no more fudging the INC section required to get to them.
Removes all dna related paths from the INC section for all
libraries.
Adds an alias target bf:dna to signify it has been updated to
modern cmake
Declares a dependency on bf::dna for all libraries that require it
Removes (almost) all calls to add_dependencies for bf_dna
Future work:
Because of the manual dependency management that was done, there is
now some "clutter" with libs depending on bf_dna that realistically
don't. Example bf_intern_opencolorio itself has no dependency on
bf_dna at all, doesn't need it, doesn't use it. However the
dna include folder had been added to it in the past since bf_blenlib
uses dna headers in some of its public headers and
bf_intern_opencolorio does use those blenlib headers.
Given bf_blenlib now correctly declares the dependency on bf_dna
as public bf_intern_opencolorio will get the dna header directory
automatically from CMake, hence some cleanup could be done for
bf_intern_opencolorio
Because 99% of the changes in this diff have been automated, this diff
does not seek to address these issues as there is no easy way to
determine why a certain dependency is in place. A developer will have
to make a pass a this at some later point in time. As I'd rather not
mix automated and manual labour.
There are a few libraries that could not be automatically processed
(ie bf_blendthumb) that also will need this manual look-over.
Pull Request: https://projects.blender.org/blender/blender/pulls/109835
This commit implements the `VIEW3D_OT_ndof_orbit`,
`VIEW3D_OT_ndof_orbit_zoom`, `VIEW3D_OT_ndof_pan` and
`VIEW3D_OT_ndof_all` operators to the `ED_view3d_navigation_`
utility so that these operations can be used in the transform
operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/109792
- Deduplicate code;
- Support no customdata interpolation for edges;
- Reduce number of required elements in context arrays.
With 74772c6920, the merge by distance code for meshes now supports
optional interpolation of custom data for vertices.
As this can be advantageous for performance and memory, it seems
convenient to support the same for edges (and in the future polygons
and corners).
So this commit reworks the code that finds the edge groups to match the
same used for vertices and thus deduplicating and simplifying the code.
Conveniently the `edge_ctx_map` array is no longer needed and can be
removed to save memory.
However it was necessary to create another array (which is usually
smaller) called `double_edges` (to match `double_verts`).
---
**Results:**
The profiling result depends on some factors such as:
- interpolate or not interpolate customdata;
- affect a large or small portion of the mesh;
The best case is when the customdata **is not** interpolated and the operation affects **large** portions of the mesh:
| Before: | After: | Factor: |
| ---------- | ---------- | ------- |
| 1256.61 ms | 1073.218 ms| -14.44% |
The worst case is when the customdata **is not** interpolated and the operation affects **small** portions of the mesh:
| Before: | After: | Factor: |
| --------- | --------- | ------- |
| 1077.50 ms| 1086.7 ms| +0.85% |
Pull Request: https://projects.blender.org/blender/blender/pulls/109836
Clay strips was using it's own brush local matrix,
which wasn't quite compatible with texture matrices.
This could lead to brush textures not lining up with
the stroke dabs.
There was also a bug where the stroke was starting
20 pixels into the stroke, which is much higher than
necassary to derive the initial rake angle.
Notes:
* The clay strips brush now uses SCULPT_cube_tip_init
to calculate the local brush matrix.
* SCULPT_cube_tip_init now accepts custom brush location
and radius arguments.
* The mouse sample preroll used to calculate initial brush
rotation angle is now smaller than the update interval.
* Clay strips now supports tip_scale_x, which has also
been added to DNA defaults.
Slight speed up of face topology building for blur node.
Avoid using increment and replacing by adding size.
Multi-threading for accumulating offsets. Early returns
in one place places. In a test with a large grid, the node
became 36% faster, with 13 out of 40 ms saved from
the topology building.
Pull Request: https://projects.blender.org/blender/blender/pulls/109764
When switching shading between material preview and solid modes, the
world reflective light could become uninitialized. The reason was that
the world was only updated when they actually changed. When switching
it might not be the case that the world changed and the world probe
wasn't uploaded to the texture.
This fix will reduce the locations where this information was stored
(removing the `do_world_update` attribute in `ReflectionProbeModule`).
It also doesn't reset the `do_render` flag during syncing, but post-
pone it to the actual drawing.
Pull Request: https://projects.blender.org/blender/blender/pulls/109901
For overlapping regions, we currently offset the edge for resizing
regions a bit towards the contents. This makes sense for example in the
sidebar, where the region background is fully transparent by default,
and users expect the edge to be where the visible contents begin. This
was an issue in #104831 for two reasons:
- Although the region overlaps, we decided to make it fully opaque by
default. The offset is still applied, making the edge detection feel
broken.
- The offset would also be applied to header-like regions, where there
is not much padding between the edge and the content. So the edge to
resize the region would overlap buttons.
2 changes to address this:
- Only apply the offset if the region background is transparent-ish,
with a rather arbitrary alpha threshold.
- Do not apply the offset for header-like regions.
Pull Request: https://projects.blender.org/blender/blender/pulls/109753
The "Single file with all the views" message was not extracted because
it is an enum item that was not exposed to the RNA, but only
selectable in some cases depending on the
`RNA_def_property_enum_funcs()`.
This commit changes the `RNA_def_property_enum_items()` so that this
enum item is exposed to the RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/109876
Also fix some incorrect usages of `N_` macro instead of `TIP_` one
(these error messages typically need to get translated explicitely, not
only marked for extraction).
No user visible changes expected.
Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.
Adds a new class for edit bone elements.
Pull Request: https://projects.blender.org/blender/blender/pulls/109793
Using area-preserving mapping from cone to disk. Has somewhat distortion
near 90°.
The texture rotates with the transformation of the light object, can
have negative and non-uniform scaling.
Pull Request: https://projects.blender.org/blender/blender/pulls/109842
`use_ambient_occlusion` is a legacy property and not
connected to anything. The clip editor still write
to it for enabling the ambient occlusion renderpass.
This change will remove the legaccy option and
won't enable ambient occlusion pass anymore due
to visual and performance impact.
Pull Request: https://projects.blender.org/blender/blender/pulls/109783
The WITH_VULKAN_BACKEND/WITH_METAL_BACKEND should be included per
library. However when doing this we used an none existing compile
directive for WITH_METAL_BACKEND. This wasn't detected as
WITH_METAL_BACKEND is also defined globally.
Pull Request: https://projects.blender.org/blender/blender/pulls/109896
When using many reflection probes with different subdivisions
it can happen that the reflection probe uses texture space that
is already been allocated for another probe.
The cause for that is that negative shift operations result into
undefined behavior, this was fixed previously by clamping the
number of bit shifts to perform, but ignoring to shift into the
other direction
This change also includes `ProbeLocationFinder.print_debug`
for future debugging.
Pull Request: https://projects.blender.org/blender/blender/pulls/109823
At a glance, it can be hard to see if a Shape Key has been muted or not.
This change greys out all the UI elements, instead of just the current value number.
All the functionality still works the same, purely a visual change.
Pull Request: https://projects.blender.org/blender/blender/pulls/109857
Originally was noticed when adding drivers to a rigid body., but
it could potentially happen with any configuration.
The reason for the crash was that the ID which was modified was
not tagged as such.
Modifying drivers from the interface are likely tagging for updates
from the operator. This change makes it so the python function also
does tagging.
It is not really how one would design the system nowadays, but it
is how the Blender historically handles such cases. A bigger refactor
is possible to move tags to the places where modification actually
happens, but it seems to be a better idea to tackle it as a separate
project which will be considered no-functional-changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/109895
This PR fixes a compiler issue when using NVIDIA. It was introduced
when adding the reflection probes. NVIDIA compiler doesn't like
to access elements in a bound resource and pass it directly
as a parameter. It should first be added as a local variable.
Pull Request: https://projects.blender.org/blender/blender/pulls/109891