its a common function under Layer->New menu which is in gimp and ps.
It create /insert layer on top from visible pixels
Details
u can create several layers with some painting and then test this function which create new layer with all paintings together
Diff Detail
- Repository
- R37 Krita
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Hi, @miroslavtalasek!
We used to merge the image this way, but it will not work with animated images (the frames will be lost), so we changed the strategy. Now you should use KisLayerUtils for that. Please check KisLayerUtils::flattenImage() and KisLayerUtils::flattenLayer() for the example.
As far as I can tell, you should just call mergeMultipleLayersImpl() with specific arguments.
And also take care that this patch should go into a separate branch, because master is in freeze now
i try to reuse mergeMultipleLayersImpl to merge layers but this also remove other layer and i trying discover what must be changed to keep other layers alive but i didnt understand what
I reuse merge layers from layerutil so its merge layer with possible frames - new way
Hi, @miroslavtalasek!
Codewise the patch looks fine, except of a minor text glitch. I'll compile it a bit later today.
Are you going to push it yourself or I should push it for you?
libs/image/kis_layer_utils.cpp | ||
---|---|---|
1043 ↗ | (On Diff #5985) | I guess we use all capitals wording here, that is, the action name should be "New From Visible". I can fix it while pushing the code into a branch. |
I tested the patch, it works perfectly fine. Including animations and undo.
The only trouble is the two strings I mentioned that should be changed into "title-capitalization", which look inconsistent with the rest of the GUI.
Please check this document for more info about capitalization:
https://community.kde.org/KDE_Visual_Design_Group/HIG/Capitalization
As far as I remember you were going to get a developers account. So when you get one, please fix these two strings and push the changes into a separate branch. And we will merge this branch into master when merge window opens in the beginning of September.
krita/krita.action | ||
---|---|---|
2272 | This menu item should be in title-case as well: "New Layer From Visible" Otherwise it looks inconsistent |
Can u push it for me (i have big free time troubles) ? and how i obtain developer account for future ?
Hi, @miroslavtalasek!
Here is the guide on how to get it:
https://community.kde.org/Infrastructure/Get_a_Developer_Account
In the "person who recommends you" field write me or Boud.
And ok, I'll push your patch now!
Btw, can you write me your email? I need it to wirte your name as the author of the commit.
Is this feature merged in the master. I saw two commits about it in master so i think it is. but for some reason I couldn't get this menu in the layer menu. there is no new layer from visible menu in the new section of layer menu. Do i need to do something to get it?