RELEASE: Mohoptimize

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

RELEASE: Mohoptimize

Post by spasmodic_cheese » Sat Oct 23, 2004 5:59 am

Mohoptimize alpha.
http://www.peoplewhoeat.com/moh5/Mohoptimize.mxp
(Right-click> Save target as)

This script can halve the filesize of your exported moho swf's

This only works with Flash MX 04. It is a JSFL command that will go thru every frame and optimize exported moho frames. It will leave any symbols that are already optimized by moho. It will only optimize animations that are frame by frame.

I will be building upon this and improving it when I can.

Installation:
Save Target to your Commands Folder
i.e.
C:\Documents and Settings\<yourusername>\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Commands

Usage:
Export SWF from Moho
Import into Flash to Stage,
Run Mohotopmize. ( Commands > Mohoptimize )

Known Bugs:
- Flash MX04 will ask you every 15 frames or so that the script is still running, and whether you want to stop it or not. Unfortunatly there is no fix for this, so I'll have to find a workaround.

- Some pieces of your animation will get fncked up, and you will have to go thru and fix certain frames by hand. This is caused by the differences between flash player and the flash authoring tool. The flash authoring tool will only fnck up shapes that were glitchy anyway.

Its nothing special yet, but its functional. So I thought I'd share it with everyone.
Last edited by spasmodic_cheese on Tue Oct 26, 2004 10:40 am, edited 1 time in total.
User avatar
cribble
Posts: 899
Joined: Wed Aug 04, 2004 12:42 pm
Location: London, UK
Contact:

Post by cribble » Sat Oct 23, 2004 2:11 pm

Works a treat, I love you.... so much... so, so... much.

But seriously, great script.
--Scott
cribble.net
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Mon Oct 25, 2004 7:03 am

thanks cribble! at least someone likes it... :lol:

0.2 is released now, update!
This version runs twice as fast(TWICE AS DEADLY!), does batches of 20+ frames instead of 10 before asking to proceed. (actually it did the before/after example below, 72 frames, without asking at all)

Also now it keeps alot better quality, from your original moho file.
Unfortunatly there is still some glitches in output... but they are definatly minimized more now.

same link. same installation.
http://www.peoplewhoeat.com/moh5/Mohoptimize.mxp

Before:
http://www.peoplewhoeat.com/moh5/hefa.swf 281KB
After:
http://www.peoplewhoeat.com/moh5/hefaOpt.swf 48KB
Last edited by spasmodic_cheese on Tue Oct 26, 2004 10:40 am, edited 2 times in total.
User avatar
kdiddy13
Posts: 381
Joined: Tue Aug 03, 2004 10:26 pm
Location: New Zealand
Contact:

Post by kdiddy13 » Mon Oct 25, 2004 4:11 pm

Cool tool!

Just out of curiosity, what are those two sperms doing to that flying ice cube?
________
Vapir oxygen
Last edited by kdiddy13 on Mon Mar 07, 2011 4:53 am, edited 1 time in total.
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Mon Oct 25, 2004 4:49 pm

cheers, they are tentacles!!!!! :roll: :twisted:
User avatar
Lost Marble
Site Admin
Posts: 2194
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble » Mon Oct 25, 2004 5:14 pm

Hey spas - I like it too. In fact, it's going to give me the kick in the butt to get a new page up on the website where we can make other people's scripts and other tools available for download.

I'll let you know when the page is ready, and you can tell me if you want your tool available on it or not.
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Tue Oct 26, 2004 1:46 am

awsome, yeh sounds great go for it! ... i can pack it into an MXP or something so its easier to install (thru macromedias extension manager) and make it abit more formal.
Barliesque
Posts: 45
Joined: Sun Aug 08, 2004 10:58 am
Location: Los Angeles

Post by Barliesque » Tue Oct 26, 2004 9:05 am

Wow! That's a major drop in file size. Excellent work! :D
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Tue Oct 26, 2004 10:39 am

New Version!
http://www.peoplewhoeat.com/moh5/Mohoptimize.mxp 7.5KB

Is Accessible Via Windows > Other Panels > Mohoptimize

Installation:
Just double click, and let macromedias extension manager do the rest.
if you dont have that you can grab it here.
You should alraedy have it if you have flash.

http://www.macromedia.com/exchange/em_download/

Image
Postality
Posts: 248
Joined: Sat Aug 07, 2004 3:21 am
Location: Toronto, Ontario
Contact:

Post by Postality » Tue Oct 26, 2004 12:44 pm

It's great that it reduces the file size so dramatically, but in the examples the optimised one looks almost as though you used noisy lines settings, then lines are shaking as if they have a nerve conditions.

What's the deal with that?
Anime Studio - Ultimate Game Graphics
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Tue Oct 26, 2004 3:32 pm

Yeh..unfortunatly thats abit of a sideffect.. you can minimize that with smoothing. the examples were done with smoothing 0.

Theres no way i can really fix that without research and development and start charging for it. =/

If you look at optimaze and Swift3d which cost money...they also produce erratic lines.

I understand this is no excuse.

Perhaps I can make an option todo every second or third frame so it doesnt look so bad.

So i guess all im really saying its a difficult task to work with individual frames and make them match up with the next one, especially within flash.

When importing into flash swf's are like a sequence of images right after each other. Each frame is a completely different image to the frame before and after it.. no frame has any relations, except exported optimized layers in moho.

I cant tell or detect if that this shape in this frame is that shape in the next frame. Not without some needlessly complicated HEAVY math.

Can you see why its nearly impossible to do?

if you got any ideas im more than happy to develop them.
I personally dont mind the sketchiness...gives it that handdrawn(badly?) and inked feel. 8)
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Thu Oct 28, 2004 5:21 pm

hrmm ... has anyone any other suggestions for mohoptimize...

ive been thinking of the follow additions:

Optimize Curves CheckBox;
This will make sure artwork is exactly how it intended, no changing of curves but will make each frame a shape(which will still tidy up the flash file considerably).

Create cut and paste all symbols (moho optimized layers)
onto a seperate a seperate layer;
so they are easier to cut and paste onto their own layers. Since in flash all symbols are displayed infront of shapes, so its easy to fix layer ordering.

Batch frame rendering;
Set a start and end frame to optimize instead of doing the whole file.

Anything else?
musajoe
Posts: 40
Joined: Sat Aug 07, 2004 4:15 am

A cool Mohoptimize feautre...

Post by musajoe » Tue Nov 09, 2004 8:42 pm

They ablity to have it select all frames, convert to fills and color the fills one color ( black, green, whatever...) would be cool.

You could animate a figure in Moho and create a shadow by using the same .swf file from moho. Doing this (craeting a shadow figure from a moho .swf file) in Flash by hand is a pain.
Next
Posts: 7
Joined: Wed Aug 04, 2004 7:34 pm

and for Mac?

Post by Next » Thu Nov 18, 2004 12:19 am

Hi!!

Since I can use this tool for MacOs X?

Thanks

NEXT :)
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese » Fri Nov 19, 2004 9:51 am

You certainly can if you have flash mx 04 on your mac

its a panel within flash.

I probably wont be updating it for awhile, im only on the net once a week max
Post Reply