Model based Rendering - babybluetit/Xaeros-Minimap-Modded-Support GitHub Wiki

This page will guide you through configuring the model-based renderer for an icon.

Configuration

Your config file can contain the following properties:

{
  "variantIdBuilderMethod": "xaero.common.minimap.render.radar.EntityIconDefinitions.buildVariantIdString",

  "variants": {
    "default": "model:0"
  },

  "modelConfigs": [
    {
      "baseScale": 1.0,
      "rotationY": 0,
      "rotationX": 0,
      "rotationZ": 0,
      "offsetX": 0,
      "offsetY": 0,
      "modelPartsFields": [],
      "modelMainPartFieldAliases": [],
      "modelRootPath": [[]],
      "renderingFullModel": false,
      "modelPartsRotationReset": true,
      "layersAllowed": true
    }
  ]
}

A breakdown of each property and their usage is as follows:

variantIdBuilderMethod [optional]

  • Default: xaero.common.minimap.render.radar.EntityIconDefinitions.buildVariantIdString
  • Specifies a method for generating a variant id for an entity. In most cases the default method provided by the Minimap mod is sufficient, but you may write your own if you wish. Using variant ids is covered in more detail on the Sprites page.

variants

  • Contains a set of variant ids and the corresponding source to use for its minimap icon.
  • In this case default will match any variant that is not explicitly defined in this list (see the Sprites page for more on this).
  • model:0 refers to the first model in the array of models in modelConfigs.
  • See the page on Sprites for more on specifying multiple variants

modelConfigs [optional]

  • Optional, but if you want to render anything you will need to include this field!
  • This contains an array of model configurations. The first model in the array has index 0, the second has index 1, and so on...

Model Options

All fields in this section are optional. If omitted, their default value will be used.

baseScale
  • Default: 1.0
  • Adjusts the size of the icon.
rotationY
  • Default: 0
  • Adjusts the model's rotation about the Y-axis (yaw).
rotationX
  • Default: 0
  • Adjusts the model's rotation about the X-axis (pitch).
rotationZ
  • Default: 0
  • Adjusts the model's rotation about the Z-axis (roll).
offsetX
  • Default: 0
  • Sets the X-offset (horizontal) of the model. Positive values will shift the model to the right, negative values will shift it to the left.
offsetY
  • Default: 0
  • Sets the Y-offset (vertical) of the model. Positive values will shift the model downwards, negative values will shift it upwards.
modelPartsFields
  • Default: empty array
  • Specifies a list of model parts to be rendered. For usage see the examples section. For a complete list of accepted values, see the note at the end of this section.
modelMainPartFieldAliases
  • Default: the first model part resolved
  • Specifies the main model part. This will be rendered at the centre of the icon and all other parts will be rendered relative to this. Only one part is chosen from this list, so there is no need to specify multiple.
modelRootPath
  • See the note at the end of this section.
renderingFullModel
  • Default: false
  • Specifies whether to render all parts of the model. If set to true this has the same effect as listing every single model part in modelPartsFields.
modelPartsRotationReset
  • Default: true
  • Specifies whether the rotation of all model parts should be set to 0. Usually this is desirable, but in some cases we want parts of the model to stay rotated.
layersAllowed
  • Default: true
  • Specifies whether the minimap should render multiple layers of the model. Layers are typically used for clothing like hats or glow effects.

Note: For a more complete description of each field and its accepted values, please see the /assets/xaerominimap/entity/icon/definition/example_mod/example_entity.json file that comes packaged with the minimap mod.

Examples

⚠️ **GitHub.com Fallback** ⚠️