The "Meet the GiMP!" ForumGiMP, Image Processing (DIP) and PhotographyImage Processing SoftwareScripts, Python, Perl and SchemePython Plugin to load aditional brushes on the fly
Pages: [1]   Go Down
Print
Author Topic: Python Plugin to load aditional brushes on the fly  (Read 1408 times)
phdemartin
Global Moderator
Regular
***
Posts: 66



View Profile WWW
« on: October 07, 2008, 06:22:14 am »

I everybody
I've got a tone of diferent brushes set who hare
1 slowing the Gimp start process
2 A mess in my brush dialog

The problem, in gimp, to add brushes set , you need to copy them in the brushes directory ( ant it's difficult to clean up the unwanted one's or go in preference > folder >brush adding a new brush folder path and restarting gimp Sad

So, I've wrote a python script to load additional brushes without restarting

the "test.py" work great ( dont search for perfect syntax an style..my skill in python is lower than basic)
This script look at some directory filled with brushes named "Brushes-*" in the /home/user/.gimp-2.6/ (you need at list 1 "Brushes-Whatever"  folder with brushes in it there to test it)
it link those folders interactively to  "/home/user/.gimp-2.6/Segondary_Brushes" 
If you add this directory link is in the gimp preferences >> folder >> brush, you can fired up the test.py chose a folder in the list and then refresh the fonts to use alternative sets on the fly

My problem is that I'm really inalphabet with pygtk integration in plug in Sad I've tried to make a plugin out of my working stand alone script without success Sad it's look that the main() is making problem...) it's a mess, I 've tryed to use the native Gimp widget, but I 'did not find a way to insert  dynamically the generated folder list Sad
If somebody have the necessary skill to help, it will be greatly appreciated

In a second step it can be good to change the linux os specifics commands I ave used to pure python windows and osX compatible equivalent .....
And also use the "gimp-brushes-refresh" python call from python-fu to refresh the list automatically (I 've tested it from the console, it work)   

Have fun Hahaha Wink Wink Wink



* test.py (1.49 KB - downloaded 40 times.)
* setbrush.py (1.82 KB - downloaded 45 times.)

* Test.py.jpg (9.25 KB, 335x72 - viewed 65 times.)

* Test.py.open.jpg (23.78 KB, 345x281 - viewed 72 times.)
« Last Edit: October 07, 2008, 06:17:44 pm by phdemartin » Logged

RobA
Just in
*
Posts: 1


View Profile
« Reply #1 on: October 07, 2008, 06:19:18 pm »

Had you looked at GIMP Brush Manager:
http://myweb.msoe.edu/~bogies/brushmanager/

It is also a python plugin that does a good job of selecting what brushes to be loaded.

-Rob A>
Logged

phdemartin
Global Moderator
Regular
***
Posts: 66



View Profile WWW
« Reply #2 on: October 07, 2008, 06:47:33 pm »

Thank's I will take a close look at it
Logged

phdemartin
Global Moderator
Regular
***
Posts: 66



View Profile WWW
« Reply #3 on: October 07, 2008, 09:36:40 pm »

SOLVED
Yep, working really great....
Had you looked at GIMP Brush Manager:
http://myweb.msoe.edu/~bogies/brushmanager/

It is also a python plugin that does a good job of selecting what brushes to be loaded.

-Rob A>

 I  hade to change some details in this great plugin to adapt it to the 2.6 menu system Now, you find it under  <Image>/Tools/setup Brush/
With my config, it look at Brushes folders in /home/<YourUserName>/.gimp-2.6/Brush_Manager_Folder/
and copy de desired one in folders placed in /home/<YourUserName>/.gimp-2.6/Brush_Manager_Active/ (who need to be add in the brushes path of gimp)
kipping track of them and refreshing the Brushes list in gimp tools
Efery thing I wanted so badly Wink
So don't try to fix my attempt to do the exact same thing, we don't want to reinvent the wheel
 PS :Dont forget to edit the top of the script to adapt it to your pesonal user name path

Thank's

* brushManager_2.01.py (7.92 KB - downloaded 46 times.)
« Last Edit: October 08, 2008, 04:09:39 pm by phdemartin » Logged

phdemartin
Global Moderator
Regular
***
Posts: 66



View Profile WWW
« Reply #4 on: October 08, 2008, 01:26:00 am »

So good Wink

I've adapted the script to manage the fonts
same type of installation
/home/<YourUserName>/.gimp-2.6/Font_Manager_Folder/ for the fonts set
/home/<YourUserName>/.gimp-2.6/Font_Manager_Active/ to add to the font patk in gimp
The tool appear in <Image>/Tools/setup Fonts/

Can be done for Pallets or Patterns if somebody is interested

PS :Don't forget to edit the top of the script to adapt it to your pesonal user name path

* FontManager_2.01.py (7.89 KB - downloaded 37 times.)
« Last Edit: October 08, 2008, 04:10:28 pm by phdemartin » Logged

jmontoya21
Just in
*
Posts: 2


View Profile
« Reply #5 on: October 10, 2008, 07:13:40 am »

this is great idea, how ever i just can't get this to work,in running vista 32bit, gimp 2.6.1 is there anyway you can do a quick nob guide i guess i still fall under this category, ton of brushes but no way to manage them
 thanks.
Logged

Alec_Burgess
Just in
*
Posts: 10


View Profile
« Reply #6 on: October 10, 2008, 07:55:16 am »

running vista 32bit, gimp 2.6.1

Just curious - where did you get gimp 2.6.1. As of two minutes ago, Jernej Simončič is only showing a binary for 2.6.0
Logged

Regards ... Alec

phdemartin
Global Moderator
Regular
***
Posts: 66



View Profile WWW
« Reply #7 on: October 10, 2008, 10:57:02 pm »

this is great idea, how ever i just can't get this to work,in running vista 32bit, gimp 2.6.1 is there anyway you can do a quick nob guide i guess i still fall under this category, ton of brushes but no way to manage them
 thanks.
First find where is your GIMP folder in C:\documents and settings\YOURUSERNAME\
Create there two folder
"Brush_Manager_Folder" (Where you put your brushes by set each set in a subfolders)
"Brush_Manager_Active" (enpty)
Copy the script in the plug-ins folder

Open the script in notepad change and change the line 4 "ACTIVE_DIR=....." and 5: " INSTALL_DIR=" with your path :
C:\documents and settings\YOURUSERNAME\..........\Brush_Manager_Active
and
C:\documents and settings\YOURUSERNAME\..........\Brush_Manager_Folder

Now open Gimp and put your active folder "C:\documents and settings\YOURUSERNAME\..........\Brush_Manager_Active"  in the preference>folders>brushes

Et Voila
Logged

jmontoya21
Just in
*
Posts: 2


View Profile
« Reply #8 on: October 13, 2008, 06:45:08 am »

this is great idea, how ever i just can't get this to work,in running vista 32bit, gimp 2.6.1 is there anyway you can do a quick nob guide i guess i still fall under this category, ton of brushes but no way to manage them
 thanks.
First find where is your GIMP folder in C:\documents and settings\YOURUSERNAME\
Create there two folder
"Brush_Manager_Folder" (Where you put your brushes by set each set in a subfolders)
"Brush_Manager_Active" (enpty)
Copy the script in the plug-ins folder

Open the script in notepad change and change the line 4 "ACTIVE_DIR=....." and 5: " INSTALL_DIR=" with your path :
C:\documents and settings\YOURUSERNAME\..........\Brush_Manager_Active
and
C:\documents and settings\YOURUSERNAME\..........\Brush_Manager_Folder

Now open Gimp and put your active folder "C:\documents and settings\YOURUSERNAME\..........\Brush_Manager_Active"  in the preference>folders>brushes

Et Voila

MR phdemartin you are tha man thank you works great, the quotes had me messed up for a minute but finally got it. thanks.
Logged

iceburg
Just in
*
Posts: 2


View Profile
« Reply #9 on: October 21, 2008, 05:09:00 am »

What python programs do you need or how do I find failing output?  I installed python 2.5, the pygtk win32 package and gtk-2.12.9; this is on WinXP with GIMP 2.6.1. I then put the edited script (with paths set to match my new active/installed folders) in the plug-ins dir, and it doesn't show up in <Image> Tools -> setup Brush.    This is a really useful script, and so far works great on Linux with Gimp 2.4.7 for me, so it would be great to get it working here as well...
Logged

Alec_Burgess
Just in
*
Posts: 10


View Profile
« Reply #10 on: October 21, 2008, 07:33:31 am »

What python programs do you need or how do I find failing output?  I installed python 2.5, the pygtk win32 package and gtk-2.12.9; this is on WinXP with GIMP 2.6.1. I then put the edited script (with paths set to match my new active/installed folders) in the plug-ins dir, and it doesn't show up in <Image> Tools -> setup Brush.    This is a really useful script, and so far works great on Linux with Gimp 2.4.7 for me, so it would be great to get it working here as well...
see this thread from gimp-users: http://www.gimpusers.com/forums/gimp-user/10670-python-support.html

I think it will turn out you need pycairo-1.4.12-1 and pygobject-2.14.1-1
Logged

Regards ... Alec

iceburg
Just in
*
Posts: 2


View Profile
« Reply #11 on: October 24, 2008, 04:35:20 am »

That fixed it.  Thanks for the help!
Logged

Pages: [1]   Go Up
Print
Jump to: