Hey everyone,
I hope this is the right place for this. I have been hacking away at Krita for quite some time now, trying to implement animated path shapes (KoPathShape, KoPathPoint, etc). As it stands now, moving points/shapes around at different keyframe times works and the animation docker tracks the movement of the path points fine, including the interpolation of each keyframe channel.
In the pictures you can see a simple path with two path points. One of the path points has its location and control point changing over time. Even when hovering over the curve it is being displayed where it should be as the time is changing
What is not working is the repainting of the interpolated shape when changing frames or letting the animation run. I’ve been digging around the code base for quite some time now, leaving me more confused the longer I read.
Shapes are contained within the KisShapeLayer, which has its own canvas (KisShapeLayerCanvas) which is used to project the shapes onto. Calling original() on the shape layer does return the projection of said canvas.
Now, the KisImage has a KisImageAnimationInterface which (to my understanding) calls upon the KisRegenerateFrameStrokeStrategy whenever frames are dirty such that they are being regenerated and updated for the frame cache that is used to play the animation. And here the updating/repaint of shape layers does not seem to happen, which is understandable as they haven’t featured any animated behaviour in the past.
For caching all frames for an animation, in KisRegenerateFrameStrokeStrategy::initStrokeCallback() the times for external layers are set for which later in doStrokeCallback() is called. In there all nodes are being visited and QRects are being computed with KisFullRefreshWalker::collectRects(•) which then are merged with a KisAsyncMerger.startMerge(•)
The KisAsyncMerger is using a KisUpdateOriginalVisitor to visit each layers original() method from which it fetches the region of interest and copies it to the cache? I can’t find where parts of the layers are actually refreshed. Do I need to refresh the shape layer when the KisUpdateOriginalVisitor is visiting?
On a different tangent, the canvas and its projection (KisPaintDevice) contained in each KisShapeLayer has its own KisPaintDeviceFramesInterface which is not being used from what I could see. Now I don’t know if cached versions of the shape layer would need to be stored in said interface or not.
Now I don’t know whether to create and populate a separate cache for shape layers or if its just a missing call to repaint the shapes on the shape layer to get functioning animated path shapes?
Many thanks in advance!
~orange


