← All ideas
  • Published 14 Feb 2019

Grease Pencil Interpolation Morphing

The Interpolation for Grease Pencil keyframes allows morphing between different strokes. That's great. If the count of points is different, points are discarded to interpolate. This is logical. It would be great if the algorithm would not throw away the points at the end of the stokes, but somewhere on the stroke. If the destination has twice as much points as the source discard every second point, not the second half of the stroke. This way really nice morphing transitions between different shapes would be possible.

Image

96.3%

Development Status: Done

jdreske
14 Feb 2019

3 Comments

Nelfie

I entirely agree with the idea, having this sort of adaptive interpolation would be tremendous. But at the same time, it seems also rather difficult to implement - I couldn't imagine of the top of my head what kind of algorithm could calculate which points to throw out in a very human way; moreso since the desired result will likely depend on the animators unique intentions in the first place.

There are, however, a few improvements that would probably work towards making the overall issue easier to deal with.

  1. Dealing with a shape's starting and ending point:

Interpolating two shapes that are very similar can still have tremendously different results depending on where their first and last points are. Now, making Blender automatically recalculate where each first and last point should be before interpolating would probably fall under the same difficulties as above. But there are two features that could help the user deal with it on their own in the meantime: A) a viewport option to highlight the first and last points of a selected shape in a unique color, so that the user can easily see where they are, and thus deduce whether interpolation might work as intended. This is important because even in an open shape, Blender makes a distinction between the "first" and the "last" point, and without this feature, the user might confuse the first point for the last, and the last for the first. B) a tool to "slide" the first and last points along a shape (or simply relabelling two other points as first and last). I might be wrong, but I'd assume that since even a non-cyclic shape behaves like a closed one that simply has no stroke strength and width between the first and last points, implementing such a tool should be possible.

  1. Recalculating the number of points between the first and the last, using another shape as hint:

Blender already has several pretty powerful simplifying and subdividing tools. I'd assume it should be possible to create a new one that would require to select two shapes, and would then proceed to adaptively simplify or subdivide the second until it reaches the same number of points as the first (with maybe a warning message if the process risks to modify the shape too much.) Or maybe both shapes are modified to find some sort of middle ground between the two?

2
matias.mendiola

Implemented in version 2.92 developer.blender.org/D9839

1
bernou.samuel

@jdreske This was posted a while ago. Have you got new lead with this idea ?

@Nelfie about your point 1 : You can already display the direction of the stroke with green and red dots.

about your point 2 : that's when things become complicated indeed. I think lines with lower point amount may be just always subdivided (in the newly created lines) to match the one that has the max number of points, so the interpolation stay "the most correct".
Still, the problem is that the distribution of those points may not be uniform on the line and using the homogeanous sampling may result in an unwanted line smoothing.
But without the line being evenly distributed I suppose it can work pretty nice already with a basic simple subdiv that doesn't alterate stroke aspect...

This older post present some nice ideas about inerpolations : blender.community/c/rightclickselect/Gycbbc/

Further thinking : This "adaptative" interpolation between 2 frames that are identical in strokes order isn't the real problem.
What is really hard (mentionned in the post linked above) is targetting the right strokes pairs between two frames that are'nt drawed the same way. First this need a good UX/UI, and most of all, storing this marking/tagging information !
I don't think we can store arbitrary information in the stroke object itself.

If we can save in a scene property a list of pointers to stroke objects that need to be paired this can be somewhat hacked... but I don't know if it's doable...