SL GIMP PRODUCTIVITY SCRIPTS-FU

As
a content creator in Secondlife, and having made the choice to work
with open source applications, I make a daily use of the GIMP for both
classic texturing and sculpted map edition.
When creating images for
SL content, I have to repeat some tasks dozens of times, when not
hundreds, and when the work load increases, it turns into a real click
nightmare to repeat steps again and again...
I really love the GIMP for plenty of reasons, but in a workflow perspective, one has
to admit it has some severe drawbacks when compared to the commercial
bitmap editing mammoths, amongst which the annoying impossibility to
record macros.
Fortunately, GIMP can be (not so :) easily extended using Script-Fu's, so I decided to write my own, and forget my recurrent mouse tendonitis ( seriously ! )
**************************** Export a scaled copy of a xcf master to a tga file:
You
work on a high resolution image, say 1024*1024, to achieve sharp
drawing in details, but you want a lighter texture in world, say
512*512.
The usual method would be : duplicate image, scale
image, save as --- total 10 clicks, 3 fields to fill in for size and
new file name. Multiply this by 16 colour variations for your top
fashion tee shirt, you begin to see the point.
export-scaled-tga.scm does it all for you in 2 clicks
Once installed, the script will appear in the menu as Image->Export a scaled TGA...
I choosed to set it here, so that I don't need to dig far in the menu branches.
So your 1024*1024 master is nice, right click on it, a window opens :
The script should be self explanatory , but here are the options :
** The two top fields set the width and heigth of the new copy
** "Try to keep aspect ratio" : only useful if you
set the new size with a different proportion. If this option is
checked, the script will override either X or Y to create a copy with
the same aspect ratio as the original, with the closest size to what
you entered above. I do not use that option.
** "Save as
<filename>.<x>.<y>.<suffix>" : if checked, the
script will save your scaled copy automatically , in the same folder
where the original file is, appending width and height information to
the new filename. Otherwise, the script only works on a temporary file.
eg : "mynicetexture.xcf" will turn into "mynicetexture.256.256.tga"
** "View in a new window" : if checked, the scaled copy will pop up in ... a new window !
** "RLE Compression" : if checked, GIMP will compress the texture with Run-lenght encoding
** "Origin to bottom Left" : if NOT checked, origin will be at TOP LEFT, see ? ^^
******************************* Mirror a scupltie map on a given axis
Mirroring
a sculpted prim is easy. You just invert the values for the Red, Green,
or Blue channel , respectively for a X, Y , or Z mirrored prim.
Usual
method : Image->Duplicate ; Color-> components-> decompose; in
the new image, select the layer you want ot flip; Color->invert;
Color->components->recompose ; back to the copy, Image->Save
As..............I didn't count the clicks...
sculpty-flip.scm does it in 2 clicks
Once installed, the script will appear in the menu as Image->Mirror a SL sculpty map...
Options are really simple :
** "Mirror Axis" : choose X, Y or Z
** "Save as
<filename>-<axis>.flipped.<suffix> : if checked, the
script will save a copy of the original file, appending mirroring info
to the new filename, in the same directory where the original is.
eg: "mywhickedsculpt.tga" becomes "mywhickedsculpt-Z-flipped.tga" , for instance.
** "View in a new window" : if checked, the mirrored
map will pop up in ... a new window !
****************************
Prepare a SL
sculpt map for a better losless import
This one is more a dirty workaround to a problem that ( hopefully ) should be fixed in the SL viewer.
I export my sculpted meshes using Domino's blender export script with much satisfaction.
I
noticied that to achieve the best results, I have to first create
256*256 sculpt maps in blender. Then I scale it down to 32*32, using
cubic interpolation, then scale up to 128*128, using no interpolation.
This brings a "pixelized" 128*128 texture, which seems to be the best
candidate I found for SL losless import, reducing drastically the
ripple effect that I have with any other methods. Again, hopefully this script will turn to obsolete soon ^^
The usual method is painful and long.
sculpty-losless-prepare.scm helps a lot :
Once installed, the script will appear in the menu as Image->Prepare a SL sculpy map for losless SL import...
Here we only have 2 options, save, or view. I guess you understood how they work ^^
************************
Well, that is my 2 cents for open source SL creators, I really hope this helps.
I release these scripts under the GNU Public Licence, feel free to mod them and make them better.
They are developped for the GIMP 2.4.0
TODO would be : - making sure that the master file was previoulsy saved
- check that the file type is a 3 letters suffix.
these scripts will work on a 'jpg' but not on a 'jpeg' or 'tiff'
- check that the image is a RGB image for
sculpty-flip.scm
- probably
other issues, my side I didn't find.
I want to thank Roland Berger http://fuchur.dynup.net/gimp/thumbnail.html , http://fuchur.leute.server.de
for having written thumbnail.scm, on which I based the scaled export
script, and which allowed me to understand how this all work, despite a
severe headache. Well, better a good headache than a tendonitis.
******************************
Some nice links
http://remixreality.net/secondlife/
http://www.gimp.org/docs/scheme_plugin/
http://www.gimptalk.com/