This is an alternative and more conventional solution for D7902
Basically each component of the old TransData is now separated
into more specific structs.
This patch was originally developed as a step to fix T70873 more
appropriately (reusing the struct TransData for mirror elements in
order to deduplicate code and simplify use).
(I was impatient and committed another solution for it).
Even though that bug has been solved, this patch still points out a
problem in the transform code, which is memory usage.
TransData is a struct allocated for each element affected in the
When proportional edit is enabled, all elements visible in the scene
have a respective TransData allocated.
This indicates that there is a TransData for each vertex, object,
particle or whatever.
However, TransData (in conjunction with TransDataExtension) has a
total of 41 members and a size of 608 bytes!
But for most transformations, we only need 24 bytes (int flag, float *loc, float iloc)
So we only need about 4% of the total size of the TransData struct for most of the transform modes.
That struct is oversized, and is an unnecessary waste of memory.
At the moment some arrays of unused structs are being allocated together.
They will be removed later if the idea of this solution is accepted.
A benefit of this patch at the moment is the performance, which even
though it does not save memory still presents some difference (~20%):
|Translate:||Single Struct:||Splitted Struct:|
|Rotate:||Single Struct:||Splitted Struct:|
|Scale:||Single Struct:||Splitted Struct:|