Merge branch master into devel
Conflicts: docs/config.rst overviewer.py overviewer_core/settingsDefinition.py overviewer_core/tileset.py
This commit is contained in:
@@ -115,6 +115,57 @@ individual renders to apply to just those renders.
|
||||
See the ``sample_config.py`` file included in the repository for another
|
||||
example.
|
||||
|
||||
A dynamic config file
|
||||
=====================
|
||||
|
||||
It might be handy to dynamically retrieve parameters. For instance, if you
|
||||
periodically render your last map backup which is located in a timestamped
|
||||
directory, it is not convenient to edit the config file each time to fit the
|
||||
new directory name.
|
||||
|
||||
Using environment variables, you can easily retrieve a parameter which has
|
||||
been set by, for instance, your map backup script. In this example, Overviewer
|
||||
is called from a *bash* script, but it can be done from other shell scripts
|
||||
and languages.
|
||||
|
||||
::
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
## Add these lines to your bash script
|
||||
|
||||
# Setting up an environment variable that child processes will inherit.
|
||||
# In this example, the map's path is not static and depends on the
|
||||
# previously set $timestamp var.
|
||||
MYWORLD_DIR=/path/to/map/backup/$timestamp/YourWorld
|
||||
export MYWORLD_DIR
|
||||
|
||||
# Running the Overviewer
|
||||
overviewer.py --config=/path/to/yourConfig.py
|
||||
|
||||
.. note::
|
||||
|
||||
The environment variable will only be local to the process and its child
|
||||
processes. The Overviewer, when run by the script, will be able to access
|
||||
the variable since it becomes a child process.
|
||||
|
||||
::
|
||||
|
||||
## A config file example
|
||||
|
||||
# Importing the os python module
|
||||
import os
|
||||
|
||||
# Retrieving the environment variable set up by the bash script
|
||||
worlds["My world"] = os.environ['MYWORLD_DIR']
|
||||
|
||||
renders["normalrender"] = {
|
||||
"world": "My world",
|
||||
"title": "Normal Render of My World",
|
||||
}
|
||||
|
||||
outputdir = "/home/username/mcmap"
|
||||
|
||||
Config File Specifications
|
||||
==========================
|
||||
|
||||
@@ -360,6 +411,20 @@ values. The valid configuration keys are listed below.
|
||||
|
||||
**Default:** ``95``
|
||||
|
||||
``optimizeimg``
|
||||
This option specifies which additional tools overviewer should use to
|
||||
optimize the filesize of png tiles.
|
||||
The tools used must be placed somewhere, where overviewer can find them, for
|
||||
example the "PATH" environment variable or a directory like /usr/bin.
|
||||
This should be an integer between 0 and 3.
|
||||
* ``1 - Use pngcrush``
|
||||
* ``2 - Use advdef``
|
||||
* ``3 - Use pngcrush and advdef (Not recommended)``
|
||||
Using this option may significantly increase render time, but will make
|
||||
the resulting tiles smaller, with lossless image quality.
|
||||
|
||||
**Default:** ``0``
|
||||
|
||||
``bgcolor``
|
||||
This is the background color to be displayed behind the map. Its value
|
||||
should be either a string in the standard HTML color syntax or a 4-tuple in
|
||||
@@ -492,6 +557,10 @@ values. The valid configuration keys are listed below.
|
||||
|
||||
**Default:** ``[]`` (an empty list)
|
||||
|
||||
``showspawn``
|
||||
This is a boolean, and defaults to ``True``. If set to ``False``, then the spawn
|
||||
icon will not be displayed on the rendered map.
|
||||
|
||||
.. _customrendermodes:
|
||||
|
||||
Custom Rendermodes and Rendermode Primitives
|
||||
@@ -660,7 +729,7 @@ are referencing the previously defined list, not one of the built-in
|
||||
rendermodes.
|
||||
|
||||
Built-in Rendermodes
|
||||
--------------------
|
||||
====================
|
||||
The built-in rendermodes are nothing but pre-defined lists of rendermode
|
||||
primitives for your convenience. Here are their definitions::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user