EDITOR PLUGIN: "GIF to View Importer" version 1.0 released! (.NET 2.0)

Started by SpacePaw, Thu 26/03/2009 00:01:43

Previous topic - Next topic

SpacePaw

Okay,
It is done.
(Requires .NET 2.0 framework installed on your machine. I think there's Mono framework for linux users)
http://www.box.net/shared/xe5t4s2431 (put in main AGS folder)

Screen:


It should work just fine BUT I don't take any responsibility if it screws something up :) It has been tested only by me so far. Feel free to play with it. I hope you all will find it useful and that it will speed up the view creating proces (at least a bit).
Please post any found errors here (critical and small), describe them and describe what you were doing (printscreen is always welcome too). I'll try to release updated version as soon as possible. If you find something annoying or think about new small feature it could use - feel free to reply here as well :)

I hope the interface is quite selfexplainatory but I'll try to describe it in a second in a new reply :)

EDIT: Added screenshot and uploaded new file :) Now it's scrollable when editor window gets too small lol. Small things small things... Any comments on the plugin are welcome! :3

EDIT 2: Now storing the plugin on box.net cuz it rocks!

EDIT 3: My bad, it needed .NET 3.5 framework but it was due to project settings. Changed back to .NET 2.0 now. Although you all should download latest version anyway :) (file at the link is updated)

EDIT 4: Oh and if you have "To XML!" message while saving game please download plugin again. It's just a thing I tested and forgot to delete from the .net 2.0 version :)

SpacePaw

#1
Use manual:

Main features provided by the plugin are as follows:
1. Adding new view with one loop containing frames from imported GIF
2. Adding new loop to an existing view from a GIF
3. Overwritting a loop in an existing view
4. Overwritting existing view with new one with one loop containing frames from imported GIF
5. Adding sprites only converting frames from imported GIF into them

Doing 1:

a. Select folder where you want to store new sprites (gif frames) for the view on the sprite folders tree view (one on the left)

b. Select folder where you want to put your new view in on the views tree view (one on the right). Notice that "View update options" get disabled. They are used in case when you select a view to update instead of folder. You can only add completely new view when a folder (not a view) is selected.

c. Make sure "Only add sprites" is unchecked.

d.  Now you must decide how to read transparency of every GIF frame chosing an option from transparency combo box.

e. You can decide to read your gif's frame delays as AGS delays. ie. when delay between gif frames is 25 milliseconds you will get AGS delay 0 when the "Read GIF frame delay as DLY" is unchecked and 25 if it is checked.

f. Choose a name for your view. Gif importer provides you with a first "View"+number availible frame. If you enter an existing name nothing wrong will happen :) The GIF just won't be imported and you'll get message about wrong name

g. Hit "Import GIF file" and choose a valid gif file to import (it doesnt have to be animated - it will be treated like 1 frame animation then). When you open the file you will (most probably) get a message about success :)


Doing 2:

a. Select folder where you want to store new sprites (gif frames) for the loop on the sprite folders tree view (one on the left)

b. Select view where you want to put your new loop in on the views tree view (one on the right). Notice that view name entry box gets disabled and you can see you'r chosen view's name there. "View update options" get enabled

c. Check "Add new loop" radio button.

d. Make sure "Add sprites only" is unchecked

e. Select anything you want in "other options"

f. Hit import


Doing 3:

a. Select folder where you want to store new sprites (gif frames) for the loop on the sprite folders tree view (one on the left)

b. Select view where you want to put your new loop in on the views tree view (one on the right). Notice that view name entry box gets disabled and you can see you'r chosen view's name there. "View update options" get enabled

c. Check "Overwrite loop number" radio button and choose loop number you want to overwrite from the numeric up/down right next to it.

d. Decide if you want to delete old sprites used by the chosen loop so far by checking or unchecking "Delete old sprites when overwritting". When checked it will try to delete every sprite it finds in the loop frames. If it finds out that it is used somewhere besides the loop it won't delete it.
There's one exception - if sprite it tries to delete, besides existing in the loop, is used only in rooms or scripts it WILL GET DELETED ANYWAY causing game and/or editor crashes!. THINK before checking this option.

e. Hit import


Doing 4:

Same as 3 but you have to check "Overwrite whole view" instead of "Overwrite loop number".


Doing 5:

a. Select folder where you want to store new sprites (gif frames) on the sprite folders tree view (one on the left)

b. Check "Only add sprites"

c. Hit import

Pumaman


SpacePaw

To those of you who are interested - I'm going to make new version, allowing you to choose idividual frames to import! Something like a gif maker where you first specify files, then move them up down to get the right order, specifying delays for them etc. then click ok and voila! This will support alpha channel so people working in wider color depths and advanced transparency will be happy to hear that :)

Everyone interested say "ARGHHH!" :)

Dualnames

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

subspark



SpacePaw

Quote from: Dualnames on Sat 28/03/2009 21:47:48
ARGHHHH?

Well done, btw love that mouse sprite. :D :D

It's a rat ;)
Okay I see 3 people wanting it :3 It's enough to get started ^^

Shane 'ProgZmax' Stevens

