Jump to content

Mod Loader/Reference/Garment fields

From WikiName

This page lists the garmentTags and garmentComponents entries in mod.json. For the first pack, see Make a garment and the Stargazer Bodice example.

Start with a game pattern

A custom piece copies a supported game garment. The base keeps its garment type, fit rules, compatibility, materials, and any panel geometry you leave alone. Dressmaker does not support adding a new garment category.

Use the exact component ID from BepInEx/config/DressmakerMods/garment-reference.json. The file is written when the loader starts. Bodices, skirts, sleeves, and collars are supported bases.

Pack entries

Add custom tags and pieces at the top level of mod.json. This is the Stargazer example:

{
  "id": "example.garment-starter",
  "garmentTags": [
    { "id": "Stargazer", "name": "Stargazer" }
  ],
  "garmentComponents": [
    {
      "id": "night-bodice",
      "name": "Night Bodice",
      "baseComponent": "Split Crew Neck Bodice",
      "icon": "icon.png",
      "sketch": "sketch.png",
      "variants": [
        { "baseVariant": 0 },
        { "baseVariant": 1, "sketch": "back-sketch.png" }
      ],
      "replaceTags": true,
      "tagWeights": [
        { "tag": "Stargazer", "weight": 12 },
        { "tag": "Elegant", "weight": 3 }
      ],
      "notes": "A fitted bodice with a night-sky sketch. Uses the base pattern panels."
    }
  ]
}

The loader saves the piece as example.garment-starter.night-bodice and the tag as example.garment-starter.Stargazer. Keep the pack ID and local IDs stable after release; saved dresses refer to them.

Garment component fields

Field Required Meaning
id Yes Local ID for this piece. The loader combines it with the pack ID.
name Yes Name shown in the game.
baseComponent Yes Exact ID of a supported game garment. The base supplies type and fit behavior.
icon No Pack-relative PNG or JPG used in selection UI. Omit it to keep the base icon.
sketch No Pack-relative PNG or JPG used as the sketch for variants that do not set their own. Omit it to keep each base sketch.
variants No Variants to copy or customize. If omitted, every base variant is copied. If present, list each variant to keep.
replaceTags No When true, start with no base tag weights. Otherwise inherit the base weights. Default is false.
tagWeights No Tag IDs and additive weights. A listed weight adds a tag or replaces that tag's inherited weight.
notes No Notes copied to the garment component; when omitted, the base notes remain.

Tags and weights

Each garmentTags entry has an id and player-facing name. A tagWeights entry uses a tag ID and numeric weight. You can name a tag from this pack, another pack, or the game (such as Elegant). The weight contributes to the game's tag score; it is not a percentage.

Without replaceTags, the loader copies the base weights, then adds listed tags or changes the matching tag's weight. With replaceTags: true, only listed weights are used. Zero contributes no score. An unknown or duplicate tag makes the piece fail to load; check BepInEx/LogOutput.log.

A pack may contain tags without garment pieces. The loader retains garment and tag data referenced by saved dresses in its local cache after a pack is removed. Keep the pack installed if you want to continue editing its pieces.

Variant fields

Field Meaning
baseVariant Zero-based index of the variant to copy from the base. Must refer to an existing variant.
sketch Optional pack-relative PNG or JPG for this variant. Overrides the component-level sketch.
panels Optional replacement panel list. If omitted, the variant copies every panel from its base variant.

When you provide variants, list every base variant you want to keep. A garment can have up to 16 variants.

Panel fields

A panel list replaces the base variant's panel list. Each panel starts from one panel in that base variant; this keeps its sewing zone and other game behavior.

Field Meaning
basePanel Zero-based index of the panel to copy from the selected base variant.
model Optional pack-relative mesh JSON file. Omit it to copy the base panel mesh.
name Optional panel name shown by the game. Omit it to keep the base panel name.
grainDirection Optional three-number vector, such as [0, 1, 0]. Omit it to keep the base grain direction.
isBiasCut Optional boolean. Omit it to keep the base panel setting.

For example, this changes one panel's name, mesh, grain direction, and bias setting:

