Jump to content

MapRenderer: Difference between revisions

From fCraft Wiki
Options: alphabetized
Line 32: Line 32:
===<code>-a, --angle=DEGREES</code>===
===<code>-a, --angle=DEGREES</code>===
:Angle (orientation) from which the map is drawn. May be -90, 0, 90, 180, or 270. Default is 0.
:Angle (orientation) from which the map is drawn. May be -90, 0, 90, 180, or 270. Default is 0.
===<code>-e, --export=FORMAT</code>===
:Image format to use for exporting. Supported formats: PNG (default), BMP, GIF, JPEG, TIFF.


===<code>-f, --filter=PATTERN</code>===
===<code>-f, --filter=PATTERN</code>===
:Optional: Pattern to filter input filenames, e.g. <code>*.dat</code> or <code>builder*</code>. Applicable only when a directory name is given as input.
:Optional: Pattern to filter input filenames, e.g. <code>*.dat</code> or <code>builder*</code>. Applicable only when a directory name is given as input.
===<code>-g, --nogradient</code>===
:Disables altitude-based gradient/shading on terrain.


===<code>-i, --importer=FORMAT</code>===
===<code>-i, --importer=FORMAT</code>===
Line 51: Line 57:
:*'''Opticraft''' (.save)
:*'''Opticraft''' (.save)


===<code>-e, --export=FORMAT</code>===
===<code>-l, --seethroughlava</code>===
:Image format to use for exporting. Supported formats: PNG (default), BMP, GIF, JPEG, TIFF.
:Makes all lava partially see-through, instead of opaque.


===<code>-m, --mode=MODE</code>===
===<code>-m, --mode=MODE</code>===
:Rendering mode. May be "normal" (default), "cut" (cuts out a quarter of the map, revealing inside), "peeled" (strips the outer-most layer of blocks), "chunk" (renders only a specified region of the map).
:Rendering mode. May be "normal" (default), "cut" (cuts out a quarter of the map, revealing inside), "peeled" (strips the outer-most layer of blocks), "chunk" (renders only a specified region of the map).
===<code>-g, --nogradient</code>===
:Disables altitude-based gradient/shading on terrain.
===<code>-s, --noshadows</code>===
:Disables rendering of shadows.


===<code>-o, --output=PATH</code>===
===<code>-o, --output=PATH</code>===
:Optional: Path to save images to. If not specified, images will be saved to the maps' directory.
:Optional: Path to save images to. If not specified, images will be saved to the maps' directory.
===<code>-y, --overwrite</code>===
:Disables asking for confirmation to overwrite existing files.


===<code>-q, --quality=PERCENTAGE</code>===
===<code>-q, --quality=PERCENTAGE</code>===
Line 77: Line 74:
===<code>--region=x1,y1,z1,x2,y2,z2</code>===
===<code>--region=x1,y1,z1,x2,y2,z2</code>===
:Region of the map to render. Should be given in following format: "region=x1,y1,z1,x2,y2,z2". By fCraft's conventions, x/y are horizontal coordinates (width/length), and z is the vertical coordinate (height). Applicable only when rendering mode is set to "chunk".
:Region of the map to render. Should be given in following format: "region=x1,y1,z1,x2,y2,z2". By fCraft's conventions, x/y are horizontal coordinates (width/length), and z is the vertical coordinate (height). Applicable only when rendering mode is set to "chunk".
===<code>-s, --noshadows</code>===
:Disables rendering of shadows.
===<code>-u, --uncropped</code>===
:Does not crop the finished map image, leaving some empty space around the edges.


===<code>-w, --seethroughwater</code>===
===<code>-w, --seethroughwater</code>===
:Makes all water see-through, instead of mostly opaque.
:Makes all water see-through, instead of mostly opaque.


===<code>-l, --seethroughlava</code>===
===<code>-y, --overwrite</code>===
:Makes all lava partially see-through, instead of opaque.
:Disables asking for confirmation to overwrite existing files.
 
===<code>-u, --uncropped</code>===
:Does not crop the finished map image, leaving some empty space around the edges.


===<code>-?, -h, --help</code>===
===<code>-?, -h, --help</code>===

Revision as of 22:40, 29 October 2012

MapRender usage

MapRenderer is a utility, bundled with fCraft 0.630+, that can render images from map files. MapRenderer.exe requires fCraft.dll and fCraftGUI.dll to function.

Usage

MapRenderer [options] "MapFileOrDirectory"

Examples

Rendering a single map

MapRenderer "SomeMap.fcm"
Draws contents of SomeMap.fcm with all default parameters, saves it to SomeMap.png.

Batch rendering

MapRenderer -r "maps/"
Finds all map files in "C:/maps", including files in subdirectories, and renders them with default settings. Images are saved into each map's respective directory. Image filenames are based on mapfile names, with file extension change to ".png"

Moving out rendered images

MapRenderer -r -o "images/" "maps/"
Same as above, but all images are placed into "images/" directory.

Filtering

MapRenderer -f=builder* "maps/"
Looks for mapfile names that start with "builder", draws them with default settings.

Rendering options

MapRenderer --noshadows -q=90 e=JPEG "SomeMap.fcm"
Draws contents of SomeMap.fcm, without shadows, and saves results to SomeMap.jpg at 90% quality.

Options

Options have alternative short (one-letter) and a long (whole word) forms. You can use either form: -a=90 is same as --angle=90

One-letter flags can be combined: -gswl is same as -g -s -w -l

-a, --angle=DEGREES

Angle (orientation) from which the map is drawn. May be -90, 0, 90, 180, or 270. Default is 0.

-e, --export=FORMAT

Image format to use for exporting. Supported formats: PNG (default), BMP, GIF, JPEG, TIFF.

-f, --filter=PATTERN

Optional: Pattern to filter input filenames, e.g. *.dat or builder*. Applicable only when a directory name is given as input.

-g, --nogradient

Disables altitude-based gradient/shading on terrain.

-i, --importer=FORMAT

Optional: Converter used for importing/loading maps. Available formats:
  • Auto - default; tries to determine file type automatically
  • Classic (.dat or .mine) - Minecraft Classic and SurvivalTest maps
  • D3 (.map)
  • FCMv2 (.fcm) - used by fCraft prior to version 0.500
  • FCMv3 (.fcm) - used in fCraft 0.500-0.630
  • FCMv4 (.fcm) - planned format for future versions of fCraft
  • Indev (.mclevel) - from Minecraft Indev maps
  • JTE (.gz)
  • MCSharp (.lvl) - MCSharp, FemtoCraft, MCZall, MCLawl, MCForge, etc
  • MinerCPP (.dat) - MinerCPP and LuaCraft
  • Myne (directory-based) - Myne, MyneCraft, Hyvebuild, and iCraft
  • Opticraft (.save)

-l, --seethroughlava

Makes all lava partially see-through, instead of opaque.

-m, --mode=MODE

Rendering mode. May be "normal" (default), "cut" (cuts out a quarter of the map, revealing inside), "peeled" (strips the outer-most layer of blocks), "chunk" (renders only a specified region of the map).

-o, --output=PATH

Optional: Path to save images to. If not specified, images will be saved to the maps' directory.

-q, --quality=PERCENTAGE

Sets JPEG compression quality. Between 0 and 100. Default is 80. Applicable only when exporting images to .jpg or .jpeg.

-r, --recursive

Optional: Look through all subdirectories for map files. Applicable only when a directory name is given as input.

--region=x1,y1,z1,x2,y2,z2

Region of the map to render. Should be given in following format: "region=x1,y1,z1,x2,y2,z2". By fCraft's conventions, x/y are horizontal coordinates (width/length), and z is the vertical coordinate (height). Applicable only when rendering mode is set to "chunk".

-s, --noshadows

Disables rendering of shadows.

-u, --uncropped

Does not crop the finished map image, leaving some empty space around the edges.

-w, --seethroughwater

Makes all water see-through, instead of mostly opaque.

-y, --overwrite

Disables asking for confirmation to overwrite existing files.

-?, -h, --help

Prints usage information and a list of options.

MapRenderer.exe exit codes

MapRenderer uses a subset of MapConverter's exit codes:
Code Meaning Notes
0 Success
1 ArgumentError Required command-line arguments were missing, or an error occurred while trying to parse options.
2 UnrecognizedImporter Given importer name was not recognized.
4 InputPathNotFound Given file/directory name does not exist.
5 PathError Error occurred while trying to check input directory, or error occurred while trying to check/create output directory.
6 UnsupportedLoadFormat Given map format name ("importer") was recognized, but loading from it is not supported.
7 UnsupportedSaveFormat Given image format name ("export") was recognized, but saving to it is not supported.