Future of the animation feature

Jouni Pentikäinen mctyyppi42 at gmail.com
Sat Jan 10 17:49:43 UTC 2015


Based on the discussion so far, I suggest we try the approach of adding 
time to KisImage.

I propose the following changes (grouped by class). A UML overview of 
these changes is available at https://creately.com/diagram/i3zzekbz1

KisImage
- Add field for current frame
- Add method to change current frame. This will call a similar method
   in the root node of the document.

KisNode
- Add field for keyframes (KisKeyFrameSequence)
   - This contains the keyframed data associated with the layer
- Add method to change current frame. This should recurse into all
   child nodes.
- Add method for creating a new keyframe at current frame. This will
   call writeKeyframe() to get the keyframe data
- Add virtual methods writeKeyframe and loadKeyframe to get and set
   data associated with keyframes. These will be implemented in the
   layer classes to provide and use parameters approriate for the given
   layer type.

KisKeyFrameSequence (new class)
- Contains a sequence of keyframes (KisKeyframe)

KisKeyframe (new class)
- Contains the data associated with a keyframe
- Data is arbitrary, as provided by the node. It is stored in a
   KisPropertiesConfiguration.
- For each property, there is also an associated interpolation mode.
   This can be used for defining interpolations of continuous functions
   such as layer opacity.

KisPaintDevice
- Add method to switch content, requesting the data from KisFrameCache

KisFrameCache (new class)
- Provides methods for loading raster data (e.g. content of a
   KisPaintLayer)
- Maintains a cache of recently used raster data

KisLayer
- Keyframe data:
   - Position
   - Opacity

KisFileLayer
- Keyframe data:
   - filename (for image sequences)

KisPaintLayer
- Keyframe data:
   - Raster content (trough paintDevice)

KisAdjustmentLayer
- Keyframe data:
   - Filter configuration

KisGeneratorLayer
- Keyframe data:
   - Filter configuration

KisMask
- Keyframe data:
   - Raster content (akin to KisPaintLayer)

KisFilterMask
- Keyframe data:
   - Filter configuration

KisTransformMask
- Keyframe data:
   - Transform parameters

KisAnimationDoc
- Refactor playback into UI code
- Refactor onion skinning into projection code (?)

KisAnimation, KisAnimationStore, KisKranimSaver, KisKranimLoader
- No longer needed


As a sidenode, not all of these changes need to be done at once. As long 
as the basic keyframing system is in place, any layer type which doesn't 
implement keyframes will behave as a static content. "Bells and 
whistles" such as adjustable interpolation curves can be added later as 
time allows.

The question of file format is still open. A fairly straightforward 
approach would be to serialize keyframes from each KisKeyFrameSequence 
and place them either in a separate entry inside the .kra document (e.g. 
keyframes.xml) or as a series of child nodes for each layer in maindoc.xml.



More information about the kimageshop mailing list