View unanswered posts | View active topics



Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
[FD4] Assets Packager Plugin 
Author Message
Member

Joined: Thu Mar 14, 2013 7:40 am
Posts: 8
Location: Japan
Reply with quote
Description
A simple plugin to generate SWC, SWF, and AS3 code for embeding assets.

SourceForge Project Page

Usage
Just right click assets folder on Project Manager, and select "Package assets".


Image


For example, assets/image/Background.png file is converted to assets.image.Background class.

You can also right click font file to edit font settings(fontName, embedAsCFF and unicodeRange).

Features
- embed jpg, png, and gif as BitmapData.
- embed ttf, otf, dfont and ttc as Font.
- embed mp3 as Sound.
- embed as and mxml as Class. (new in v1.2.0)
- and embed other formats as ByteArray.

Video Tutorials
http://youtu.be/LvWUuh4yQdE

History
2013/06/15
- v1.6.0
fix project closing problem
support class prefix
2013/05/25
- v1.5.0
add a extensions setting, "Sprite Extensions" and "MovieClip Extensions"
support ".svg" and ".svgz" as Sprite
2013/05/03
- v1.4.1
fix uppercase alphabet range
2013/04/13
- v1.4.0
support ".ttc" as Font
add font settings, "bold" and "italic"
add a extensions setting, "Bitmap Extensions"
fix typo
2013/03/18
- v1.3.0
support multibyte file name
add file name check before compile
add a new setting, "Additional compc options"
2013/03/15
- v1.2.2 fix uppercase extensions problems.
2013/03/14
- v1.2.0 add two file types, "source files"(as, mxml) and "ignored files".
- v1.1.2 fix cross-volume problem
- v1.1


Last edited by shohei909 on Sat Jun 15, 2013 6:59 am, edited 10 times in total.



Thu Mar 14, 2013 8:46 am
Profile WWW
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3061
Location: Finland
Reply with quote
Nice plugin, great work! For correct and easier installation, could you wrap this in to a FDZ extension and copy it to user files instead of install directory? See docs for help.


Thu Mar 14, 2013 8:57 am
Profile WWW
Member

Joined: Thu Mar 14, 2013 7:40 am
Posts: 8
Location: Japan
Reply with quote
Mika wrote:
Nice plugin, great work! For correct and easier installation, could you wrap this in to a FDZ extension and copy it to user files instead of install directory? See docs for help.

Thanks!
I uploaded .fdz, and will updete Video Tutorials soon!!


Thu Mar 14, 2013 9:15 am
Profile WWW
Member

Joined: Fri Oct 16, 2009 12:35 am
Posts: 20
Reply with quote
Great work - thanks


Thu Mar 14, 2013 9:27 am
Profile
Member

Joined: Tue Aug 31, 2010 1:39 pm
Posts: 134
Reply with quote
I have a similar tool, made in PHP.
I was thinking about porting it to AIR, but now I don't need it anymore, since your plugin is better coupled with the IDE (it's a plugin after all, not a external tool), have more options (SWC and SWF, mine only generate classes), and are easily configurable (what kind of files will be translated to what kind of class).

Sadly, I'm having a strange problem when I try to pack my assets.
The following is printed in the Output Panel:
"Source and destination path must have identical roots. Move will not work across volumes."

If I disable the "AS3 Output" in the config it works properly (except that there is no .as files, only the SWC and SWF)...
I think that it may be related to the fact that I have a volume for system and programs (C:/) and one for data (D:/), where I keep all my projects.

_________________
"Tu deviens responsable pour toujours de ce que tu as apprivoisé" - Antoine de Saint-Exupéry


Thu Mar 14, 2013 1:29 pm
Profile WWW
Member

Joined: Thu Mar 14, 2013 7:40 am
Posts: 8
Location: Japan
Reply with quote
NemoStein wrote:
Sadly, I'm having a strange problem when I try to pack my assets.
The following is printed in the Output Panel:
"Source and destination path must have identical roots. Move will not work across volumes."

If I disable the "AS3 Output" in the config it works properly (except that there is no .as files, only the SWC and SWF)...
I think that it may be related to the fact that I have a volume for system and programs (C:/) and one for data (D:/), where I keep all my projects.


Thanks for a problem report!

I fixed this bug in new version 1.1.2. Please try it.


Thu Mar 14, 2013 2:15 pm
Profile WWW
Member

Joined: Tue Aug 31, 2010 1:39 pm
Posts: 134
Reply with quote
Works like a charm now...
Great!!

May I ask you one more thing?
Take a look at this:
Image

In my projects I always put the assets folder inside the project structure.
I do this to keep the asset package name consistent with the classes that uses the asset.

When you right-click in a folder (e.g.: ./assets/) and then "Package Assets" the compiler can't see that this folder is part of a bigger folder structure.
To "fix" this, I pack the upper folder (e.g.: ./nemostein/).
This have two consequences:

1st, it fixes the package name of the asset class:
Code:
package nemostein.sampleproject.assets {
   import flash.utils.ByteArray;
   [Embed(source='../../../../../../src/nemostein/sampleproject/assets/test.txt', mimeType='application/octet-stream')]
   public class test extends flash.utils.ByteArray {}
}


2nd, it tries to pack the .as file as a asset, not a class:
Code:
package nemostein.sampleproject {
   import flash.utils.ByteArray;
   [Embed(source='../../../../../src/nemostein/sampleproject/Main.as', mimeType='application/octet-stream')]
   public class Main extends flash.utils.ByteArray {}
}


