GIMP Chat http://gimpchat.com/ |
|
How to call a python filter to run interactively http://gimpchat.com/viewtopic.php?f=8&t=20514 |
Page 1 of 1 |
Author: | dinasset [ Wed Sep 13, 2023 12:04 am ] |
Post subject: | How to call a python filter to run interactively |
GIMP Version: 2.10.32 Operating System: Windows GIMP Experience: Intermediate Level In one of my exhausted neurons, there is a memory of a test performed -"once upon a time"- in a python filter to call another python filter requesting to run it interactively. Vaguely I remember that it was not used as the first parameter (it gives error), but likely at the end -or in another way-. Is my memory totally wrong or is it possible from inside a python filter to call another one asking to get the parameters panel? I do not find any trace in my repository. Thanks! |
Author: | ofnuts [ Wed Sep 13, 2023 2:17 am ] |
Post subject: | Re: How to call a python filter to run interactively |
Add a keyword "run_mode" argument (this is valid for all filters and scripts that you AFAIK, not just the Python ones): Code: Select all pdb.gimp_file_save(image, exportLayer,filename,filename,run_mode=RUN_INTERACTIVE) |
Author: | dinasset [ Wed Sep 13, 2023 2:29 am ] |
Post subject: | Re: How to call a python filter to run interactively |
Thanks Ofnuts. So my old neuron was not totally wrong. I'll try it. |
Author: | dinasset [ Wed Sep 13, 2023 5:00 am ] |
Post subject: | Re: How to call a python filter to run interactively |
It seems to work, in the sense that it launches and shows the panel of the called filter. After pressing Enter it starts doing its steps but it stops half the way without outcome, without errors. I noticed that when it launches the called filter not all parameters I've prepared are shown, they are limited to 7 (the called filter has more); is there a limit? |
Author: | dinasset [ Wed Sep 13, 2023 5:02 am ] |
Post subject: | Re: How to call a python filter to run interactively |
PS: the launch without the added parm run_mode=RUN_INTERACTIVE works until the appropriate end. |
Author: | ofnuts [ Wed Sep 13, 2023 9:16 am ] |
Post subject: | Re: How to call a python filter to run interactively |
There are filters that behave very differently depending on that parameter. So what is the problem filter? |
Author: | dinasset [ Wed Sep 13, 2023 9:46 am ] |
Post subject: | Re: How to call a python filter to run interactively |
This is the called filter. This filter works standalone as well as called by the optional calling preset filter directly (NON_INTERACTIVE). Attachment: It requires chisel.scm Attachment: These are the statements in the calling filter: Code: Select all if runMode==1: #NON_INTERACTIVE If you need the complete calling filter I'll post it here also |
Author: | dinasset [ Wed Sep 13, 2023 9:56 am ] |
Post subject: | Re: How to call a python filter to run interactively |
Currently in the main program (attached on previous post) there is a trace display image before the statement which causes the stop after the first execution of Code: Select all pdb.plug_in_sel2path (img, scratch_layer) |
Author: | ofnuts [ Wed Sep 13, 2023 3:09 pm ] |
Post subject: | Re: How to call a python filter to run interactively |
First thing first, "run_mode" can be RUN_INTERACTIVE, RUN_NONINTERACTIVE, or RUN_WITH_LAST_VALS, so you don't need two calls, you can use runMode directly Code: Select all Outcome = pdb.python_fu_OpusVermiculatumVitreum2023(inImage, inLayer, Also your comments are wrong, the opposite of RUN_INTERACTIVE is RUN_NONINTERACTIVE, or RUN_WITH_LAST_VALS , so currently you don't really know which one is used. |
Author: | dinasset [ Wed Sep 13, 2023 9:02 pm ] |
Post subject: | Re: How to call a python filter to run interactively |
Appreciate your clarification, ofnuts. But it is the call without that parameter specified which operates correctly, and not the one with the mode specified. The "else" in my calling filter is related to my options specified in the caller, which are only two: Code: Select all (PF_OPTION, "runm", "Run mode", 1, Anyhow I will try to run specifying always the mode. |
Author: | dinasset [ Wed Sep 13, 2023 9:56 pm ] |
Post subject: | Re: How to call a python filter to run interactively |
No, with the parameter "run_mode=..." it doesn't work. I give up and continue calling the execution filter without that parameter (hence default NONINTERACTIVE). Thanks for your support. Maybe this was the result also years ago, when I tried it in the past, and therefore I removed also at that time the mode |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |