GIMP 2.10 a brush in the filter parameters - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Gimp 2.10 (https://www.gimp-forum.net/Forum-Gimp-2-10) +--- Thread: GIMP 2.10 a brush in the filter parameters (/Thread-GIMP-2-10-a-brush-in-the-filter-parameters) Pages:
1
2
|
GIMP 2.10 a brush in the filter parameters - dinasset - 05-04-2018 Hi, in my activity of porting my filters to 2.10, I faced a strange behavior: - there is a filter (running on 2.8) which as a "brush" parameter in the definition - trying to see it under 2.10 it was in the menu but not showing its menu when launched - after some trials I discovered that removing the filter name from the parameters it was showing, but.. only once (unless resetting all the filters) So I decided to write a couple of test filters, one with the brush parameter (but set to None), the other one which uses the active brush. The behavior was confirmed: - using the first one I can see it and run only once (unless resetting the filters) - using the second one I can see it and run as many times as I like Ther same 2 filters included in my 2.8, show up and run always. Hence I post here these 2 small filters; if someone is so kind to double-check them, I will appreciate The first one Code: #!/usr/bin/env python Code: #!/usr/bin/env python RE: GIMP 2.10 a brush in the filter parameters - Ofnuts - 05-06-2018 There is a gimp_context_push() but no gimp_context_pop()? (not sure if that fixes the problem, but that would be the first thing to check) Edit: correction: there is no gimp_context_push(), there is just a gimp_context_push, which, by not including the call operator (aka ()) is just the method object but doesn't call anything. So no need for a balancing gimp_context_pop(), at best a gimp_context_pop for the same non-effectiveness -- Someone RE: GIMP 2.10 a brush in the filter parameters - dinasset - 05-06-2018 Thanks Ofnuts. Yes, a mistake (I have written these test filters in a hurry). Corrected them. Now the situation is: - with the initial brush set to "None", the filter can be run repeatedly and not just only once as previously with the error you noticed. - with the initial brush set to an existing one, still the filter shows up in the menu but does not show the parameters window when called (i.e.: does not start, it's uncallable). INHO this means that 2.10 is unable to handle a brush initialized in a parameter. This opinion is reinforced by the fact that the previous (erroneous) version of the filter with the parameter set to "None" did work properly only once, because in the absence of the ...context_pop() at the end, the filter was "remembered" by Gimp as having a predefined brush by default. What do you think about? RE: GIMP 2.10 a brush in the filter parameters - Ofnuts - 05-06-2018 Another problem with your code, the functions end with return(). This has no real meaning in Python, for which this is the keyword return followed by an empty tuple. So the method returns an empty tuple. But the registration promises that it returns a drawable [(PF_DRAWABLE, "odrawable", "Output drawable", None),]. RE: GIMP 2.10 a brush in the filter parameters - Ofnuts - 05-06-2018 : If you start Gimp 2.10 and run your code, you get: Code: Traceback (most recent call last): Filters>Reset all filters restores the default values to you can rerun your filter (and re-select a brush). Otherwise, bona fide bug that you can report on bugzilla.gimp.org The fixed code: [attachment=1692] RE: GIMP 2.10 a brush in the filter parameters - dinasset - 05-07-2018 Ya, thanks, but the main problem (my problem, which caused this thread to be started) is: - with a predefined brush indicated the filter does not show up (in 2.8 is shows up normally) Likely a bug in 2.10, which hope will be fixed. I just wanted to have a double-check, but I forgot you still work on 2.8 (safer...). Thanks anyhow for your interest. RE: GIMP 2.10 a brush in the filter parameters - Ofnuts - 05-07-2018 I did the tests above with 2.10 of course. But yes, your problem is that whatever value is active (not None), whether is comes form a previous run or from your default value, is fed to some object that preset the value in the dialog and in 2.10 that fails. Time to report the bug if you want it fixed for some future version (I expect 2.10 to have a new version every month for some time, because there are certainly other bugs...) RE: GIMP 2.10 a brush in the filter parameters - dinasset - 05-07-2018 Thanks. Yes, also Lyle discovered one (see GC). In spite of its long "gestation", 2.10 is a ... young baby. RE: GIMP 2.10 a brush in the filter parameters - Ofnuts - 05-07-2018 Given that hisroty is likely to somehow repeat itself... Code: 2.8.0-RC1 03-Apr-2012 RE: GIMP 2.10 a brush in the filter parameters - dinasset - 05-07-2018 Long history, really. Only hope it doesn't take another 5 years to switch to another major release... |