I like where this is going!  I think it would be more useful if you could actually see the contents of a view next to the sprite import so you can see exactly what goes where as you're importing, though.  A reduced version of the normal view editor with smaller thumbnails would work.

SpacePaw

Quote from: ProgZmax on Sun 29/03/2009 12:26:46
I like where this is going!  I think it would be more useful if you could actually see the contents of a view next to the sprite import so you can see exactly what goes where as you're importing, though.  A reduced version of the normal view editor with smaller thumbnails would work.

Could you please be more specyfic? maybe a quick sketch or mashup from a printscreen? :)

Ghost

I'd like to add my AARRGH to the list   ;)

Very good work, works like a charm! A bit rough around the edges, but what do I care?

Could we have found an SSH-code-alike???  :o

SpacePaw

Quote from: Ghost on Sun 29/03/2009 13:52:11
I'd like to add my AARRGH to the list   ;)

Very good work, works like a charm! A bit rough around the edges, but what do I care?

Could we have found an SSH-code-alike???  :o

also if you know how to un-rough it please let me know :) I'll do my best to make it better.
I also thought about a wizard thingy like 1. What do you want to do? (add view, add loop etc), 2. Choose a method (import animation, import images for frames), 3. Where do you want to place it? (folders), 4. Specify files (just one file for animation and the gif creation like thingy) 4. transparency, 5. finish

you know what I mean :P

Any ideas how to make interface more pleasant to use?

subspark

I'd like to see an option where the gif can be imported into a blank view. "Add new view" could go above Add new loop.

Cheers,
Sparky. :P

SpacePaw

Quote from: subspark on Sun 29/03/2009 22:03:04
I'd like to see an option where the gif can be imported into a blank view. "Add new view" could go above Add new loop.

Cheers,
Sparky. :P

Well what do you mean? you CAN add a new view by choosing folder and view name. and you can add a loop to an ampty view too :)

subspark

Sorry SpacePaw I'm totally blind and insane! ;D
Whoops. How did I miss that.
This is a fantastic plugin btw! Loving this!

Cheers,
Sparky.

Pumaman

Judging by the error reports that have been sent, it looks like this plugin requires .NET 3.5. Is this the case, and if so maybe you could add a note about this to the first post?

SpacePaw

Yeah it was my fault - forgot to change to the older framework in the settings. It should work on the older ones now :)

Hmm not yet. Sorry, build failed, thought it succeeded lol. I'll try to make it 2.0 compatible - it's still 3.5 now :)

SpacePaw


Dualnames

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Pumaman


Ruben654

ive got this error when clicking on the "import gif file" button
this is the error:
QuoteError: Method not found: 'System.String System.Windows.Forms.OpenFileDialog.get_SafeFileName()'.
Version: AGS 3.1.0.60

System.MissingMethodException: Method not found: 'System.String System.Windows.Forms.OpenFileDialog.get_SafeFileName()'.
   at AGS.Plugin.GifToViewImporter.ImportPropertiesPanel.btnImport_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

SpacePaw


Pumaman

The OpenFileDialog.SafeFileName property was added in .NET 2.0 SP1 -- therefore you probably need to install the Service Pack.

Alternately SpacePaw could update the plugin to use the FileName property instead which doens't require SP1 :)


Argyle

Thank you so much for this plug-in! After learning that AGS did not natively import animated GIFs with their frame delay properties intact, I grew to feel very very guilty for our project programmer after having sent him easily over 1500 frames worth of animated sprites that all had varying delays per frame on most of the sprites.

After I found and tested this last night after wading through a slew of search results on the forums, you really made me a happy man!  No longer will that 486 frame sprite for a cutscene weigh down my conscious, haha.  He will be thrilled when I tell him I found this!

Abisso

Quote from: Pumaman on Sat 15/08/2009 21:17:59
The OpenFileDialog.SafeFileName property was added in .NET 2.0 SP1 -- therefore you probably need to install the Service Pack.

Alternately SpacePaw could update the plugin to use the FileName property instead which doens't require SP1 :)


Unsurprisingly enough, you were correct. I had the same issue Ruben had and solved it by installing Service Pack 1 for .NET 2.0.

Quote from: Argyle on Wed 11/08/2010 07:04:54
Thank you so much for this plug-in! After learning that AGS did not natively import animated GIFs with their frame delay properties intact, I grew to feel very very guilty for our project programmer after having sent him easily over 1500 frames worth of animated sprites that all had varying delays per frame on most of the sprites.

After I found and tested this last night after wading through a slew of search results on the forums, you really made me a happy man!  No longer will that 486 frame sprite for a cutscene weigh down my conscious, haha.  He will be thrilled when I tell him I found this!

Lol... I truly felt relieved when you told me about this plugin. Then lost again when it didn't work (before installing .NET 2.0 Service Pack 1). But now I'm thrilled, yes. :)


Last, but not least (quite the opposite, as a matter of fact) let me thank you soooo much Spacepew. Quill o' the Wisp and me in particular, will use it to "forge" a better game, I'm sure. ;)
Welcome back to the age of the great guilds.

SMF spam blocked by CleanTalk