-
Notifications
You must be signed in to change notification settings - Fork 454
Model Definition Files
The way models are currently provided for the HD perspective module is via the internal resource file, models.txt (which can be found in the source code at https://github.com/webbukkit/DynmapCore/blob/master/src/main/resources/models.txt). Additional models, or replacements for existing models, can be provided by the custom-models.txt file, which is found in the renderdata directory. By default the renderdata directory does not exist, and must be created under the plugins/dynmap directory. Both of these files have the same format.
The files are line oriented, and can include comment lines (that start with '#'). Each block definition starts with line formatted as follows:
block:id=N,data=D,scale=X
Where:
-
id defines the block ID of the block being modeled. There must be at least one id=N attribute, but there may be as many as are needed (different block often share the same shaped model).
-
data defines the value of the block data for the block being modeled. There must be at least one data=D attribute, where D can be '*' (meaning all data values - 0-15) or any value from 0 to 15. There can be as many as are needed. Note: for certain, special case block types, an additional data value (called the render data) is generated and used in preference to the normal data value. Currently, the special case blocks are those where the block ID and data are insufficient to select the model - chests, redstone wire, and fences.
-
scale defines the scale of the grid of 'sub-blocks' composing the volume of the block. A scale of X implies that the model for the block is being described relative to an X by X by X grid of cells. X must be at least 2.
After the block line, the model can be described in one of two ways: either by describing the layers of cells that compose the block, or by referring to another model and describing a transformation to be applied to that model.
To describe the model directly, the block line is followed by one or more sets of layers. These layers describe the cross-sections of the block, starting from the bottom (layer 0) to the top (layer X-1). Each layer is described by X lines, each containing X characters. The first line of a given layer is the northern edge of the block, while the last line is the southern edge. The first character of each line corresponds to the western edge of the block, and the last represents the eastern edge. Each layer definition is formatted as follows:
layer:A,B,C,D,...
----
-**-
-**-
----
Where:
-
A,B,C,D,... represents the one or more layer numbers described by the definition (this allows a given cross-section to be used more than once in the same model). There must always be at least one layer number, with 0 representing the bottom layer of the model, and (X-1) (for a scale: X model) representing the top.
-
Exactly X lines follow the layer tag, with exactly X characters for each line. These define a grid representing the cells of the layer of the model (X by X), with the first line representing the north edge, the last representing the south edge, the first column representing the west edge, and the last column representing the east edge. If a given character is '*', the cell is considered 'full'. Otherwise, the cell is considered 'empty' (a '-' is used for these characters, by default). The example shown above is representative of a scale: 4 model.
Any layers that are not defined are assumed to be all empty.
Alternately, the model can be defined by referring to another model, and describing a transform (specifically, a rotation about the vertical axis). This is done with the rotate tag, as shown below:
rotate:id=B,data=D,rot=R
Where:
-
id is the ID of the block definition being replicated. This is required, and there can only be one value.
-
data is the block data value of the block definition being replicated. This is required and must be one value.
-
rot defines the degrees of rotation around the vertical axis of the model. 90 causes the new model to be the same as the replicated model after rotating 90 degrees clockwise. 180 represents a 180 degree clockwise rotation. 270 represents a 270 degree clockwise (or 90 degree counter-clockwise) rotation.
Note: the scale of a block defined using the rotate tag MUST match the scale of the block model that is being copied and transformed.
- Base Plugin Settings
- Web Setup
- Storage Setup
- HD Map Configuration
- World and template settings
- Guides
- Advanced Map Configuration
- Component Configuration
- Configuration of worlds
- Exporting World Data in Wavefront OBJ Format
- External Webserver Advanced
- Support for Minecraft Servers other than CraftBukkit
- Support for MinecraftForge based mods
- Support for Tekkit
- Custom Block Definitions
- Model Definition Files
- Texture Definition Files
- Defining a Block using a Custom Block Renderer
- Defining a Block using a Volumetric Model
- Defining a Cuboid Block
- Defining a Simple Block
- Defining Cuboid Models
- Defining Volumetric Models
- Special texture file types
- Using custom block renderers
- Incompatible mods