Documentation

  Standalone GAF Converter CLI (Command Line Interface)

GAF Converter CLI is a command-line tool for working with GAF Converter through the command-line. GAF-Converter-CLI is a program included in the GAF Converter application package content.

You can find it under the application installation directory:
Windows: /GAF-Converter-CLI.exe
Mac: /Contents/Resources/GAF-Converter-CLI

If the GAF-Converter directory on Windows (or GAF-Converter.app/Contents/Resources/ directory on Mac) is listed in your path environment variable, you can type GAF-Converter-CLI on the command line, with the appropriate arguments, to invoke GAF-Converter-CLI. If you do not know how to set your path environment variable, please refer to your operating system documentation.

Assuming that GAF-Converter-CLI directory is included in the path variable, you can run GAF-Converter-CLI using the following basic syntax

GAF-Converter-CLI -argument values


Note: GAF Converter CLI works only with "Studio" or "Enterprise" licenses. For the “Free” license CLI is not available.

 

CLI arguments

Argument name

Default
value

Possible
values

Number
of values

Description

Since version

-swf-file

Required argument, has no default value

String that represents full path to file

1 - 200

Path to an SWF file or files, at least one SWF file should be specified

3.15

-output-dir

Required argument, has no default value

String that represents full path to directory

1

Path to the directory where the conversion output will be saved

3.15

-pot-atlas

false

true | false

1

Save texture atlases with “power of two” dimensions (true) or with a minimum possible size (false)

3.15

-compress-gaf

false

true | false

1

Compress *.gaf files (true) or leave them uncompressed (false)

3.15

-atlas-max-width

2048

32 | 64 | 128 | 256 | 1024 | 2048 | 4096

1

Texture atlas’ max width generated by GAF Converter

3.15

-atlas-max-height

2048

32 | 64 | 128 | 256 | 1024 | 2048 | 4096

1

Texture atlas’ max height generated by GAF Converter

3.15

-scale

1

Floating-point number greater than zero (max 3 decimal places)

1 - 4

Scale factor that will be applied to regions baked into a texture atlas. Used for: increase/decrease size of the converted GAF animation relative to the original SWF animation, or to produce GAF animation in several sizes. Different values produce visually different sizes. Used together with -csf argument to manage texture atlas size

3.15

-csf

1

1 | 2

1 - 2

CSF - the ratio between screen size in pixels and screen size in points used by framework. Using this argument you can generate texture atlases for screens with different sizes in pixels but same sizes in points used by framework (for example non-Retina and Retina iPads). Different values produce visually the same sizes (the difference is only in the pixel/point density. Retina - 4 pixel/point, non-Retina - 1 pixel/point). Used together with the -scale argument to manage the texture atlas size

3.15

-scale-name

empty

String that can be used for file naming on your OS

1 - 4

The suffix that will be used for naming the texture atlas file for the specified scale value. Used in conjunction with the -scale argument. Formula: swfFileName_scaleName_csfName.png

3.15

-csf-name

empty

String that can be used for file naming on your OS

1 - 2

The suffix that will be used for naming a texture atlas file for the a specified csf value. Used in conjunction with the -csf argument. Formula: swfFileName_scaleName_csfName.png

3.15

-bundle-name

auto-generated

String that can be used for file naming on your OS

1

The name that will be used for a bundle when the argument -conversion-output set to the value bundle Auto-generated name will be used by default

3.15

-limit-max-bake-scale

0

Floating-point number greater or equal to zero

1

Prevents baking MovieClip graphics into a texture atlas in a scale greater than  -limit-max-bake-scale value relative to the  original size in the Library. Value 0 turns off this feature.

3.15

-conversion-source

root

root | library

1 - 2

The place to search for the animation content. This can be Main Timeline (root) or MovieClips exported for ActionScript (library). Also it is possible to set both values at the same time.

3.15

-conversion-output

separately

separately | bundle

1

