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
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).
`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
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
The file is easier to read and change when less context is needed at
each step. Also extract some complex-looking flag testing into a
separate function, and move some constant checks out of loops.
The Alembic importer can optionnaly interpolate vertex and matrix data.
To detect if two samples can be interpolated `get_weight_and_index`
needs to be called which output the interpolation weight and the indices
for the floor and ceil samples separately. Either the weight or the
indices could be used to determine if interpolation was needed.
This adds a `SampleInterpolationSettings` structure to hold the weight
and indices together so we don't need to manage multiple local
variables, and replaces `get_weight_and_index` with
`get_sample_interpolation_settings` which returns either a
`SampleInterpolationSettings` or nothing if no interpolation is
necessary.
This also modifies `AbcMeshData` to have an optional
`SampleInterpolationSettings` and removes members used for interpolation
from `CDStreamConfig`, which simplifies the latter structure as well as
the check in `read_mverts` to verify if interpolation is needed.
`get_config` also no longer needs a parameter for setting the now removed
`use_vertex_interpolation` member from `CDStreamConfig`. This was only
used for Mesh vertex interpolation despite also being set in the points
reader (which does not yet support any interpolation).
No functional changes.
Pull Request: #109155
* Renamed BKE_pbvh_raycast_project_ray_root to
BKE_pbvh_clip_ray_ortho for greater
clarity.
* BKE_pbvh_clip_ray_ortho no longer strictly clips
within the input ray interval. This is not necassary
for orthographic views and was too prone to floating
point error. The function is only called to clip
brush rays for orthographic views so this is acceptable.
Navigation operations, like those of the trackpad, are not modal and
therefore are confirmed on each call.
To prevent the transform operations from being updated in this case,
add a fake navigation flag.
The removal of this flag is postponed to the next call.
* Use pi factor to convert between radiant flux and intensity
* Mark lights as normalized on export
* Add spot light export support
* Add treatAsPoint support for import and export
* Empirically match normalized distant light
* Fix wrong unnormalized point/sphere/disk light unit in Cycles
Overall it should be much closer now for all light types. Point and distant
light units are inconsistent between renderers, so not possible to match
everything there.
Ref #109404
Pull Request: https://projects.blender.org/blender/blender/pulls/109795