Attribute Statistic node
================================
**Opening the test file currently gives a segfault, I'll fix this asap.**
**Status**: The implementation is ready and the speed is definitely usable. However currently all outputs are calculated even when the some of the sockets are not connected. For most operations this does not really matter because they're cheap, but finding `median` is relatively expensive, so it would be good to calculate it only when the socket is connected. Also in certain cases, the materialization of the attributes could then be removed.
Description
--------------------------------------------------
Current UI:
{F9913902}
Initial UI (for reference):
{F9600248}
Design
-------------------------------------------------------
The possible `data_types`:
- Float (`float`)
- Vector (`float3`)
Conversion to the `data_type` happens before calculating the statistic and is handled by `create_implicit_conversions`.
A few notes:
- all statistics are element-wise for `Vector`s
- `product` was not added because the it would very easily overflow
- it was decided to not add the `+` operator etc, to `Color4f` (see: https://developer.blender.org/D10269#inline-82590), so I've also removed support for the color data type in this patch too.
Benchmarks
----------------------------------------------------------
I've removed the benchmarks for now because I changed the implementation to completely sort the attribute span.
**Note about the full sort**: Sorting the entire span is only slightly slower that `std::nth_element` in a single thread, but sorting seems to scale better with amount of threads than std::nth_element. For certain spans e.g. the UVMap span, `std::nth_element` is terribly slow when executing multithreaded, and just sorting the entire array is much faster. Not sure what the cause could be, it looks like some kind of "soft deadlock" is happening, where the threads are competing for the same data during the median calculation.
File used for the benchmarks:
{F9935150}
{F9935154}