Compressing Model Files

The models and image files provided with 3D Network Visualizer are shipped in compressed formats (MÄK Encrypted Data Format (MEDF) and MÄK Encrypted Image Format (MEIF)). You may want to compress your models to save space or protect intellectual property. You can convert supported formats to MEDF and MEIF with ./bin/medfTool.exe. The compression tool supports the 3D modeling formats supported by 3D Network Visualizer, such as OpenFlight, 3DS, OBJ, and raster formats such as RGB and PNG. The syntax for medfTool is as follows:

medfTool [-q simple_filename ... -p <integer> -d -s directory ... -z optimization -i -o -m extensions ... -x extensions ... --norecurse --directory directory -f filename -- -v -h]

Table 6 describes the arguments.

Table 6: medfTool arguments

Argument Description
(-- | --ignore_rest) Ignore all arguments after this one.
-d Flip DDS textures.
--directory directory Specifies the directory to search for image and geometry files to convert into MEDF and MEIF. All subdirectories will be visited unless the --norecurse command line option is used.
(-f | --file) filename Convert just this file, the extension of the file must be specified using -x or -m to indicate it is an image or a geometry file.
(-h | --help) Displays usage information.
(-i | --ignore_errors) Ignore errors in the encryption process and continue without exiting.
(-m | --image_extensions) extension Specifies the extensions of image formats which will be converted into MEIF format. Use this argument to encrypt a directory. Can be used multiple times.
--norecurse Do not recurse through subdirectories. Default: recurse through subdirectories.
(-o | --onlyIfNew) Only generates an encrypted file if the expected output file does not exist.
(-p | --threads) threads Specifies the number of threads to run. Specifying zero results in the number of threads equaling the number of logical processors the host machine has.
(-q | --forceOpaque) simple_filename Specifies a filename and extension, but no path, to force polygons with these filenames to be opaque. Accepted multiple times.
(-s | --search) directory Adds a directory to the search path when resolving external references. During processing, any external references not found will be removed from the generated files. Files in the search path are not converted.
(-v | --version) Display version information and exit.
(-z | --optimize) optimization Specifies the optimization level. Maximum optimization may provide better optimization than the default setting, but it is significantly slower. Possible values are:
- 0 = None.
- 1 = Default.
- 2 = Maximum optimization.

The following example recursively compresses all FLT, RGB, RGBA, PNG, and DDS files in %MAK_DATADIR%/Terrain:

%MAK_IGDIR%/bin/medfTool.exe
   --directory %MAK_DATADIR%/Terrain --extensions flt
   --image_extensions rgb --image_extensions rgba
   --image_extensions png --image_extensions dds

The following example compresses all FLT, RGB, RGBA, PNG, and DDS files in %MAK_DATADIR%/Lifeforms. It does not compress files in subdirectories.

%MAK_IGDIR%/bin/medfTool.exe
   --directory %MAK_DATADIR%/Lifeforms --norecurse
   --extensions flt --image_extensions rgb --image_extensions rgba
   --image_extensions png --image_extensions dds