GSoC/2021/StatusReports/SanthoshAnguluri

From KDE Community Wiki
< GSoC‎ | 2021‎ | StatusReports

Krita: Collective operations over multiple layers/groups

Krita is an opensource professional digital painting program. In Krita, artists can work on different layers and group those layers conveniently for a single artwork. Many a time, it is expected to do similar operations over a set of layers/groups. This project focuses on implementing few basic operations over a set of layers/groups. By the end of GSoC, Krita should be able to perform cut, copy, paste, delete operations over multiple layers and groups in a single stroke.

Project Goals

  • Delete paint data over all selected layers
    • STATUS: DONE
  • Delete operation on a group layer deletes paint data of all layers belong to the group
    • STATUS: DONE
  • Cut/Copy selected layers with their new version to the clipboard
    • STATUS: DONE
  • Re-implement existing paste factories to work seamlessly with the new design
    • STATUS: DONE
  • Documentation for aforementioned features
    • STATUS: DONE

Mentors

Progress Report

Multi layer/group deletion

The idea is with an active selection on canvas, the delete operation should delete the selected area in all the selected layers and recursively apply to the children layers as well. This includes re-implementing clearImage in KisToolUtils class. However, such recursive deletion would also delete data on children masks as well. This is not a user expected response. So, my mentors suggested me to apply delete on explicitly selected masks only.

Blogpost: GSoC’21: Week 1-3 with Krita

Commits

Layers into clipboard

With an active selection on canvas, the KisCutCopyActionFactory is made to create a duplicate layer for each selected layer. These duplicate layers are then added to a temporary KisImage. The new duplicate layers are processed to crop the paint data to the active selection area. This is done by ActionHelper. These processed layers are then saved into clipboard preserving the order of original layers.

Few variants of making duplicate layer:

  • In case of vector layer, a paint layer with its projection is made and processed with ActionHelper.
  • Duplicates of masks are not processed before saving in clipboard.

For cut operation, original layers are deleted as mentioned above.

Blogpost: GSoC’21: Week 4-7 with Krita

Commits

Paste Factories

The paste factories that defines each paste action retrieve the data saved in the clipboard. Now KisPasteActionFactory pastes all the layers in same order or the shapes present in the clipboard respectively. Paste at Cursor action pastes the merged data of all layers present in clipboard into a new layer and Paste at Active Layer pastes the merged data into the active layer.

Commits

Documentation

The Krita reference manual and user manual contains areas where cut/copy/paste operations are explained. These areas are updated explaining new features. MR for documentation: MR 244

Links for more info