Age | Commit message (Collapse) | Author |
|
|
|
This is meant to complement the `blender::math` functions recently
added by D13791. It's sometimes desired to template an operation to work
on vector types, but also basic types like `float` and `int`. This patch
adds that ability with a new `BLI_math_base.hh` header. Particularly
useful examples are `midpoint` and `interpolate`, but I'm sure others
will be added in the future.
Implementing the functions separately, rather than as `if constexpr`
branches in the existing header is meant to be more scalable, for
the possibility of even more math types in the future.
|
|
This patch reverses the dependency between `BLI_math_vec_types.hh` and
`BLI_math_vector.hh`. Now the higher level `blender::math` functions
depend on the header that defines the types they work with, rather than
the other way around.
This required changing the includes some files used from the type
header to the math implementation header. I took that change a bit
further removing the C vector math header from the C++ header;
I think that helps to make the transition between the two systems
clearer.
|
|
Use functions from the `math` and `std` namespaces instead
of from `BLI_math_vector.h`.
|
|
|
|
|
|
The root issue was caused by a mistake in modifier copy data which was
wrongly re-generating source modifier data identifier.
The c8cca8885181 simply exposed a bug in code which always was there
since the modifiers session UUID was introduced.
Shows an importance of const qualifier :)
|
|
|
|
|
|
Since now we delegate the evaluation of the last subsurf modifier in the stack
to the draw code, Cycles does not get a subdivided mesh anymore. This is because
the subdivision wrapper for generating a CPU side subdivision is never created
as it is only ever created via `BKE_object_get_evaluated_mesh` which Cycles does
not call (rather, it accesses the Mesh either via `object.data()`, or via
`object.to_mesh()`).
This ensures that a subdivision wrapper is created when accessing the object data
or converting an Object to a Mesh via the RNA/Python API.
Reviewed by: brecht
Differential Revision: https://developer.blender.org/D14048
|
|
This is requested by artist for some animation styles where is necessary to fill the area, but create a gap between fill and stroke.
Also some code cleanup and fix a bug in dilate for top area.
Reviewed By: pepeland, mendio
Differential Revision: https://developer.blender.org/D14082
|
|
The crash is caused as we did not check that the RNA pointer is null
before trying to use it. This moves the existing checks from the
modifier panels into the template functions so the logic is a bit
centralized.
|
|
|
|
The issue has two causes: on one hand origin indices were not handled
properly, on the other hand the extraction type (Mesh, BMesh, or mapped)
was not detected correctly.
For the second case reuse the MeshRenderData creation from the coarse
code path so that we make the same decisions. Loose geometry extraction
had to be updated to properly handle the BMesh cases.
For the origin indices, in some cases (for edges and faces), the arrays
used by the subdivision code already have the origin indices baked into
them, so mapping them a second time through the origin index layer is
wrong, and could cause out of bounds accesses.
For vertices especially, we would use two arrays: one for mapping
subdivision vertices to coarse vertices, and another one to map coarse
vertices to subdivision loops used for the selection index buffer. The
second one is now removed (which saves a bit of memory) as it is did not
have the proper data setup for use with the origin indices and we can
easily compute it using the first array anyway.
|
|
We do not always resync/replace the root ID of a hierarchy now that we
do partial resync.
|
|
|
|
lib_query/foreach_id code.
This will have to be backported to 2.93 and possibly 2.83 if possible.
|
|
|
|
Fix segfault when calling `some_id.id_properties_ui("propname").update()`,
i.e. call the `update()` function without any keyword arguments. In such
a case, Python passes `kwargs = NULL`, but `PyDict_Contains()` is not
`NULL`-safe.
|
|
|
|
|
|
Fixed by checking the requested pass, layer and view against the
previous used one.
|
|
IMA_GPU_REFRESH is replaced by
BKE_image_partial_update_mark_full_update and should not be used
anymore.
|
|
|
|
The Viewer marked the gpu texture to be out of date. But it should have used
the mark_full_update as the gpu textures
are only used by the render/draw engines.
The image/node editor uses the image engine that have its own GPU textures.
|
|
They have been replaced by clipping_uv_bounds. Using region_uv_bounds
could lead to problems when drawing the compositor backdrop.
|
|
Currently one a single texture slot is used to update the screen.
Current design is implemented to use multiple textures.
for now limit the number of texture slots to 1.
|
|
|
|
This node is a bit of a weird case, because it uses the value stored in an
output socket as an input. So when we want to determine if the Dot
changed, we also have to check if the Normal output changed.
A cleaner solution would be to refactor this by either storing the normal
on the node directly (instead of in an output socket), or by exposing it
by a separate input. This refactor should be done separately though.
|
|
Use using instead of typedef, remove redundant string init,
use "empty", address qualified auto, use nullptr.
|
|
Currently whenever gl queries are performed for the viewport, a large
1024 byte array is allocated to store the query results (256 of them).
Unfortunately, if any gizmo using a `draw_select` callback is active
(e.g. the transform gizmos), these queries (and allocations) will occur
during every mouse move event.
Change the vector to allow for up to 16 query results before making an
allocation. This provides enough space for every built-in gizmo except
Scale Cage (which needs 27 queries). It also removes unnecessary
allocations from two other related vectors used during query processing.
Differential Revision: https://developer.blender.org/D13784
|
|
This is a regression partially introduced in rB0a6f428be7f0.
Bones being transformed into edit mode were snapping to themselves.
And the bones of the pose mode weren't even snapping.
(Curious that this was not reported).
|
|
This fix avoid the drif checking if the previous position is equals to new one, in this case, the pen has not moved and can be canceled.
Differential Revision: https://developer.blender.org/D13870
|
|
Improve the nodes' drop shadow by making it scale with the view
and replace the loop for the alpha calculation with something more
explicit.
The amount of drop shadow softness was scaled with the zoom level
and therefore had a fixed screen space size. DPI and UI scale
weren't taken into account either. This patch fixes both issues by
basing the shadow softness on the `widget_unit` that scales correctly
in zoomable views and takes UI scale etc. into account.
Differential Revision: https://developer.blender.org/D13356
|
|
doversion.
Drivers make it way too easy to create dependenciy loops between IDs, so
need to use the same trick as in other dependency-following code in this
file to prevent those infinite loops.
hard to predict for sure how bad of a hierarchy root this can end up
producing, but in general cases think this should be OK.
|
|
Reduce compute effort of liboverrides resync process by only re-syncing
the parts of the override hierarchy that actually need it.
The main change compared to existing code (which was systematically resyncing
a whole override hierarchy), is that resyncing now operates over several
sub-hierarchies at once, each defined by their own 'resync root' ID.
This ensures that we do not get several new overrides for the same data inside
of the same hierarchy.
Implements T95682.
Differential Revision: https://developer.blender.org/D14079
|
|
This patch increases the performance when remapping data.
{D13615} introduced a mechanism to remap multiple items in a single go.
This patch uses the same mechanism when remapping data inside ID datablocks.
Benchmark results when loading the village scene of sprite fright on AMD Ryzen 7 3800X 8-Core Processor
Before this patch 115 seconds
When patch applied less than 43 seconds
There is still some room for improvement by porting relink code.
Reviewed By: mont29
Maniphest Tasks: T95279
Differential Revision: https://developer.blender.org/D14043
|
|
Adds helper functions to debug IDRemapper data structure.
`BKE_id_remapper_result_string` converst a given IDRemapperApplyResult
to a readable form for logging purposes.
`BKE_id_remapper_print` prints out the rules inside a IDRemapper struct.
|
|
|
|
Multithreaded tasks have to be isolated when holding a mutex, which was
missing for the generation of the subdivision wrapper.
|
|
|
|
|
|
Due to the freeing and re-creation of textures performed when binding
offscreen viewports, VR viewport textures would be needlessly
re-created every drawing iteration, leading to a negative impact on VR
frame rate.
This was brought to light by 6738ecb64e8b, which introduced an
additional texture clear operation on initialization and was
prohibitively costly on some systems when performed every frame.
Now, the textures for VR viewports will not be always re-created
during offscreen binding, but only when necessary using a pre-drawing
step (`wm_xr_session_surface_offscreen_ensure()`).
Reviewed By: jbakker, fclem
Differential Revision: https://developer.blender.org/D14059
|
|
|
|
For the majority of node groups created in Blender 3.0 the behavior does not change.
So far we only found a single file where this setting has an effect.
Differential Revision: https://developer.blender.org/D14078
|
|
We should change the API of ntree so we can check with a const. I added
this as a todo for now and used a const cast.
|
|
For an upcoming project we would want to match multiple id types in a
single go. To not replicate the implementation using other types we
introduce `BKE_library_id_can_use_filter_id` that returns all supported
types as a filter.
Not all ID types have a filter_id (ID_LI, ID_KE, ID_SCR) These
exceptions are not available in the filter_id function.
Reviewed By: mont29
Maniphest Tasks: T95279
Differential Revision: https://developer.blender.org/D14061
|
|
Also add BSD-2-Clause to SPDX license list.
|
|
|
|
|