Skip to content

Instantly share code, notes, and snippets.

@pabloasanchez
Created November 11, 2024 11:08
Show Gist options
  • Save pabloasanchez/6feef590574b8e2dbebdfd8a1bc29240 to your computer and use it in GitHub Desktop.
Save pabloasanchez/6feef590574b8e2dbebdfd8a1bc29240 to your computer and use it in GitHub Desktop.
hide-show-all-layers.py
#!/usr/bin/env python
# A simple plugin for hiding/showing all layers.
from gimpfu import *
def hide_show_all_layers(origin, hide):
layers = origin.layers
pdb.gimp_undo_push_group_start(origin)
for layer in layers:
layer.visible = False if hide == 0 else True
gimp.progress_init("Processing" + origin.name + "...")
pdb.gimp_undo_push_group_end(origin)
register(
"hide_show_all_layers",
"A simple plugin for hiding/showing all layers.",
"Simple layer hide/show plug-in",
"Pablo Sanchez",
"MIT License",
"2024",
"Hide/Show All Layers",
"",
[
(PF_IMAGE, "image", "Source image", None),
(PF_OPTION, "option", "Hide/Show", 0, ("Hide All", "Show All")),
],
[],
hide_show_all_layers,
menu="<Image>/Filters/User")
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment