Gimp Script: Hex Grid
This post asked about drawing hex grids in Gimp.
I posted a quick and dirty hex script there, but have cleaned it up and added more features.
I shows up as Filters->Render->Pattern->Hex Grid... (which is the same sub-menu as the existing grid script).
This script works on the current layer/drawable to be consistent with the way the normal grid plugin works.
Here is the dialog:
The options are:
Element to Specify - is either the length of one side, the distance from point to point (equals the horizontal center to center in a horizontal oriented hex grid) or side to side (equals the vertical center to center in a horizontal oriented hex grid).
Length of Element - the length in pixels of the above item.
Hex Orientation - Horizontal or Vertical
Line width - the width of the stroke
Horizontal and Vertical offsets - when zero the first grid is tight in the upper left hand corner, with the stroke half off the edge. So for example, if you set it to a 1 pixel line width, you might want to change the corresponding offset to 0.5 so the lines are drawn lined up with the pixels and don't get aliased.
Color - colour of the hex grid, spelling the American way ;)
Just a note that the grid dimensions and offsets are always to the center of the lines, so if you run the script again with a different colour and a thinner line width you can get some neat effects:
Hope this is useful. Suggestions on improvements or general comments and criticisms welcome.
Thanks again for making this, it works great.
I cannot get the script to work, could someone please explain how to add this script to Gimp. when i refresh scripts i get an error message
it says: Error: not a number (errorbj SF-SPINNER)
What version of gimp are you using?
Originally Posted by Stormcrow
Sorry - I have no way of testing it on that old a version of Gimp. It works on 2.4 and later, as far as I know. (There were big changes in the script interpreter somewhere in there...)
In any case, I would suggest upgrading your version of gimp, probably to 2.6.5, as I hear there are some problems with 2.6.6
This might sound ignorant of me but how do i upgrade to 2.6.5
Depends on the OS. What are you using?
If windows, download the latest built installer and install it overtop.
If linux, if it is supported my your package manager, get it that way.
If you download it and build from source, you probably wouldn't be asking the question ;)
Mac - no idea.
Hy updating from a so old version may be better FOR WINDOWS unistall first
and delete the "personal" gimp directory, before reinstall
If you use Windows easier way may be use REVOunistaller.
(or use after unistall SEARCH to find and delete your personal gimp folder ...i suggest Revo just because it may be handy to unistall also other SW, that if not would left some crap or even problematic dll behind)
This because is possible that you had installed extra plugin or script that now will be incompatible with 2.6,
For minor update (i.e from 2.6.x to 2.6.y) you may just overwrite
Aargh. Up until a day ago or so, I've been using the Mosaic filter for hexes. Well, I've dicovered they were not what I wanted when I tried to alter their hue (not perfect hexes due to the applied light and depth). So, I downloaded your script but I can't get it to run with my desired values (element; side to side, length 30, line width 1). Instead it gave me these error messages;
Calling error for 'Hex Grid':
Procedure 'script-fu-hex-grid' returned no return values
and vanished from my filter dialogue. It reappears after restart. I am using version 2.6.4 Any ideas?
Edit- Ok, I got it to run. It could be that my nearly antique machine just couldn't handle the load. I restarted my computer (to clear the cache), went straight to GIMP and used a new clean white file (still preserving as much virtual memory as possible). Ta-da, hexes. Copy to the file with my map and all is right with the world. If you have any additional thoughts for future use though, I'd be happy to hear them.