am2swf manual
Introduction
am2swf is a plugin for Hash Animation:Master 9.0q and higher.
It exports Animation:Master Actions and Choreographies directly to a Macromedia Shockwave Flash (SWF) Files.
Version 1.0 of am2swf is available for Animation:Master 9.0q only.
Version 1.1 and higher is available for Animation:Master 9.5 and higher only.
Purchasing one version makes the user able to use both versions.
[Choreography support is only available on 1.2 and higher]
The product homepage is located at http://www.kci-group.com/z/am2swf.htm.
This document is located at http://www.kci-group.com/z/am2swf-manual.htm.
A download version of this document is available at http://www.kci-group.com/z/am2swf-manual.zip.
A japanese version of this document is available at http://www.dep.sme.co.jp/tayutau/storeroom/am2swf/am2swf_manual_j.htm.
Please see this manual for a downloadable japanese version.
Interface
Click the interface elements to jump to the assiciated maual section.
How It Works
The internal process of the plugin looks like this:
Step 1: converting the patch data to polygon data. (see Subdivision)
Step 2: lighting (see Light)
Step 3: camera transformation (see Camera)
Step 4: culling (see Culling)
Step 5: coloring (see Color)
Step 6: clipping (see Flat Render)
Step 7: writing
Preview [1.4 and higher]
Enter a frame number to the input. Hit Preview.
The selected frame will be rendered and displayed in a new window.
This function is very useful for finding a suitable style for your output.
To make it work you need to have .swf files associated with the flash player. Installing Macromedia Flash or its trial version will make this assiciation for you.
File (1)
Select the output directory and file with the browse dialog.
Range (3)
The frame range to be exported can be automatically selected (Range > All), or manually specified (deactivate Range > All).
The plugin will generate one SWF for the whole animation, containing the selected frames.
From, To
Specify the first and the last frame to be exported.
e.g. From=5, To=10 with a stepping of 1 will export the Frames 5, 6, 7, 8, 9.
Stepping
To make your animation faster or just skip frames to make the file size smaller increase the stepping.
A setting of 2 will export every second frame of the selected range.
Negative stepping values that make it possible to create reversed animation are supported.
Subdivision (2)
Since patches are difficult to transform to a 2d vector representation they are transformed to polygons which have straight edges and are therefore much easier to handle.
One Animation:Master patch is being divided to multiple polygons.
The setting 1 just flattens each patch to a face.
4 subdivides each patch into 4 polygons.
Variable subdivision uses as many polygons as needed (min 1, max 16) to make the surface look "good". A:M decides based on the curvature of a surface what looks good.
A good setting depends on your Model, complex Models work nice with a subdivision of 1,
while very simple Models work better with 4.
There are some drawbacks in using Variable Subdivision: due to the Variable resolution of the model, there can be small "cracks" in the export.
Lights (5)
Multiple in Action/Choreography lights are supported. These lights influence the exported faces in shaded mode.
Create new lights by right-clicking in your Action (or Choreography) window and selecting New > Light.
Animation of the lights is fully supported.
Default Lighting
If no light is found in the Action/Choreography, a default lighting scheme is being used. This is a parallel light from the right with intensity=100.
Parallel Lights
All lights will normally be treated as omni lights. In some situations parallel lights serve the animators needs better, so you can currently switch all lights to be parallel by the switch Lights > all parallel.
Parallel lights are directional. That means you will have to give them the correct direction in a:m as well.
This demo shows the difference between omni and parallel lights (just click the light model you want to view):
Intensity
This is currently the only supported attribute for lights. Don't set this value too high, otherwise the faceted look of the shaded export will become very extreme.
Values between -100 and +100 are good.
Camera (4)
Rendering from in-Action/Choreography cameras is supported. In the section Camera of the plugin specify the name of the camera you want to render.
Animation of the camera is fully supported.
Default Camera
If the camera you specified can not be found, a default camera is being used. This camera is a parallel camera and renders the front view.
Move Camera center to 0|0 in movie [1.3 and higher]
This toggles the center of the camera to be at the center of the movie or at 0|0 of the movie.
The 0|0 position can be useful when importing to Flash Symbols instead of the main timeline.
Perspective
You can turn the perspective distortion of the camera on/off with the switch Camera > perspective.
The Animation:Master 9.5 version of the plugin will not have this switch anymore, but will read this information directly from your camera (set its type to orthogonal).
Culling
This small demo shows the results you get with the various settings for culling.
Just click the attributes to modify them.
The transparency was added in Flash. Transparent faces in A:M will neither be culled nor make other faces subject to cull via Occlusion Culling.
Backface Culling (8)
BFC omits faces that are turned away from the camera. BFC relies on normal direction in Animation Master, so be careful to have all normals facing outwards. [Shift]-[1] makes normals visible in Animation:Master. Select patches whose normals are wrong and use [F] to flip them.
shaded mode (normal mode):
Switching BFC on roughly halves the file size of the generated SWF.
flat rendered mode (see Flat Render):
Switching BFC on reduces the export time considerably.
Occlusion Culling (7)
OC attempts to determine which polygons are visible in the exported frame by drawing an Occlusion Map.
This simply is a bitmap on which the scene is rendered and then the bitmap is analyzed for the seen polygons.
Complex multi layered objects or multiple objects that overlap each other particularily benefit from this setting.
Map Size
This sets the size of the Occlusion Map. A value of 500 will set the map to a size of 500 x 500 pixels.
What is a good value for this parameter largely depends on your geometry and what result you want to achieve.
Small Maps (around 100) will be good for keeping file sizes low, but will cull smaller patches that should be visible.
Large Maps (around 1000) will be very accurate, but export time will increase.
Minimum Area
This sets the number of pixels needed on the Occlusion Map to make a polygon "visible".
The polygons center pixel is given more importance (counts for 40 pixels), This makes small faces "stronger" on small maps.
Of course this value depends on your geometry, the output you want and the selected Map Size.
A value of 10 goes quite well with a Map Size of 500.
Color (Surface Attributes)
The colors for the export are directly taken off your Model.
Be sure to switch the Animation:Master viewport to shaded mode, otherwise the plugin will not get the color information and export a grey Model instead.
Color can be applied at any of Animation:Masters access points for that, including a material, a group and the Model.
[information for 1.0 only]
Color animation is not supported (9.0), all frames of an animation will be exported with the color setting of the frame that the Animation:Master viewport was showing when the plugin was started.
[1.1 and higher]
Full color- and Attribute animation is possible.
Supported surface attributes are:
Diffuse Color
This is the base color for the surface. Shadows will gradually darken this color to black.
Transparency
This is the alpha value of the surface.
Also see density.
Density
This will be exported as "Transparency Falloff".
A value of 0 means faces are completely transparent when looked straight at face normal. The more a Face turns away from the camera the more it takes the value of "Transparency" as its transparency.
A value of 100 means, there is no variation in transparency depending on the viewing angle of each face. All faces will take value of "Transparency" as their transparency.
Density has no effect on flat rendered exports (see Flat Render).
Ambiance
This sets a base Brightness for the surface.
0 means lights interact normally with the surface, 100 means the surface is always fully lit (no shadows).
Glow
ON means an outline (wireframe) is redered for faces with this attribute.
The color for this outline is set in the section "Wireframe (Glow)". See Wireframe (Glow).
OFF means no outline is rendered.
Wireframe (Glow) (6)
The surface attribute "Glow" activates the wireframe. this draws a line around each poly of this surface.
when used if Flat Render mode, the outline is drawn for the whole shape.
Color
Select the color for the wireframe.
Thickness
The thickness for the wireframe.
The unit of this setting is TWIPS, the standard Flash unit (twentieth of a pixel).
Flat Render (9)
This shading mode exports without any lighting.
But the polygons are not exported individually, but are rather combined to bigger shapes (if you want the polygons individually, but a flat look, use the Ambiance surface attribute).
The big advantage of this mode is the file size. This pays especially for animations.
Minimum Edge Length
This is an option to even further reduce the export size of your SWF. Edges below the specified length will be omitted.
The unit of this setting is TWIPS, the standard Flash unit (twentieth of a pixel).
Setting this to a good value will take sout quite some complexity of the export without losing much detail.
What is good depends on your Model and i'd advice you to try different settings.
A value of 5-10 was good for the spaceman from the Hash Animation:Master cd.
Small gaps can be introduced by this setting.
Several surface attrubutes can be used to modify the look of this gradient:
Render Specularity as Gradient [1.3 and higher]
This feature renderes the first scene light as radial gradient on surfaces.
This gives the objects a more 3D - like look while still maintaining the small file sizes you are getting with Flat Render.
It only works on one light due to the nature of Flash gradients.
The gradients center is exactly where the lights center is.
The gradient Size depends on the Light's Falloff value, the distance to the light (basically how big the Falloff looks in the correct a:m view) and the specular size (see below).
Scale transformation on the light can be used to apply scale transformation to the gradient, e.g. scaling X to 50% will result in the gradients width scaled by 50%, Y influences its height.
Roughness (Select Light) [1.4 and higher]
Selects the light being used for the gradient.
Roughness=1 will select "Light1", Roughness=2 will select "Light2" and so forth.
Setting to a value that has no corresponding Light will make the plugin use the first light it comes accross.
Lights named other than "Light*" can not be selected.
Note however that the Shortcut names will be used! so having a light named "Martha" and the Shortcut in your choreography/action is named "Shortcut to Light66", you will be able to select this light by using 66 for your Roughness value.
Specular Color
Sets the "hot" color (the gradients inner color).
Diffuse Color
Sets the base color (the gradients outer color).
Specular Size
Sets gradient radius as percentage of the used light's falloff radius.
0 for this value means no gradient is rendered for this surface.
See the interactive example below.
Specular Intensity
Sets size of the gradients "hotspot" as a percentage of the effective gradient's size (see specular size).
See the interactive example below.
Interactive Example
Type in values for the Specular Size, Intensity and Roughness to get a quick preview of the output.
Safe Mode (0)
A:M has a bug with Windows XP that will corrupt the first frame of an exported animation as well as other frames if you excessively use multitasking. This workaround lets you void the corruption, but at the expense of longer export times.
Frame 1
Correct the corrupted Frame 1.
All Frames
This option corrects all corruption. However, your export times will be nearly doubled with this option set. If you are using multitasking a LOT during the export, it might even take a lot longer than that.
So my advice would be to only switch Frame 1 to ON, let this option OFF and dont do anything but patiently wait for your export to finish.
The Hash to Flash Workflow
Build your Model
Building a Model to be outputted with am2swf can be different to normal modeling. Some points you should take care of:
Resolution
The resolution of Models you want to get into Flash should generally be low.
Using the Flat Render option you can create efficient output also from complex Models, but you will have to reder quite long.
One consideration around resolution is also about if you want to do animation and how many frames you want to do.
Nomal direction
You should ALWAYS look to have your normals facing right ([Shift]-[1] shows normals in the modeling window, [F] flips the normals of the selected patches), but especially with am2swf, because the backface - culling option (is selected) will take out your wrong facing patches and you will have holes in your output.
Hooks and 5 Pointers
If you have exported from A:M before, you might know that Hooks and 5-Point-Patches can be problematic, because they produce different mesh resolution at neighbouring surfaces. This will result in small cracks in the exported model. So try to use as few Hooks and 5Pointers as possible.
Build your Action/Choreography
Use anything you usually use to create your Actions, like Poses etc.
Additionally use a Camera and Lights in your Action if you want to use these am2swf features (use Right-Click > New > Camera / Light in your action window).
Aimate your Model, your Lgths and your Camera.
Alternatively you can also create a Choreography.
Export with am2swf
Right-Click > Plugins > Export > SWF. Make your settings, consult the manual above if you have questions.
Integrate in Flash
In Flash make a new file (or open the file you want your animation in).
Create a new Object ([Ctrl]-[F8]). I normally use Movie Clip objects because of their flexibility.
While in the editing window for this new object import the animation ([Ctrl]-[R]).
The animation will have the camera center at the center of your Movie Clip object. This makes scaling and moving the object easy in your Flash animation.
Tips and Caveats
3 MB Flash file size limit
Macromedia Flash has problems opening .swf files that are larger than 3 MB. For some long animations on complex models you might hit this limit. As a workaround use the range to export your animation in parts.
Surfaces with gradient dont show up on first frame in Flash
Macromedia Flash seems to have a bug here. Sometimes Gradient surfaces do not show up on the first frame when the movie is imported. To fix this, just import again.
Occlusion Culling: occluded Faces show up
This is also visible in the demo above (setting ON OFF OFF. Some Faces that should actually be culled still show up. This is due to the rendering algorithm for the Occlusion Map. Use higher values for the Minimum Area parameter to fix such anomalies. A good quick test in Flash is: make a Movie clip as described above, make an instance of it in the main movie, then set the transparency of this instance to e.g. 20%. you will quickly see any faces that should not be there.
FAQ
The resulting Movie is shifted to the uppert left corner
Turn off the "Move Camera center to 0|0 in movie" toggle in the Camera section of the interface.
Is the output of a:m2swf compatible with Swish ?
No. I'm working on this, but it does not work yet.
My Lights are not exporting correctly
A:M 9.5 has a bug until verison 9.51 that prevents lights from being exported correctly.
Please install the latest version of A:M.
Copyright
All material on these pages is protected by copyright law. Reproduction in part or as whole without the authors permission is prohibited (mbricman@kci-group.com).
a:m2swf is a trademark of kci:dnd.
Animation:Master is a trademark of Hash Inc.
Flash and Shockwave are trademarks of Macromedia.