WIP: Fix #112395: Transform with Proportional Influence in Graph editor only works horizontally #112401

Draft
Germano Cavalcante wants to merge 1 commits from mano-wii/blender:transform_graph_PET into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

1 Commits

Author SHA1 Message Date
Germano Cavalcante 5998e0d847 Fix #112395: Transform with Proportional Influence in Graph editor only works horizontally
Support proportional editing in the Graph editor in both the X and Y
directions.

---
This problem has already been reported other times (See for example #80716).

There is also an alternative solution that involves scaling the circle that indicates proportional transformation in the Y direction (https://archive.blender.org/developer/D9023).

The solution proposed here is to support the influence as indicated in the circle (either in the X or Y direction).

To address this, the distance calculation originally implemented in `transform_convert_graph.cc` has been removed. This previous calculation was not only inefficient, having a time complexity of O(n^2), but it also only considered the X direction.

Additionally, a value for `t->aspect` had to be obtained and used as a Y-factor to calculate distances as they are visually perceived. But note that, if navigation during transformation is supported in the Graph editor, these distances with aspect cannot be updated.

So in summary.
Benefits:
- The drawing of the Porportional Influence circle better matches what is transformed
- Avoids unintentional or non-visual transformations (if the points are outside the region).
- Code removal and optimization.

Disadvantages:
- Some users may prefer the previous behavior.
- Since the aspect is used to calculate distances, if someday navigation while transforming is supported in the Graph editor and this changes the aspect, this cannot be reflected in the distances calculated for Proportional Influence.

Alternative:
- Support Proportional Influence in the Y direction, but always use the aspect [1, 1]. The drawing of the circle would change depending on the aspect.
2023-09-14 23:52:40 -03:00