{
  "variants": [{
    "baseVariant": 0,
    "panels": [{
      "basePanel": 0,
      "name": "Moonlit front",
      "model": "front.mesh.json",
      "grainDirection": [0, 1, 0],
      "isBiasCut": false
    }]
  }]
}

Panel mesh JSON

The game reads JSON meshes at runtime; it does not load FBX or OBJ files from a garment pack. A mesh has positions, uvs, and triangles arrays:

  • positions contains X, Y, Z triples in metres.
  • uvs contains one U, V pair for each vertex.
  • triangles contains zero-based vertex indices in groups of three.

Each panel needs at least one triangle, UV area, and 3D surface area. A file can have at most 65,535 vertices and 8 MB. Keep the base panel's orientation and seam zones in mind: a replacement mesh does not create new sewing joins or fit rules. Test by cutting and sewing the panel; the mannequin preview alone does not show whether it works.

C# garment API

A BepInEx plugin can register the same garment definitions. Reference DressmakerMods.dll, BepInEx, the game assemblies, and the Unity assemblies. Declare a dependency on yuu.dressmaker.mods and register inside WhenReady.

using System.Collections.Generic;
using System.IO;
using BepInEx;
using DressmakerMods;

[BepInPlugin("yourname.moon-clothes", "Moon Clothes", "1.0.0")]
[BepInDependency("yuu.dressmaker.mods", "0.6.67")]
public sealed class MoonClothesPlugin : BaseUnityPlugin
{
    private void Awake()
    {
        GarmentModApi.WhenReady(() =>
        {
            string art = Path.Combine(Paths.GameRootPath, "Mods", "moon-clothes");
            ItemTag tag = GarmentModApi.RegisterTag(
                "yourname.moon-clothes", "Moonlit", "Moonlit");
            GarmentModApi.RegisterFromBase(
                "Split Crew Neck Bodice", "yourname.moon-clothes",
                "moon-bodice", "Moon Bodice", draft =>
                {
                    draft.icon = GarmentModApi.LoadIcon(art, "icon.png");
                    draft.variations[0].sketchedSprite =
                        GarmentModApi.LoadSketch(art, "sketch.png");
                    draft.additiveTags = new List<TagWeight> {
                        new TagWeight { tag = tag, weight = 8f }
                    };
                });
        });
    }
}
Method or type Use
bool IsReady
void WhenReady(Action callback)
Run after the loader and native garment data are ready. If already ready, the callback runs immediately.
GarmentComponent FindComponent(string id)
GarmentComponent[] GetComponents()
Look up registered garment pieces.
ItemTag FindTag(string id)
ItemTag[] GetTags()
Look up native and custom tags.
ItemTag RegisterTag(string modId, string localId, string displayName) Register a namespaced garment tag.
GarmentComponent RegisterComponent(string modId, ModGarmentDefinition definition, string assetDirectory) Register a ModGarmentDefinition using the same fields as the JSON pack.
GarmentComponent RegisterFromBase(string baseComponentId, string modId, string localId, string displayName, Action<GarmentComponent> configure) Copy a base piece, edit the copy in the callback, and register it.
Sprite LoadIcon(string assetDirectory, string file)
Texture2D LoadSketch(string assetDirectory, string file)
Mesh LoadPanelMesh(string assetDirectory, string file)
Load an icon, sketch, or panel mesh from the supplied asset directory.
ModGarmentDefinition, ModGarmentVariant, ModGarmentPanel, GarmentTagWeight, ModGarmentTag Public types for constructing a garment definition in C#.

To replace a panel mesh in the callback, assign GarmentModApi.LoadPanelMesh(...) to that panel's mannequinMesh. The API copies the base component and its variants before the callback, so edits do not change the native piece. The loader checks custom mesh triangles and UVs. Assets loaded through the API stay available for the session; install the plugin DLL each time you start the game.

Check a garment

  1. Back up the save, install the pack, and restart Dressmaker.
  2. Check the piece icon and each sketchbook variant.
  3. Check tag scoring on a commission.
  4. Cut and sew each panel, then reopen the saved dress.
  5. If a piece is missing, read BepInEx/LogOutput.log for its ID and validation error.

Back to the Mod Loader guide