Bug 399940 - Converting Group Layer to a File Layer breaks all Transform Masks inside
Summary: Converting Group Layer to a File Layer breaks all Transform Masks inside
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (other bugs)
Version First Reported In: 4.1.5
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-17 18:26 UTC by Rayko
Modified: 2018-11-20 08:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rayko 2018-10-17 18:26:47 UTC
SUMMARY

During my work I noticed that, if you try to convert a group layer, that contains layers with a transform mask applied, to a file layer, the mentioned layers will disappear. When I looked inside the file layer, the Transform Mask is still there, but does not show anything. 

STEPS TO REPRODUCE
1. Create a file and a group layer.
2. Put a layer inside the group layer and apply a transform mask to it (I used Perspective tool)
3. Convert the group layer to a file layer.

OBSERVED RESULT

Layer with a transform mask disappeared. In addition, if you cancel the 'convert to a file layer' operation, Krita becomes slightly unstable: the recovered image flickers, transformes and does weird stuff when you do something as trivial, as creating a layer or changing the visibility. I managed to even crash Krita, when I meddled with the second group layer.

EXPECTED RESULT

Conversion to a file layer does not break anything and everything stays in place.

SOFTWARE VERSIONS
Krita
  Version: 4.1.5

Qt
  Version (compiled): 5.10.0
  Version (loaded): 5.10.0

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-33-generic
  Pretty Productname: Linux Mint 18.3
  Product Type: linuxmint
  Product Version: 18.3

OpenGL Info
  **OpenGL not initialized**

ADDITIONAL INFORMATION

My guess is that it uses the reference system of the original file and probably moves the transformed image out of the bounds, even if you disable the mask.
Comment 1 mvowada 2018-10-17 18:33:29 UTC
(I can reproduce with Krita 4.2.0-pre-alpha (git a2ae7f3) as well)
Comment 2 Halla Rempt 2018-10-20 10:00:25 UTC
I don't think we should even allow this. Krita does not support using .kra files as file layers, and there are no other file formats that support transform masks.
Comment 3 Halla Rempt 2018-10-21 12:00:28 UTC
Git commit 0061e1cbdbde9efe2af0648f0de19045fdcda06c by Boudewijn Rempt.
Committed on 21/10/2018 at 11:58.
Pushed by rempt into branch 'master'.

Do not allow or suggest .kra files when converting to file layers

This should also fix the issue where the transform masks inside
the embedded file are broken.

M  +1    -1    krita/krita.action
M  +1    -1    krita/krita4.xmlgui
M  +2    -1    libs/ui/KisMainWindow.cpp
M  +13   -4    libs/ui/kis_layer_manager.cc
M  +1    -1    libs/ui/kis_node_manager.cpp
M  +1    -1    plugins/dockers/defaultdockers/kis_layer_box.cpp

https://commits.kde.org/krita/0061e1cbdbde9efe2af0648f0de19045fdcda06c
Comment 4 Rayko 2018-10-21 14:15:41 UTC
(In reply to Boudewijn Rempt from comment #2)
> I don't think we should even allow this. Krita does not support using .kra
> files as file layers, and there are no other file formats that support
> transform masks.

Excuse me, can you elaborate why .kra files are not supported? Does that mean that, practically, 'File Layer' is not supposed to have internal hierarchy, since other formats will just flatten the layer group?

Because if yes

> This should also fix the issue where the transform masks inside
the embedded file are broken. 

Does that means that the fix just removes ability for embedded file have transformation masks, rather than fixing them being broken?
Comment 5 Halla Rempt 2018-11-20 08:57:02 UTC
Git commit a3aaf9f2fbe8ede26a379d9eacc8447894a82e01 by Boudewijn Rempt.
Committed on 20/11/2018 at 08:23.
Pushed by rempt into branch 'krita/4.1'.

Do not allow or suggest .kra files when converting to file layers

This should also fix the issue where the transform masks inside
the embedded file are broken.

M  +1    -1    krita/krita.action
M  +1    -1    krita/krita4.xmlgui
M  +2    -1    libs/ui/KisMainWindow.cpp
M  +13   -4    libs/ui/kis_layer_manager.cc
M  +1    -1    libs/ui/kis_node_manager.cpp
M  +1    -1    plugins/dockers/defaultdockers/kis_layer_box.cpp

https://commits.kde.org/krita/a3aaf9f2fbe8ede26a379d9eacc8447894a82e01