PDA

View Full Version : GIMP Pattern/Brush/etc. manager discussion



jfrazierjr
10-14-2008, 05:53 PM
I'll tell you - here is how I use my textures (all png files). I don't import them all, cause gimp has no decent way to group them into folders, etc. There is a python brush manager I use and I have been tempted to extend it to also be a pattern manager

Ditto... going to do it one of these days....Perhaps tonight's the night..

jfrazierjr
10-16-2008, 09:16 PM
I'll tell you - here is how I use my textures (all png files). I don't import them all, cause gimp has no decent way to group them into folders, etc. There is a python brush manager I use (http://myweb.msoe.edu/%7Ebogies/brushmanager/) and I have been tempted to extend it to also be a pattern manager, but find the following workflow is more convenient for me...


Ok... I finally broke down and converted Brush Manager to Pattern Manager Python script. I just got tired of having such a huge list of patterns, with no organization to it...If anyone wants it.. let me know and I will post it up...

RobA
10-16-2008, 09:23 PM
Ok... I finally broke down and converted Brush Manager to Pattern Manager Python script. I just got tired of having such a huge list of patterns, with no organization to it...If anyone wants it.. let me know and I will post it up...

Yeah baby!

How hard would it be to (rather than additional plugins) make it a unified gimp resource manager and have separate tabs for:
-Brushes
-Patterns
-Gradients
-Palettes

(I don't know much python or I'd attempt it myself...)

-Rob A>

jfrazierjr
10-16-2008, 09:36 PM
Yeah baby!

How hard would it be to (rather than additional plugins) make it a unified gimp resource manager and have separate tabs for:
-Brushes
-Patterns
-Gradients
-Palettes

(I don't know much python or I'd attempt it myself...)

-Rob A>

Well... separate scripts would be easy. I have no idea how to do tabs, nor do I do Python(God I wish I could compile the Perl stuff and use Perl-fu). That would be a really sweet thing to do though... so perhaps I will keep it on my radar eventually. I just bought a Gimp book(Beginning Gimp by APress) and it has a nice section on scripting.

jfrazierjr
10-16-2008, 11:44 PM
Well... separate scripts would be easy. I have no idea how to do tabs, nor do I do Python(God I wish I could compile the Perl stuff and use Perl-fu). That would be a really sweet thing to do though... so perhaps I will keep it on my radar eventually. I just bought a Gimp book(Beginning Gimp by APress) and it has a nice section on scripting.

I think I will have to pull out my python book (bought it and read about 1/4 of it cause part of our work uses python(jython actually).

I will see if I can do something simple such as an initial window with a radio button. You then select the radio button and it opens the prompt window to show the list of folders. I won't guarantee that I can figure this out, but will give it a try over the next few weeks.

Sagenlicht
10-17-2008, 07:32 AM
Hmm I grabbed the brush manager and will look into it at the weekend.

I actually only know python and not scheme (script-fu), so maybe I'll get something for you RobA.

RobA
10-17-2008, 10:09 AM
I've moved these posts over to the Software discussion forum.

-Rob A>

jfrazierjr
10-17-2008, 12:41 PM
Hmm I grabbed the brush manager and will look into it at the weekend.

I actually only know python and not scheme (script-fu), so maybe I'll get something for you RobA.

Hmm I grabbed the brush manager and will look into it at the weekend.

I actually only know python and not scheme (script-fu), so maybe I'll get something for you RobA.

Well.. to be honest, that's the part(Python UI stuff) that needs the work done. Here is the general flow I would expect, Python-wise:

Python-fu creates new window. Window will contain some Picker type control. I would suggest a radio button group. When selected(initially not selected), the script will then perform actions similar to the existing BrushManager script. At this point, the Existing Brush Manager script starts up with the checkbox list of folders to pick from, This shoud be moved to only show (either in a seperate popup window or, better yet, in a sub window from the main window the radio buttons reside in) the folders for the selected element (brush, pallete, pattern, etc).

You would also need to have set up variables to contain the paths for EACH of the elements (brush,patterns,etc) as well as the master grouping folder.

Currently, I changed my Pattern Manager to have uniquie variables which said what they do. In the original Brush manage script the variables are:

ACTIVE_DIR = /path/to/standard/gimp/brushess
INSTALL_DIR = /path/to/grouped/brushes

The problem appears that script variables are GLOBAL. So the BrushManager and PatternManager variables stomped on each other. So I changed this to something like:


PATTERNS_ACTIVE_DIR = /path/to/standard/gimp/patterns
PATTERNS_INSTALL_DIR = /path/to/grouped/patterns

So that it would be unique. There is nothing to say that you cannot have a Python lookup thing so that you can have a generic variables ACTIVE_DIR and INSTALL_DIR and say something like(psuedo code):

PickedRadioButton=getPickedRadioButton()

ACTIVE_DIR = getPath(PickedRadioButton)

Where PickedRadioButton will be PATTERNS_ or BRUSHES_ or whatever after a bit of string hacking. So if you set up your 8 variables:

PATTERNS_ACTIVE_DIR = /path/to/standard/gimp/patterns
PATTERNS_INSTALL_DIR = /path/to/grouped/patterns

BRUSHES_ACTIVE_DIR = /path/to/standard/gimp/brushes
BRUSHES_INSTALL_DIR = /path/to/grouped/brushes

PALETTES_ACTIVE_DIR = /path/to/standard/gimp/palettes
PALETTES_INSTALL_DIR = /path/to/grouped/palettes

etc. You can then set the generic variable and always pass that around to the base copy/uncopy functions that do the lifting and the GIMP refreshX list.


Sagenlicht, If you take this on and come up with something, that would be WAY cool... and hopefully, in the next 10 days or so, my rep power will go up 2 points and I can beat you with a big ole +4 rep mallet. At this point, I don't see much need for myself for the gradients or palettes, but if you come up with a framework, it's easy to use what you need and ignore the rest (or comment out, which I would probably do to avoid mistaken clicks). As I said, from what I can tell, 95% of the changes would be in just simple Python UI stuff. with only tiny changes to the GIMP specific parts.

jfrazierjr
10-17-2008, 12:43 PM
Oh, and if you have any questions, feel free to send them over. While I suck at Python, I am pretty darn good at general UI usability. If you would like, I can make up a quick mockup of what I think would be the best UI design and workflow(not sure how much you have done UI work in Python, so ignore me if you have done this a lot!)

Sagenlicht
10-19-2008, 02:37 PM
Ok I did take a look as promised :)

I didnt know the brush manager before and I have to say I guess it was originally coded for personal use and released afterwards to the public as someone demanded such a manager? The code looks like exactly that way.

Not that it doesnt work, it works pretty well if you accept that you have to edit your python code for paths and you are creating a simple text file in your brush folder.

Anyways, I guess it wont be too much work to code a manager for all 4 types (brushes, palettes, patterns and gradients), sadly I wont have much free time the next days but I'll try to get it finished next weekend.

How will it look like?
- I will split the manager into 5 classes (the brush manager uses 1), 1 for each type and 1 for the gui.
- I will move all path and install options informations into a config file for easier setup.

So in the end you will have one python script and one config file nothing else.

Oh and jfrazierjr, python itself doesnt do a gui, you need something else for that. The brush manager used pyGTK (GIMP uses GTK as well), I am planning to do the same. I guess I wont change much, just add 3 more rows for the other types.

Once again, just give me some days, as I wont have much free time at my hands next week and I need to finish the monthly challenge as well :)

