Move BLI_convexhull_aabb_fit_points_2d to a public function to be able
to compare compare fitting one convex hull with a simple reference
method.
One test is disabled as it exposes an error in convex hull calculation
which needs further investigation.
The result of cross_poly_v2 was flipped compared with cross_tri_v2 &
cross_poly_v3 (with the Z values zeroed).
Ensure cross_poly_v2/3, cross_tri_v2/3 return compatible results and
updating the doc-strings noting that a negative Z is for clock-wise
polygons.
This adds two new constructors to `IndexMask`:
* `from_repeating(mask_to_repeat, repetitions, stride, initial_offset, memory)`:
It allows repeating an existing index mask with a stride.
* `from_every_nth(n, indices_num, initial_offset, memory)`: Creates an index
mask like `{0, 2, 4, 6, ...}`.
`from_every_nth` is implemented in terms of `from_repeating` which is optimized
to handle this case (and other cases) very efficiently.
Pull Request: https://projects.blender.org/blender/blender/pulls/118084
- Commands which have arguments split over multiple lines use
indented lines.
- Wrap lines where multiple commands run using "&&".
- Blank lines between multiple commands helps the text from becoming
too dense.
The iterations through the rows and columns where flipped.
This would cause invalid memory to be accessed and an assertion
error in debug mode.
Note: This is only fixing an error with non-square matrix printing
and has no effect on square matrices.
Pull Request: https://projects.blender.org/blender/blender/pulls/118076
When calculating the width of strings for the tooltip window size, enum
labels were measured using the string from the text_suffix field but
length from the text field. Introduced with std::string changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/118064
An allocated char pointer was reassigned without being freed.
Fix by replacing the error-prone combination of C strings and
std::string with a complete conversion to std::string. Also change
the logic a bit to allow moving the path string in some cases
instead of copying it.
Pull Request: https://projects.blender.org/blender/blender/pulls/118046
After bb080140c0, `SCULPT_pbvh_calc_area_normal` returned
std::nullopt when it didn't sample any vertices, instead of returning
an ignorable boolean return value. There was a false negative failure
though, because it didn't keep track of when it sampled BMesh "orco"
vertices.
This commit updates all defines, compiler flags and cleans up some code for unused CPU capabilities.
There should be no functional change, unless it's run on a CPU that supports sse41 but not sse42. It will fallback to the SSE2 kernel in this case.
In preparation for the new SSE4.2 minimum in Blender 4.2.
Pull Request: https://projects.blender.org/blender/blender/pulls/118043
5 years ago (18b693bdbd) part of cache rendering was converted to not
draw one quad at a time. However the other part (drawing strip
backgrounds when cache visualization is on) was left still drawing one
quad at a time.
Now that sequencer timeline drawing code has SeqQuadsBatch that batches
arbitrary number of things for drawing fairly easily, the existing
cache drawing batching code can be simplified to just use that, and
the background code changed from immediate quad drawing to use the
batcher.
Sprite Fright edit, whole timeline visible, all caches visualized and
full: `draw_cache_view` on Windows/Ryzen5950X goes 2.40ms -> 0.16ms.
And there's less code.
Pull Request: https://projects.blender.org/blender/blender/pulls/118027
Make the 'purge' operation show an interactive popup by default, with
a preview of the type and amount of data-blocks to be deleted.
Idea and initial UI/UX design are from @Harley (see PR !117242).
Pull Request: https://projects.blender.org/blender/blender/pulls/117304
Add a new `BKE_lib_query_unused_ids_amounts` to query expected amounts
of deleted IDs. This function does not tag IDs in main anymore.
Factorize most parameters (and output data) into a new struct
`LibQueryUnusedIDsData`.
Part of PR https://projects.blender.org/blender/blender/pulls/117304.
Avoids having yet another `switch` case over all ID types.
Note that we could also add a string to the IDTypeInfo, but imho this is
a bit too limited in scope/interest to expose this outside of the readfile
code.
Pull Request: https://projects.blender.org/blender/blender/pulls/117958
When reordering vertex groups on a mesh, some cloth properties would
get affected by another group, because they were based on group index
instead of name.
This issue was already handled by
`BKE_object_defgroup_remap_update_users()` for some properties, but
not all.
This commit extends the function for missing properties: Shrinking,
Shear, Internal Springs, Pressure, Self Colllisions and Object
Collisions.
Pull Request: https://projects.blender.org/blender/blender/pulls/114032
The transform system reacts to `CTX_GPENCIL_STROKES` in a special way
that is only useful in `SPACE_VIEW3D`.
There was a similar case fixed in 23e9ebfdbd, but there would be
multiple other places to also check the spacetype.
So now do this more generalized and only ever set `CTX_GPENCIL_STROKES`
if we are in editmode (that check existed before) **and** in
`SPACE_VIEW3D`.
Pull Request: https://projects.blender.org/blender/blender/pulls/118042