Python Plug-in that Changes SubLayers Visibility and Export Images as PNG Files - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: Python Plug-in that Changes SubLayers Visibility and Export Images as PNG Files (/Thread-Python-Plug-in-that-Changes-SubLayers-Visibility-and-Export-Images-as-PNG-Files) |
Python Plug-in that Changes SubLayers Visibility and Export Images as PNG Files - TiredGuy - 03-01-2024 Hello everybody! I’m not very good not in GIMP, nor in Python, nor English, so please excuse me for my mistakes) I have a .xcf file with a lot of layers and sublayers, for example: (visible) Layer_1 (visible) Sublayer_1.1 (invisible) Sublayer_1.2 (visible) Layer_2 (invisible) Sublayer_2.1 (invisible) Sublayer_2.2 (invisible) Sublayer_2.3 (visible) Layer_3 I need to change the visibility of each sublayer in a selected layer in turn and export the entire image with all visible layers. For example: (visible) Layer_1 (visible) Sublayer_1.1 (invisible) Sublayer_1.2 (visible) Layer_2 (visible) Sublayer_2.1 (invisible) Sublayer_2.2 (invisible) Sublayer_2.3 (visible) Layer_3 Export image_2.1.png then (visible) Layer_1 (visible) Sublayer_1.1 (invisible) Sublayer_1.2 (visible) Layer_2 (invisible) Sublayer_2.1 (visible) Sublayer_2.2 (invisible) Sublayer_2.3 (visible) Layer_3 Export image_2.2.png then (visible) Layer_1 (visible) Sublayer_1.1 (invisible) Sublayer_1.2 (visible) Layer_2 (invisible) Sublayer_2.1 (invisible) Sublayer_2.2 (visible) Sublayer_2.3 (visible) Layer_3 Export image_2.3.png The best that I did with the help of ChatGPT is this plug-in in Python: Code: #!/usr/bin/env python But this plug-in exports only sublayers in a selected layer and I can't make it export the entire image with all visible layers. Is anybody able to help me with it, please? Or maybe are there other ways to do it? Many thanks for any help! RE: Python Plug-in that Changes SubLayers Visibility and Export Images as PNG Files - Ofnuts - 03-02-2024 Looks like my ofn-export-layer-combinations script RE: Python Plug-in that Changes SubLayers Visibility and Export Images as PNG Files - TiredGuy - 03-02-2024 (03-02-2024, 01:45 AM)Ofnuts Wrote: Looks like my ofn-export-layer-combinations script That's exactly what I need! Thank you a lot! |