RobA
10-19-2008, 03:47 PM
I'll add that I got this response on the GIMP Talk forum:


The gimpfu UI is fairly limited (autogenerated based on the parameter types you supply to register()).
OTOH, if you are using PyGTK to implement your UI, 99% of GTK functionality is available... soooo, everything that you could even think of ;)

So if you use pyGTK, tabs are certainly possible.. Ref here: http://www.pygtk.org/pygtk2tutorial/sec-Notebooks.html

-Rob A>

Sagenlicht
10-19-2008, 06:33 PM
Aye RobA, thats what I planned, just adding 3 more rows/tabs for the others.

Though I will change the code, cause it makes way more sense to use 5 classes instead of one and at least imo its better to use one config file than editing a python script and writing textfiles into the folders.

RobA
10-19-2008, 07:43 PM
Brilliant!

And I would suggest when complete uploading it to the gimp plugin registry (http://registry.gimp.org/).

-Rob A>

Sagenlicht
10-23-2008, 03:19 PM
Heh I got a dumb question :)

How should we name this new manager? Brush/Gradient/Palette/Pattern Manager aint working right? :)

On the plus side, I think I will finish my challenge entry tomorrow so I will start coding on saturday :)

jfrazierjr
10-23-2008, 04:16 PM
Heh I got a dumb question :)

How should we name this new manager? Brush/Gradient/Palette/Pattern Manager aint working right? :)

On the plus side, I think I will finish my challenge entry tomorrow so I will start coding on saturday :)


Multi Manager? umm I don't know....

torstan
10-23-2008, 04:42 PM
Dialogue manager?

RobA
10-23-2008, 04:57 PM
How about calling it the Gimp Unified Resource Manager (GURM) :)

...or PyGURM since it would be in python...

-Rob A>

jfrazierjr
10-23-2008, 05:37 PM
How about calling it the Gimp Unified Resource Manager (GURM) :)


Sounds good to me...

Steel General
10-24-2008, 08:12 AM
How about calling it the Gimp Unified Resource Manager (GURM) :)

...or PyGURM since it would be in python...

-Rob A>


GURM sounds like something you scrape off the bottom of your shoe. :D

Sagenlicht
10-29-2008, 07:52 PM
Just wanted to give a quick update :)

Basically everything works, I just need to correct some minor cosmetic issues.

So you will get a first release before friday :) That release wont have any error handlings and the code wont be cleaned up. But as I allready said, everything works and you can test around and tell me if it is the way you wanted it.

Oh and SG, I thought GURM is a nice name, so you have to live with it :)

jfrazierjr
10-29-2008, 08:07 PM
Just wanted to give a quick update :)

Basically everything works, I just need to correct some minor cosmetic issues.

So you will get a first release before friday :) That release wont have any error handlings and the code wont be cleaned up. But as I allready said, everything works and you can test around and tell me if it is the way you wanted it.

Oh and SG, I thought GURM is a nice name, so you have to live with it :)


YEAH!!!!

Oh, one thing I noticed with the original brush manager is that it does not work with Adobe brush files since the code was only looking for specific file extensions. Think you could change that to make sure that it works. Likewise, I expect we should pool knowledge to make sure all our bases are covered for allowed brushes, patterns, etc by file extension so that it "just works."

RobA
10-29-2008, 08:34 PM
That's funny because on my version abr brushes (photoshop, right?) work. It also handles zip files of brushes, unzipping them when moving them into the active directory.

Oh, and a real big YEAH!!!! From me too.

-Rob A>

Steel General
10-30-2008, 07:39 AM
Oh and SG, I thought GURM is a nice name, so you have to live with it :)

I have no problem with it, and if it was ported to photoshop it would be PURM or PSURM which sounds just as bad. :)

Sagenlicht
10-30-2008, 06:58 PM
Ok here you go:

GURM is released (http://www.cartographersguild.com/showthread.php?p=36761#post36761) :)

I did create a threat as I thought its better to handle for updates. If not just merge the threats.