Well, I would like to ask if you can add another list of file types to be treated differently.
This list of "source files" would have two types: "as" and "mxml".
I don't use MXML at all, but someone else may find this useful.

So, when you pack some folder, the parser will copy those files, instead of parsing it and embedding.
When you want a "AS3 Output" the class will be there.
When you want a "SWC/SWF output", the class will be compiled correctly.

_________________
"Tu deviens responsable pour toujours de ce que tu as apprivoisé" - Antoine de Saint-Exupéry


Thu Mar 14, 2013 2:59 pm
Profile WWW
Member

Joined: Thu Mar 14, 2013 7:40 am
Posts: 8
Location: Japan
Reply with quote
>>NemoStein

Thanks!

I released v1.2, and add two file types.

First, "source files" (.as and .mxml are default) which are simply copied to as3 output folder and packaged into swc and swf.
Second, "ignored files" which are completely ignored.

You can edit these settings at Tools >> Program Settings >> AssetsPackager.


Thu Mar 14, 2013 4:46 pm
Profile WWW
Member

Joined: Tue Aug 31, 2010 1:39 pm
Posts: 134
Reply with quote
Just perfect! ^_^

I thought about the ignored files just after posting about the source files, but I didn't want to double post, so I kept the idea for myself...
Thank you very master ultra much!

This plugin is the best one released so far...
It render useless external tools to pack assets (like mine) because it is integrated to the IDE, the ExportSWC plugin (which is great) because does (almost) the same and more and is a really elegant way to set the unicode range of chars of a font.

If there was an award to best plugins available, I'd give to you...

_________________
"Tu deviens responsable pour toujours de ce que tu as apprivoisé" - Antoine de Saint-Exupéry


Thu Mar 14, 2013 4:55 pm
Profile WWW
Member

Joined: Wed Apr 09, 2008 2:40 pm
Posts: 30
Reply with quote
Hi, the idea is brillant but I can get it to work.

I have an assets folder with fonts in it. I haven't change anything in the plugin's settings. When I click on Package assets, here is the log I get :
Code:
AS3:Sucessed
C:\Program Files (x86)\Adobe\Flex 4.5\bin\compc.exe -include-sources "D:\projets\pro\Rosemood\FPN\AIRServer\lib\assets\assets_as3" -output "C:\Users\Kodiak\AppData\Local\Temp\AssetsPackager\tmp6\library.swc" -compute-digest=false -strict=false
Chargement du fichier de configuration C:\Program Files (x86)\Adobe\Flex 4.5\frameworks\flex-config.xml


Then a folder "assets" appears in the lib folder with AS files in it. But no SWC or SWF is generated.

If I try to delete the generated folder in lib, I get:
Code:
Could not be recycled: D:\projets\pro\Rosemood\FPN\AIRServer\lib\assets

   à ProjectManager.Actions.FileActions.Delete(String path, Boolean confirm)


Asset ackager 1.20, FD 4.3.0


Fri Mar 15, 2013 2:43 pm
Profile
Member

Joined: Thu Mar 14, 2013 7:40 am
Posts: 8
Location: Japan
Reply with quote
>>Kodiak

Hi! Thanks for using Assets Packager!

It takes a time to package large font files. So please wait a few minutes. You will get:

Code:
Swc:Sucessed
or
Code:
Swc:Failed


Fri Mar 15, 2013 5:07 pm
Profile WWW
Member

Joined: Wed Apr 09, 2008 2:40 pm
Posts: 30
Reply with quote
Hi again,

I tried with one ttf file and it works fine.
In my project I have 66 font files (11.4 MB) for a text editor. When I launch the packager, the 66 AS files are created but even after more than one hour, I can't get any feedback nor compiled file. Is there a way to enabled a verbose mode or something to diagnose if a specific step failed?

Thank you!


Sun Mar 17, 2013 12:30 pm
Profile
Member

Joined: Wed Apr 09, 2008 2:40 pm
Posts: 30
Reply with quote
Alright, it unlocked itself after a few hours telling that some of the file names were not class compliant (spaces, hyphens...). So I edited these font names and it compiled within a minute. I don't know what took so long before showing the errors the first times.
Suggestion: maybe the renaming of the assets classes could be automatic.

Is there a way to modify the AS files (to insert the correct FontFamily and FontName) and then recompile the package without overwriting these manual modifications?

Thank you for your support!


Sun Mar 17, 2013 5:56 pm
Profile
Member

Joined: Thu Mar 14, 2013 7:40 am
Posts: 8
Location: Japan
Reply with quote
>>Kodiak

Thanks for your reporting!

Quote:
Suggestion: maybe the renaming of the assets classes could be automatic.

I released v1.3.0, and added a simple file name check and automatic coverting spaces to "_" !
In many cases, you can know immediately if file names are incorrect.
Further, multibytes file names are available now.

Quote:
Is there a way to modify the AS files (to insert the correct FontFamily and FontName) and then recompile the package without overwriting these manual modifications?

Yes! there is!
Since v1.2.0, you can package source files.

step1. Rename generated output folder.
step2. Package modified as3 files.

Image


Mon Mar 18, 2013 5:37 am
Profile WWW
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3061
Location: Finland
Reply with quote
Minor possible typo fix: Swc:Sucessed should be SWC:Success or just SWC:Done. :)


Mon Mar 18, 2013 6:25 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 24 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.