Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Merge active layer with several other layers
#7
(05-15-2023, 04:44 AM)PixLab Wrote: The layer's stopper using the name works well even with layers with no visibility in the middle.

On the other hand, when we chose "By number", if there is layers with no visibility in the middle, thing start to get random  Big Grin

For example: I did chose 5 layer to merge, just 3 were merged (layer "9.png" was selected) because some layers are no in "Visible" state



Using the very same number (5 to merge) but this time with more layers "Not visible", only 2 where merged



With the layer stopper name it's all fine,
With the number, I would suggest to take in count only the visible layers, and if there is not enough visible layers for the chose number, send/pop an "alert" (yes I did tried with not enough "visible" layer for the chosen number I did input Big Grin )

It's not going to work with invisible layers.

pdb.gimp_image_merge_down combines the passed layer and the first visible layer below it. So if you have invisible layers that are counted in the for loop the actual merge is done repeatedly to the first visible one. To show this:
    Reduce the opacity of the layer to be merged down.
    Have some of the middle layers invisible.
    Run plugin.
    Look at the results in the first visible layer Smile

BTW you can't merge down an invisible layer.

(05-11-2023, 10:07 PM)Khalaris Wrote: Any comments are appreciated Smile

The layer count logic looks wrong e.g for the following example consider the case where there are 10 layers, the input layer is 3 and layercount is 7.

00
01
02
03 Input layer
04 1
05 2
06 3
07 4
08 5
09 6
   7 <- Gone off the end.

layercount = 7
pos = 3
stop = 10
stop = 3 + 7 + 1 = 11
for index in range(4, 11):  <- index 10 is too many
Reply


Messages In This Thread
RE: Merge active layer with several other layers - by teapot - 05-15-2023, 10:03 PM

Forum Jump: