Sim City 4 Devotion Forums

Sim City 4 Devotion Tools => Tools - General Discussion => null45's Tools => Topic started by: null45 on August 01, 2009, 02:09:30 PM

Title: Gimp Fsh Filetype plugin
Post by: null45 on August 01, 2009, 02:09:30 PM
This is a Filetype plug-in I wrote to allow The Gimp to load and save Fsh Files.

(http://img12.imageshack.us/img12/9067/gimp982.png)

It will load all the images in the fsh file as layers.
The files will be alpha blended unless the file name contains "noblend" then it will disable alpha blending on that file.

When saving a file an options dialog will allow you to set the type of Fsh and if Mipmaps are to be generated for the zoom levels.

To install place all of the files in the folder into the Gimp's plug-ins directory (typically lib\gimp\2.0\plug-ins), they all must be in the main plug-ins folder not a subfolder. 

The "Generate Mipmaps" function requires Gimp 2.6.0 or later.

Download: GimpsharpFsh (http://www.mediafire.com/?0by6l1becnay146)

File version should be 1.2.2.6

I hope it is useful.  ;)
Title: Re: Gimp Fsh Filetype plugin
Post by: sithlrd98 on August 01, 2009, 02:18:40 PM
Do I need this one or is version I got the other day OK? Works great BTW!

Jayson
Title: Re: Gimp Fsh Filetype plugin
Post by: Tarkus on August 01, 2009, 02:47:49 PM
null45, thank you so much for this!  It'll be an absolute lifesaver for me, and I'm sure many others. 

-Alex
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on August 01, 2009, 04:09:12 PM
A bug in the save dialog fixed, File version updated to 1.2.1.0.

Do I need this one or is version I got the other day OK? Works great BTW!

This version allows you to select the type of fsh to save in a dialog rather than a command prompt console.
It also allows you to automatically generate the Mipmaps during saving.  :thumbsup:
Title: Re: Gimp Fsh Filetype plugin
Post by: sithlrd98 on August 01, 2009, 04:14:35 PM
 :thumbsup: Thanks...I'll check it out. As I have said before , thank you for these awesome tools...they make modding so much faster!

Jayson
Title: Re: Gimp Fsh Filetype plugin
Post by: dragonshardz on August 10, 2009, 05:04:41 PM
Quick question: Where would the plugins directory we need to place it in be located? I've found 3, one in my Program Files folder and two in my Documents folder
Title: Re: Gimp Fsh Filetype plugin
Post by: sithlrd98 on August 10, 2009, 05:27:46 PM
This is the one I added it to :C:\Program Files (x86)\GIMP-2.0\lib\gimp\2.0\plug-ins . Keep in mind I am using a x64 OS , so it may just be Program Files\Gimp\*

Jayson
Title: Re: Gimp Fsh Filetype plugin
Post by: dragonshardz on August 10, 2009, 06:32:40 PM
Jayson, my OS is x64 as well, so thank you for clearing that up.
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on August 10, 2009, 10:55:25 PM
Yes the correct path is
Code: [Select]
lib\gimp\2.0\plug-ins Although the Gimp has another plug-ins directory the main one is the easiest to use.  ;)
Title: Re: Gimp Fsh Filetype plugin
Post by: vil on August 11, 2009, 04:16:16 AM
Doesnt work for me (Win XP)  %confuso any ideas? Its there it just wont load or save.

(http://img197.imageshack.us/img197/944/vilfsherror.th.jpg) (http://img197.imageshack.us/my.php?image=vilfsherror.jpg)
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on August 11, 2009, 12:53:47 PM
Did it ever display the dialog to select the type of fsh when saving?

A bug in the error catching system and a bug in the Mipmap saving fixed, file version updated to 1.2.2.0. 

It now should display the errors during loading and saving and the Mipmaps should be saved correctly.
Title: Re: Gimp Fsh Filetype plugin
Post by: choco on August 11, 2009, 01:22:53 PM
will give it a try....thanks null45!  :thumbsup:
Title: Re: Gimp Fsh Filetype plugin
Post by: vil on August 12, 2009, 03:09:13 AM
Ah, now it tells me whats wrong, the notorious "non-english character in pathname" problem, I will need to re-install gimp.
Title: Re: Gimp Fsh Filetype plugin
Post by: cogeo on August 13, 2009, 11:49:59 AM
Great work here!  &apls

I have an idea: something that could be very useful to texture makers (I'm sure the NAM Team members will appreciate it A LOT) would be a FSH thumbnail extractor. Ie not an application, but instead a plugin that's installed under Windows and allows previewing certain file types (in our case .FSH files) in thumbnail view in the Windows Explorer.

I have to clarify though, that this isn't a "request", neither a "wish" from me, just an idea. You will have to ask more members (esp from NAM) to verify if there's really a need for this.
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on February 22, 2010, 11:18:37 PM
Updated to use the higher quality Fshwrite compression when writing DXT1 or DXT3 fsh files, a few bugs fixed.
File version updated to 1.2.2.3   ;)
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on May 19, 2010, 04:57:30 PM
A bug in the fsh type selection and a few other bugs fixed, Fshwrite compression is now a selectable option.

File version updated to 1.2.2.4
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on June 29, 2010, 11:30:15 PM
Updated to use The Gimp's image resize function when resizing the mipmaps, File version updated to 1.2.2.5.  :thumbsup:
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on May 31, 2011, 11:23:14 PM
DXT1 images will now load the alpha channel correctly, File version updated to 1.2.2.6.
Title: Re: Gimp Fsh Filetype plugin
Post by: Nijomi on June 01, 2011, 09:41:04 AM
Quote from: Cogeo
I have an idea: something that could be very useful to texture makers (I'm sure the NAM Team members will appreciate it A LOT) would be a FSH thumbnail extractor. Ie not an application, but instead a plugin that's installed under Windows and allows previewing certain file types (in our case .FSH files) in thumbnail view in the Windows Explorer.
Is this what you had in mind Fsh file Thumbnails for Windows (http://www.simtropolis.com/forum/files/file/22787-fsh-file-thumbnails-for-windows-xp-7-and-vista/). I have used this but removed it as it does not seem to be compatable with FSH2PNG MkII it seems to make FSH2PNG MkII crash when converting fsh to png in some cases.
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on June 01, 2011, 10:48:19 PM
What OS are you using?

Under Windows 7 there is a bug that causes the files to be locked by Windows. :thumbsdown:

Could you upload a sample file that makes FSH2PNG MkII crash?

Title: Re: Gimp Fsh Filetype plugin
Post by: Lowkee33 on August 24, 2011, 01:21:10 PM
Thanks again for another great tool!  :)

I'm mostly using this to combine FSH together as to not waste space (For example, an HD zoom 4 that uses 4 256x256 FSH when it only needs 1).  However, I am seeing my file sizes increase rather than decrease.

My particular BAT is a long and narrow, so I can merge the 16 zoom 4 FSH into 3.  The end file size is not as small as I think it should be (Especially compared to the original model with just the other 13 FSH removed).

I "save selected files" in reader, open in GIMP, edit, save (with FShWrite compression on), and "insert and compress".

Something missing?
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on August 25, 2011, 10:29:26 AM
Thanks again for another great tool!  :)

I'm mostly using this to combine FSH together as to not waste space (For example, an HD zoom 4 that uses 4 256x256 FSH when it only needs 1).  However, I am seeing my file sizes increase rather than decrease.

My particular BAT is a long and narrow, so I can merge the 16 zoom 4 FSH into 3.  The end file size is not as small as I think it should be (Especially compared to the original model with just the other 13 FSH removed).

I "save selected files" in reader, open in GIMP, edit, save (with FShWrite compression on), and "insert and compress".

Something missing?

Some files don't compress with QFS compression, in those cases the file should be 4 bytes larger than the uncompressed file.
Title: Re: Gimp Fsh Filetype plugin
Post by: Lowkee33 on January 06, 2012, 09:04:42 AM
Good Morning.  I just used "create mip-maps" for the first time while saving.  When I insert (compress as well) the FSH don't have the proper Group or Instances.  They are both 0x00.  Perhaps I am wrong with my use of the FSH plugin, but the whole time saving aspect of me doing this was that I wouldn't have to remember any TGIs.

Edit: I see that the plugin didn't make TGI files.  I think it would be safe to assume that anyone who is making mip-maps would be working on base/overlay textures, and in this case, working on the zoom 4 image.  Thanks.
Title: Re: Gimp Fsh Filetype plugin
Post by: null45 on January 06, 2012, 01:33:11 PM
It should remember the TGI for any images that have it when loaded, currently it can not be set on save.