Files
test2/source
Falk David a1893bf5e1 Fix #139194: Grease Pencil: Crazyspace deformation broken when evaluated layers don't match original
When the layer tree in the evaluated state of the Grease Pencil object changed,
the code would fail to get the crazyspace deformation.

Currently we rely on a 1 to 1 index mapping of the original and evaluated
layers. For obvious reasons, this is very weak and can easily break.

The new implementation works as follows:
* Caller that wants to get the crazyspace deformation passes the evaluated and original
   object + the original drawing to get the deformation of.
* Fallback deformation are the original positions.
* If there are drawing edit hints in the evaluated geoemtry set, then
  * find the edit hint that corresponds to the original drawing
  * use the positions in the edit hint.

To create the drawing edit hints, we need to know what evaluated layer corresponds
to which original layer. Currently, this simply stores the original layer index on the
evaluated layer runtime data.

The solution is not ideal and there are some possible improvements like:
* Find a way to solve the more general case, e.g. when there are multiple original
  IDs involved.
* Propagate the "mapping" to original layers even when the type of geometry is
  changed, like going to curve instances and back.

Pull Request: https://projects.blender.org/blender/blender/pulls/139285
2025-07-08 12:11:42 +02:00
..