It is currently 21 Oct 2021, 02:06

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | 🡆 Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP
Sponsored content for World Food Program

Python - 2 questions

Asks Python related questions here
n3306tx
Forum Member
61st Place
13 Post(s)

Python - 2 questions

Post#1 by n3306tx » 02 Jul 2021, 22:48


1. Is there a Python command to "disable" a layer mask (as if holding CTRL key and clicking mask)?
2. Where can I find a good GIMP python reference with all the commands?
Thanks for any help.
Last edited by n3306tx on 03 Jul 2021, 00:02, edited 2 times in total.
GIMP Learn rocks...

tim
GL Blogger
1st Place
5544 Post(s)

Post#2 by tim » 03 Jul 2021, 00:49


On the forum, there's no delete post option for historical information purposes.
1. I don't see a command for disabling layer mask. It seems you can only apply or/and remove layer mask. GIMP python fu usually don't provide front end interface commands but only commands that has effect so I guess that's why disabling mask isn't there because it's more of a front end for user to work with and all other mask operations seem to be there.
2. I just use GIMP -> Help -> Procedure browser and search for a keyword...for example "mask" and all commands that has mask it in will appear. That seems good enough for me to find possible commands. Then just replace the - (hyphens) in commands with _ (underscores) and add pdb. in front and you've got your Python fu commands. And the parameters are there, just ignore the RUN MODE parameter if there is one.
aka Tin
World Food Program | Good Deeds Forum

         

Kevin
Forum Member
106th Place
2 Post(s)

Post#3 by Kevin » 05 Jul 2021, 11:35


I think gimp-layer-set-apply-mask should do what you want

tim
GL Blogger
1st Place
5544 Post(s)

Post#4 by tim » 05 Jul 2021, 12:05


gimp-layer-set-apply-mask doesn't seem to do anything when i run it.
aka Tin
World Food Program | Good Deeds Forum

         

n3306tx
Forum Member
61st Place
13 Post(s)

Post#5 by n3306tx » 06 Jul 2021, 02:07


tim wrote:
03 Jul 2021, 00:49
On the forum, there's no delete post option for historical information purposes.
1. I don't see a command for disabling layer mask.
Tim, thanks for the reply and answers. Makes sense about the layer mask option. Basically I just wanted to make a group mask, but have it disabled to start with. I can workaround it by just making a white mask on the group.
Mike
GIMP Learn rocks...

n3306tx
Forum Member
61st Place
13 Post(s)

Post#6 by n3306tx » 06 Jul 2021, 02:11


Kevin wrote:
05 Jul 2021, 11:35
I think gimp-layer-set-apply-mask should do what you want
Thanks for the reply. I was trying to create a group mask, but have it start out in disabled mode (red square around it). I can work around it by simply having a white mask so all the group layers show through basically getting the same result. I'm really new at coding python in Gimp, but I can see the power in it automating repetitive tasks.
GIMP Learn rocks...

Kevin
Forum Member
106th Place
2 Post(s)

Post#7 by Kevin » 06 Jul 2021, 08:38


Seems to work for me, at least in the Script-Fu console:
untitled01.png
untitled01.png # (130.58 KiB) Viewed 1438 times (Thumbnail | Recognize | Sq Tile | LNFI)
...

tim
GL Blogger
1st Place
5544 Post(s)

Post#8 by tim » 06 Jul 2021, 12:39


I must of ran the wrong script by mistake and so didn't notice anything. :hammer_head:
It works for me now too.
gimp-layer--set-apply-mask-disables-mask.jpg
gimp-layer--set-apply-mask-disables-mask.jpg # (40.32 KiB) Viewed 1431 times (Thumbnail | Recognize | Sq Tile | LNFI)
aka Tin
World Food Program | Good Deeds Forum

         


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | 🡆 Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests