Skip to content

04. Customising MiEx and Pipeline Integration

Bram Stout edited this page Mar 25, 2026 · 7 revisions

Most settings on how MiEx works is specified via resource packs, but there are a couple of settings that are global in MiEx and not specified in resource packs. These settings are instead specified via environment variables or command-line arguments.

MiEx was written from the start for use in animations, and so these environment variables and command-line arguments can be used to help integrate MiEx into your CG pipeline.

Environment variables

These environment variables can be specified directly in your computer's settings, but you can also specify them in a miex.env file next to the MiEx.jar file. The "Edit Environment Settings" tool in MiEx lets you easily create and edit this miex.env file and is the recommended way to edit these environment variables.

Name Default Value Description
MIEX_HOME_DIR ./ The folder in which to start the export file dialog.
MIEX_RESOURCEPACK_DIR ./resources The folder in which all of the resource packs that MiEx can use are located.
MIEX_RESOURCEPACK_USD_PREFIX Absolute path of ./resources/ The prefix given to the texture paths specified in USD. It's meant to be the USD equivalent of MIEX_RESOURCEPACK_DIR. If it doesn't end with a forward slash, then MiEx will add one.
MIEX_RESOURCEPACK_JSON_PREFIX Absolute path of ./resources/ The prefix given to the texture paths specified in JSON files. If it doesn't end with a forward slash, then MiEx will add one.
MIEX_USDCAT_EXE ./usdcat/usdcat.exe The path of the usdcat command-line tool, used by MiEx to be able to export out into USD Crate files rather than USD ASCII files.
MIEX_LOG_FILE ./log.txt The path to where it should write out all console outputs and errors.
MIEX_LOG_FILE_ADD_DATETIME 0 Whether to add a timestamp at the end of the log file's name so that it keeps previous logs rather than overriding the same one.
MIEX_MINECRAFT_ROOT_DIR Default Minecraft install directory The path to the Minecraft launcher root directory. This allows MiEx to find Minecraft versions and saves from the Minecraft launcher if it is installed somewhere other than the default location.
MIEX_MULTIMC_ROOT_DIR null The root directory of a MultiMC (or fork of MultiMC like Prism) install.
MIEX_TECHNIC_ROOT_DIR %APPDATA%/.technic/ The root directory of a Technic install.
MIEX_MODRINTH_ROOT_DIR %APPDATA%/ModrinthApp/ The root directory of a Modrinth install.
MIEX_HYTALE_ROOT_DIR %APPDATA%/Hytale/ The path to the Hytale launcher root directory. This allows MiEx to find versions and saves from the Hytale launcher.
MIEX_ADDITIONAL_SAVE_DIRS null A list of save folders to show in the world browser. Each save folder is the path to it and the list is separated with a semicolon ;.
MIEX_NUM_UI_THREADS 4 The number of threads that MiEx should leave alone, so that it won't stall your entire computer.
MIEX_PORTABLE_EXPORTS 0 Whether MiEx should make exports with all files used inside of the export's chunks folder, making the export fully portable. By default MiEx puts in the paths to the files directly in the resource pack folders, which prevents lots of unnecessary duplicate files, but makes it difficult to share exports.
MIEX_GITHUB_REPO BramStoutProductions/MiEx The GitHub repository that MiEx should check for the latest versions of the built-in files. You can change this if, for example, you're working in a team and want to have your own set of built-in files.
MIEX_OFFLINE_MODE 0 Puts MiEx into offline mode where it won't check GitHub for new versions of MiEx or new built-in files.
MIEX_STORE_GEN_TEX_IN_EXPORT 0 If true, textures generated by MiEx (banners, player skins) are stored in the chunks folder of the export. If false, they are stored in a resource pack.
MIEX_GEN_TEX_RP_NAME base_resource_pack The resource pack name to put textures generated by MiEx into. By default they are put into the base_resource_pack.
MIEX_BUILT_IN_FILES_SHOW_PROMPT 0 When built-in files are updated, show a prompt with which files were updated.
MIEX_SKIP_WORLD_RESOURCEPACK_CHECK 0 When a world is opened up, skip checking for any resource packs that the world might need.

Command-line arguments

Name Default Value Description
-homeDir <path> %MIEX_HOME_DIR% The folder in which to start the export file dialog.
-rpDir <path> %MIEX_RESOURCEPACK_DIR% The folder in which all of the resource packs that MiEx can use are located.
-rpUSDPrefix <string> %MIEX_RESOURCEPACK_USD_PREFIX% The prefix given to the texture paths specified in USD. It's meant to be the USD equivalent of MIEX_RESOURCEPACK_DIR
-rpJSONPrefix <string> %MIEX_RESOURCEPACK_JSON_PREFIX% The prefix given to the texture paths specified in JSON files. It's meant to be the JSON equivalent of MIEX_RESOURCEPACK_DIR
-usdcatExe <path> %MIEX_USDCAT_EXE% The path of the usdcat command-line tool, used by MiEx to be able to export out into USD Crate files rather than USD ASCII files.
-multimcRootDir <path> %MIEX_MINECRAFT_ROOT_DIR% The path to the Minecraft launcher root directory. This allows MiEx to find Minecraft versions and saves from the Minecraft launcher if it is installed somewhere other than the default location.
-multimcRootDir <path> %MIEX_MULTIMC_ROOT_DIR% The root directory of a MultiMC (or fork of MultiMC like Prism) install.
-technicRootDir <path> %MIEX_TECHNIC_ROOT_DIR% The root directory of a Technic install.
-modrinthRootDir <path> %MIEX_MODRINTH_ROOT_DIR% The root directory of a Modrinth
-hytaleRootDir <path> %MIEX_HYTALE_ROOT_DIR% The root directory of a Hytale install.
-additionalSaveDirs <paths> %MIEX_ADDITIONAL_SAVE_DIRS% A list of save folders to show in the world browser. Each save folder is the path to it and the list is separated with a semicolon ;. This is an alternative to %MIEX_ADDITIONAL_SAVE_DIRS%.
-numUIThreads <number> %MIEX_NUM_UI_THREADS% The number of threads that MiEx should leave alone, so that it won't stall your entire computer.
-usdcatExe <path> %MIEX_USDCAT_EXE% The path to the usdcat executable. If it exists, it will use this to convert the USD files to USDC (binary) files. USDC files are more efficient.
-log <path> %MIEX_LOG_FILE% The path to where it should write out all console outputs and errors.
-resourcePack <string> The name of a resource pack in %MIEX_RESOURCEPACK_DIR% that should be loaded by default. This argument can be specified multiple times to have multiple resource packs loaded by default. The first resource pack specified will then be the highest priority.
-portableExports Whether MiEx should make exports with all files used inside of the export's chunks folder, making the export fully portable. By default MiEx puts in the paths to the files directly in the resource pack folders, which prevents lots of unnecessary duplicate files, but makes it difficult to share exports.
-offlineMode Puts MiEx into offline mode where it won't check GitHub for new versions of MiEx or new built-in files.
-githubRepo <string> BramStoutProductions/MiEx The GitHub repository that MiEx should check for the latest versions of the built-in files. You can change this if, for example, you're working in a team and want to have your own set of built-in files.
-skipWorldResourcePackCheck If specified, skips the check when opening a world for which resource packs, data packs, addons, and mods that world depends on.
-storeGenTexInExport If specified, textures generated by MiEx (banners, player skins) are stored in the chunks folder of the export. If false, they are stored in a resource pack.
-genTexRpName <string> base_resource_pack The resource pack name to put textures generated by MiEx into. By default they are put into the base_resource_pack.
-skipWorldResourcePackCheck When a world is opened up, skip checking for any resource packs that the world might need.
-world <string> The name of the world to automatically load. It should either be an absolute or relative path to the world folder or the name of the world folder in the user's Minecraft saves folder.
-output <path> The path of the USD file where MiEx should export the world to. If this argument is specified, MiEx will not show a file dialog on export, but rather immediately start exporting.
-cli Turns on command-line interface mode. MiEx will run in headless mode without a UI. Instead it will wait for commands to be provided. If this flag is used, either -command, -commandFile, or -commandStdIn must be provided. All of them could also be provided, in which case, it runs the command in order of -command, -commandFile, and lastly -commandStdIn.
-command <command> A command to execute. Commands are JSON objects. JSON arrays are seen as multiple commands to execute. A more standard command syntax of <command> [-<arg name> <arg value>]... is also allowed.
-commandFile <path> Read in the file, parse it as a JSON object or array and run it.
-commandStdIn If enabled, it reads stdin (input pipe) for commands. Each line is parsed as a command. It first tries to parse it as a JSON object or JSON array and if that doesn't work, it tries to parse it as the more standard command syntax.

Commands

MiEx supports a command-line interface, where it will run in headless mode (without a UI). This is useful for automation or to incorporate MiEx into another tool.

MiEx has three methods to provide it with commands. You can provide a command using the -command <command> command-line argument. You can point it to a file using -commandFile <path> which contains a command JSON object or JSON list of commands. You can also enable -commandStdIn, in which case it reads stdin (input pipe) for commands. Each line is parsed as a command. It first tries to parse it as a JSON object or JSON array and if that doesn't work, it tries to parse it as a more standard command syntax.

Command Syntax

Commands are specified as JSON objects, with at least a property command whose value is a string that specifies which command to run. The JSON object may have additional properties which are then the arguments for the command. JSON arrays of JSON objects may also be specified for multiple commands to be run in order.

There is also an alternate command syntax that is more standard, for use with -command <command> and -commandStdIn. This syntax is <command> [-<arg name> <arg value>]..., where the argument value is either a regular string or is parsed as a JSON value.

List of commands

applyExportSettings

Argument Description
settings A JSON Object of export settings to apply. It is the same format as from getExportSettings

Applies the provided settings. Not all settings must be provided, as it only applies the specific settings specified. To remove export regions, set the value for it to null.

createAtlases

Argument Description
resourcePacks A JSON array of resource pack UUIDs to create atlases for.
saveToResourcePack A string of the folder name to which to save the atlases.
repeats The number of times a texture is repeated in the atlas.
padding The number of times a texture is additionally repeated to provide padding to prevent neighbouring textures from blending into each other.
excludeTextures A JSON array of texture resource identifiers to not include in the atlas.
utilityTextures A JSON array of suffixes that indicate whether a texture is a utility texture.

Runs the atlas creator tool.

downloadExampleResourcePacks

Argument Description
resourcePacks A JSON array of example resource pack names.

Downloads the example resource packs specified.

executeFile

Argument Description
path A file path pointing to a text file containing JSON data of the commands to execute.

Executes commands stored in a file.

export

Argument Description
path A file path of where to export to.

Exports the world with the current export settings to the path specified.

extractModResourcePack

Argument Description
modpack A file path to the mods folder of a mod pack.
resourcePack A string specifying the name of the resource pack to which the mod pack should be extracted to.

Extracts the resource pack files from a mod pack.

getActiveResourcePacks

Return Description
resourcePacks A JSON array of resource pack UUIDs that are currently active.

Returns the list of active resource packs.

getBakedBlockState

Argument Description
blockIds A JSON array of block ids. Each block id may be an integer providing the runtime id of a block in MiEx's block registry, or a JSON object.
blockIds[...].id If a block id is a JSON object, this provides the integer runtime id of a block in MiEx's block registry.
blockIds[...].x If a block id is a JSON object, this provides the X coordinate of that block.
blockIds[...].y If a block id is a JSON object, this provides the Y coordinate of that block.
blockIds[...].z If a block id is a JSON object, this provides the Z coordinate of that block.
blockIds[...].layer If a block id is a JSON object, this provides the layer of that block.
blockNames A JSON array of block names. Each block name may be a string providing the name of a block or a JSON object.
blockNames[...].name If a block name is a JSON object, this provides the name of the block.
blockNames[...].properties If a block name is a JSON object, this provides the properties of the block.
blockNames[...].x If a block name is a JSON object, this provides the X coordinate of that block.
blockNames[...].y If a block name is a JSON object, this provides the Y coordinate of that block.
blockNames[...].z If a block name is a JSON object, this provides the Z coordinate of that block.
blockNames[...].layer If a block name is a JSON object, this provides the layer of that block.
blockLocations A JSON array of JSON objects, each JSON object providing a block coordinate to look up the block for.
blockLocations[...].x The X coordinate of the block to look up.
blockLocations[...].y The Y coordinate of the block to look up.
blockLocations[...].z The Z coordinate of the block to look up.
blockLocations[...].layer The layer of the block to look up. If the layer is not provided or is set to null, then a JSON array of JSON objects will be returned for this block, one JSON object for each layer.

Returns a list of baked blockstates. There are three methods to specify the blocks for which to return the baked blockstate. Either via a runtime block id, a block name, or a block location in the world.

getBiome

Argument Description
biomeIds A JSON array of biome ids. Each biome id is an integer providing the runtime id of a biome in MiEx's biome registry.
biomeNames A JSON array of biome names. Each biome name is a string providing the name of a biome.
blockLocations A JSON array of JSON objects, each JSON object providing a block coordinate to look up the biome for.
blockLocations[...].x The X coordinate of the biome to look up.
blockLocations[...].y The Y coordinate of the biome to look up.
blockLocations[...].z The Z coordinate of the biome to look up.

Returns a list of biome data. There are three methods to specify the biomes to return. Either via a runtime biome id, a biome name, or a biome location in the world.

getBlock

Argument Description
blockIds A JSON array of block ids. Each block id is an integer providing the runtime id of a block in MiEx's block registry.
blockLocations A JSON array of JSON objects, each JSON object providing a block coordinate to look up the block for.
blockLocations[...].x The X coordinate of the block to look up.
blockLocations[...].y The Y coordinate of the block to look up.
blockLocations[...].z The Z coordinate of the block to look up.
blockLocations[...].layer The layer of the block to look up. If the layer is not provided or is set to null, then a JSON array of JSON objects will be returned for this block, one JSON object for each layer.

Returns a list of block data. There are two methods to specify the blocks for which to return the block data. Either via a runtime block id or a block location in the world.

getChunks

Argument Description
chunks A JSON array of JSON objects, one object for each chunk queried.
chunks[...].chunkX The X chunk coordinate.
chunks[...].chunkZ The Z chunk coordinate.
heightmap If true, returns a heightmap for each chunk. The heightmap is returned as a flat array of big endian shorts encoded as a base64 string indexed as [z * 16 + x]
image If true, returns a top-down image for each chunk. The image is returned as a flat array of bytes encoded as a base64 string indexed as [z * 16 + x] and stored in BGRABGRABGRA... order.
blocks If true, returns the block data for each chunk. It adds a sections JSON array of JSON objects with for each section a blocks JSON array of strings. Each string is a layer and is a flat array of big endian integers encoded as a base64 string indexed as [y * 256 + z * 16 + x], where each integer is a runtime id in MiEx's block registry.
biomes If true, returns the biome data for each chunk. Similar to blocks, it adds a section JSON array of JSON objects with for each section a biomes string property. The string is a flat array of big endian integers encoded as a base64 string indexed as [y * 16 + z * 4 + x], where each integer is a runtime id in MiEx's biome registry. Biomes are stored a quarter resolution compared to blocks.
entities If true, returns the entities for each chunk. It adds an entities JSON array of JSON objects, one JSON object for each entity.

Returns chunk data.

getEntityModel

Argument Description
entities A JSON array of JSON objects, each specifying an entity for which to get the model.
entities[...].id The entity type id.
entities[...].data The entity NBT data.

Returns models for entities.

getEnvironmentSettings

Argument Description
onlySetInEnvFile If true, only returns the environment settings that were set in the env file.
includeDefaults If true, include environment settings that haven't been set to anything.

Returns a JSON object with key/value pairs for each environment setting of MiEx.

getExampleResourcePacks

Return Description
resourcePacks A JSON array of names of available example resource packs.

Returns the list of example resource packs that can be downloaded.

getExportSettings

Return Description
settings A JSON object of the current export settings.

Returns the current export settings.

getHytaleVersions

Return Description
versions A JSON array of JSON objects, one for each Hytale version found.

Returns the list of Hytale versions found by MiEx.

getItemModel

Argument Description
id The item name.
displayContext The string name of the display context to apply the transformation of to the model.
properties The NBT properties of the item.

Returns the model data for an item.

getMinecraftVersions

Return Description
versions A JSON array of JSON objects, one for each Minecraft version found.

Returns the list of Minecraft versions found by MiEx.

getModel

Argument Description
model The resource identifier of the model.
doubleSided A boolean of whether the model should be double sided or not. Block models are typically single sided, while entity models are double sided.

Returns the model data for a model.

getResourcePacks

Return Description
resourcePacks A JSON array of JSON objects, one for each resource pack available in MiEx.

Returns the list of resource packs available in MiEx.

getWorld

Return Description
world A JSON object containing world data.
world.path The path to the world folder.
world.dimension The dimension name of the currently loaded dimension.
world.dimensions A JSON array of dimension names available.
world.version The world version.
worldBounds A JSON array of minX, minZ, maxX, and maxZ block coordinates for which there could be valid chunks within.
players A JSON array of JSON objects, one for each player.
players[...].uuid The player's UUID.
players[...].name The player's name. MiEx will try to resolve the player's name from its UUID, using Mojang's API, on a background thread. If it has not yet resolved the player's name, then it will return the player's UUID.
players[...].dimension The dimension that the player is in.
players[...].x The X coordinate of the player.
players[...].y The Y coordinate of the player.
players[...].z The Z coordinate of the player.
players[...].data The player's NBT data.

Returns the world data of the currently loaded world.

getWorlds

Return Description
worlds A JSON array of JSON objects, one for each world found.

Returns the list of worlds found by MiEx.

loadDimension

Argument Description
dimension A string specifying the dimension name in the currently loaded world to load.

Loads in a specific dimension of the world.

loadWorld

Argument Description
world A string specifying the path of a world or name of a world. If it is a name, then it will pick the first world that it finds that matches the name.
loadWorldResourcePacks A boolean indicating whether it should automatically enable the resource packs that this world depends on. If it cannot find the necessary resource packs, then it will automatically extract them and install them into a resource pack in MiEx.
worldResourcePackName If MiEx is going to automatically extract a world's resource packs, this specifies the name of the resource pack into which it should all be installed to.

Opens up a world in MiEx.

pbrGenerator

Argument Description
resourcePacks A JSON array of strings specifying the resource pack UUIDs which to be active when running the PBR Generator.
saveToResourcePack A string specifying the resource pack folder name to which to save the generated textures. If not specified or set to null, it stores the generated textures next to their source textures.
utilityTextures A JSON array of string specifying the suffixes that indicate that a texture is a utility texture.

Runs the PBR Generator.

quit

Argument Description

Closes MiEx.

reloadResourcePacks

Argument Description

Reloads all resource packs.

resolveTags

Argument Description
tags A JSON array of strings of tags to resolve.

Returns the list of names for each tag.

setActiveResourcePacks

Argument Description
resourcePacks A JSON array of resource pack UUIDs that should be made active. It preserves the order. The base_resource_pack is always put last.

Set the active resource packs in MiEx.

setEnvironmentSettings

Argument Description
settings JSON object of key/value pairs for each environment setting. The value may be a string, a number, a boolean, or a JSON array of strings.
saveToFile If true, saves the currently set environment settings to the env file.

Sets the environment settings in MiEx. Changes typically only get applied when restarting MiEx.

updateBaseResourcePack

Argument Description
version A string specifying a Minecraft version name as outputted by getMinecraftVersions.

Update the base_resource_pack to a different Minecraft version.

updateBaseResourcePackHytale

Argument Description
version A string specifying a Hytale version name as outputted by getHytaleVersions.

Update the base_resource_pack_hytale to a different Hytale version.

updateBuiltInFiles

Argument Description

Update the built-in files. This is automatically done on start up, but can be done again using this command if needed.

Clone this wiki locally