In case you pass more than one value for the argument -swf-file you can choose the conversion output type. This can be bundle (several animations with one shared texture atlas) or separately (several animations with a separate texture atlas for each animation)

3.15

-save-as-zip

true

true | false

1

Save the conversion result as a *.zip archive (true) or in a folder (false)

3.15

-original-scale

1

Floating-point number greater than zero (max 3 decimal places)

1

The original scale for which the converted SWF animation was designed. This argument value affects scale calculation in the process of a texture atlas creation. Used together with the -original-csf argument to manage texture atlas size.

3.15

-original-csf

1

1 | 2

1

The original CSF for which the converted SWF animation was designed. This argument value affects CSF calculation in the process of a texture atlas creation. Used together with thу -original-scale argument to manage texture atlas size.

3.15
-conversion-mode plain plain | nesting 1 The type of the conversion mode that will be used to convert the animation 4.0
-atlas-compression

1

0 | 1 | 2 | 3 1

The compression algorithm that will be used for texture atlas encoding. Four algorithms are available:

0 - fast PNG lossless compression algorithm (algorithm is faster but the size in MB is bigger)

1 - slow PNG lossless compression algorithm (algorithm is slow but the size in MB is smaller)

2 - PNG lossy compression algorithm (intelligently reduces the number of distinct color/alpha intensities)

3 - PNG lossy compression algorithm (reduces the number of distinct colors in the image to 256 colors)

4.1
-skip-dynamic-filters false

true | false

1 Forces the GAF Converter to skip all filters/effects that are not baked into texture atlas. With this option turned on, you can be sure that converted animation has no dynamic filters. 4.1
-skip-dynamic-masks false true | false 1 Forces the GAF Converter to skip all masks that are not baked into texture atlas. With this option turned on, you can be sure that converted animation has no dynamic masks. 4.1
-force-squared false true | false 1 Forces the texture atlas to have a squared size. 4.4
-extract-sounds false true | false 1

Forces the GAF Converter to extract sounds from SWF file. Each sound is saved as a separate *.mp3 file together with all GAF files. Playback information is saved inside *.gaf config file. More info...

5.0
-atlas-region-rotation false true | false 1

Allows the rotating of regions clockwise by 90 degrees if they have a better fit in the texture atlas.

5.0
-custom-images-sprite false true | false 1

When this option is enabled GAF Converter takes all Sprites exported for Action Script and bakes them into a texture atlas as separate regions. More info...

5.0
-custom-images-bitmap false true | false 1

When this option is enabled GAF Converter takes all Bitmaps exported for Action Script and bakes them into a texture atlas as separate regions. More info...

5.0
-border-padding 2 0 - 512 1 Border padding is used to set the space between the regions and the border of the texture atlas. 5.2
-region-padding 2 0 - 512 1

Region padding is used to set the space between regions. It is used to avoid artifacts from neighbor regions. The transparent pixels are not added to the regions. We recommend setting the value at 2 or more to avoid dragging in pixels from neighbor regions during rendering in runtime.

5.2


 

 

 

 

Examples

Single animation with default conversion settings:

GAF-Converter-CLI -swf-file "D:GAFexampleanimation.swf" -output-dir "D:GAFexample"    

  

Two animations in a bundle with two CSFs for Retina (2) and non-Retina (1) displays:
 

GAF-Converter-CLI -swf-file "D:GAFexampleanimation1.swf" "D:GAFexampleanimation2.swf" -output-dir "D:GAFexample" -csf 1 2 -conversion-output "bundle" -bundle-name "test-bundle"

  

Single animation with two scales (1 - normal and 1.5 - big) for Retina and non-Retina displays (1 - sd and 2 - hd), compressed *.gaf file, animations on both Main Timeline and Library (MovieClips exported for ActionScript):
 

GAF-Converter-CLI -swf-file "D:GAFexampleanimation.swf" -output-dir "D:GAFexample" -csf 1 2 -scale 1 1.5 -scale-name "norm" "big" -csf-name "sd" "hd" -conversion-source "root" "library" -compress-gaf true