Jump to content

Mod Loader/Garments

From Threadbox

A garment pack adds a bodice, skirt, sleeve or collar to the sketchbook. Start by copying a game piece, then change the parts you need: its pictures, tags, panels or rules for combining it with other pieces.

For custom models, export each sewing panel as an OBJ with UVs for its flat cutting pattern.

Make your first pack

Create Dressmaker/Mods/PracticeBodice and save this as mod.json inside it. Check that your text editor has not added .txt to the filename.

{
  "id": "yourname.practice-bodice",
  "name": "Practice Bodice Pack",
  "author": "Your name",
  "version": "1.0.0",
  "garmentComponents": [
    {
      "id": "bodice",
      "name": "Practice Bodice",
      "baseComponent": "Split Crew Neck Bodice"
    }
  ]
}

Restart Dressmaker and choose Practice Bodice in the sketchbook. This is a separate copy of Split Crew Neck Bodice, with its original panels, variants, pictures and tags.

Where the JSON fields go

The outer object describes the pack. Each object inside garmentComponents describes one selectable piece. A piece can have several variants; each variant contains the panels you cut and sew.

mod.json
    id, name, author, version          The pack
    garmentTags                       New tag definitions
    garmentComponents
        id, name, baseComponent       One garment piece
        icon, sketch, tagWeights      Pictures and style scores
        compatibility                 Which other pieces it accepts
        variants
            baseVariant, sketch       One version of the piece
            panels
                basePanel OR model + zones
                transform, grainDirection, isBiasCut

Put garment options inside the piece, beside baseComponent. Put panel options inside an object in panels. A model field at the top of the pack will not create a garment.

Several levels use the same field names. The pack's name appears in Mod Manager; a garment's name appears in the sketchbook. The pack's icon is its Mod Manager picture; the garment's icon is its selection picture.

Keep the pack ID and garment ID when updating an existing item. The example's saved ID is yourname.practice-bodice.bodice. Changing either ID makes a different item.

Choose what to copy

Open BepInEx/config/DressmakerMods/garment-reference.json in your game folder. Mod Loader writes it at startup. Find the piece you want, then copy its exact ID into baseComponent. It supplies the category and settings you leave out.

baseVariant selects a variant of that base piece. basePanel selects a panel inside that base variant. Both start at zero. A piece with four panels has indices 0, 1, 2 and 3; index 4 would be out of range.

If you leave this out What is kept
variants Every variant of the base garment.
panels inside a variant Every panel of that variant.
model on a panel with basePanel The source panel's mesh.
compatibility The base piece's sleeve, collar, waist and exclusion rules.

Writing a list replaces that whole list. If you supply one variant, the new piece has one variant. If you supply one panel, that variant has one panel. Include an entry for each one you want to keep. Empty variants and panels lists are invalid; omit the field to copy the base.

Add pictures and tags

Icon and sketch

Put your images in the pack and replace the garment entry inside garmentComponents with this:

{
  "id": "bodice",
  "name": "Practice Bodice",
  "baseComponent": "Split Crew Neck Bodice",
  "icon": "images/bodice-icon.png",
  "sketch": "images/bodice-sketch.png"
}

Paths start at the folder containing mod.json. Both pictures accept PNG or JPEG; use PNG for transparency. icon is the small selection picture. sketch is the drawing on the sketchbook page. Neither is generated from your model. Keep the icon close to its artwork rather than surrounding it with a large empty border.

Style tags

To add a new tag, define it at the top level of the pack. This fragment goes beside garmentComponents:

"garmentTags": [{ "id": "Handmade", "name": "Handmade" }]

Then add these fields inside the garment entry:

"replaceTags": false,
"tagWeights": [
  { "tag": "Handmade", "weight": 5 },
  { "tag": "Casual", "weight": 3 }
]

With replaceTags: false, unlisted base tags stay. A listed tag replaces that tag's inherited weight, or adds it if missing. With true, only your list is used. Weights contribute to the style score; they are not percentages. Use a short tag ID from this pack, a native ID, or another pack's full tag ID.

Replace a panel with an OBJ

Export your back panel as pieces/back.obj. Then add this variants field inside the garment entry:

"variants": [
  {
    "baseVariant": 0,
    "panels": [
      { "basePanel": 0 },
      { "basePanel": 1, "name": "Back", "model": "pieces/back.obj" },
      { "basePanel": 2 },
      { "basePanel": 3 }
    ]
  }
]

Panel 1 is Split Crew Neck Bodice's back. The other entries copy its remaining three panels. Check the reference before using those numbers with a different base. Several new entries can copy the same base panel.

Prepare the model

  1. Export one sewing panel per file, in metres with Y up. Keep it in its fitted position relative to the mannequin.
  2. Include UVs for the flat cutting pattern. Check for overlaps and triangles with no UV area.
  3. Include normals. If any face corner has no normal, the loader recalculates them.
  4. Put every referenced OBJ inside the pack. Objects and groups within one OBJ are combined into one panel.

OBJ materials and MTL files are ignored; the player chooses fabrics in Dressmaker. A model file does not create seam rules or fit itself to neighbouring pieces. The loader also accepts .mesh.json panels. See file limits and formats.

Add a panel without copying one

Supply model and zones, and omit basePanel. This is one entry to add to your variant's panels list:

{
  "name": "Back belt",
  "model": "pieces/back-belt.obj",
  "zones": [
    "BodiceBack"
  ],
  "grainDirection": [
    0,
    1,
    0
  ],
  "isBiasCut": false
}

Keep the other panel entries too. zones labels the body regions covered by this panel; it does not move the mesh. You can give a copied panel new zones as well. For a new panel, the default grain direction is [0, 1, 0] and the default bias setting is false.

Use BodiceFront, BodiceBack, BodiceLeft, BodiceRight, SkirtFront, SkirtBack, SkirtLeft, SkirtRight, Collar, ArmLeft, ArmRight, CuffLeft or CuffRight. A panel can have several zones. There can be up to 32 panels per variant.

Set basePanel or supply model and zones explicitly. Omitting both basePanel and zones copies panel 0.

Add another variant

Add another object to variants. You can copy the same base variant more than once, give each one a different sketch, and change its panels. This field creates two variants which use the same native panels but different drawings:

"variants": [
  { "baseVariant": 0, "sketch": "images/plain-sketch.png" },
  { "baseVariant": 0, "sketch": "images/alternate-sketch.png" }
]

To change a variant's shape, add its own panels list. A garment can have up to 16 variants. Their order in the list is the order used by the game.

Adjust size, rotation and position

Put transform inside a panel entry. It works for an imported mesh or a copied game panel. For example, this keeps panel 1's mesh but moves it 1 cm to the right:

{
  "basePanel": 1,
  "transform": {
    "scale": [
      1,
      1,
      1
    ],
    "rotation": [
      0,
      0,
      0
    ],
    "offset": [
      0.01,
      0,
      0
    ]
  }
}

Scale is a multiplier, rotation is in degrees, and offset is in metres. The order is scale, rotate around the model's origin, then move. UVs are unchanged. Use [0.01, 0.01, 0.01] only for a model exported in centimetres. Negative scale mirrors an axis; zero and near-zero scales are rejected. Check grainDirection after rotating: transforms do not rotate that field.

Add normal and ambient occlusion maps

A normal map adds raised-looking surface detail. An ambient occlusion map adds shading to folds and seams. Put these PNG paths inside the garment entry to apply them across its variants:

"normalMap": "images/bodice-normal.png",
"ambientOcclusionMap": "images/bodice-ao.png",
"flipNormalGreen": false

Use a tangent-space RGB normal map, with a flat normal near RGB (128, 128, 255). For ambient occlusion, white leaves the surface unoccluded and darker values add shading. These maps use the garment mesh's UVs and remain when the player chooses another fabric. Each PNG must be at most 25 MB and 8192 pixels per side.

Give a variant or panel different maps

The same three fields work inside a variant or panel. For each map, the loader checks the panel first, then the variant, then the garment, then the base material. Leaving a path out or using an empty string inherits the next level; it does not remove the map.

flipNormalGreen: true inverts the supplied normal map's green channel. Use it if your modelling program exports the opposite Y direction. An explicit panel value overrides the variant and garment values, even when it is false. It does not alter a normal map inherited from the game's material.

Choose compatible pieces

Put compatibility inside the garment entry. These rules control the choices offered with the piece. They do not reshape the model to fit.

"compatibility": {
  "usesSleeves": true,
  "collarType": "Round",
  "waistType": "NaturalWaist",
  "excludedComponents": []
}
Field Use on What to enter
usesSleeves Bodice true or false for attached sleeves.
collarType Bodice or collar Round, None, VNeck or Detached.
waistType Bodice or skirt NaturalWaist or EmpireWaist.
detachedSleeves Sleeve true or false.
excludedComponents Bodice Exact IDs of pieces to exclude. Use full IDs for modded pieces, such as yourname.other-pack.skirt. An empty array clears the base exclusions.

Omit a field to keep its base setting. Use only the fields listed for that garment type. For example, detachedSleeves on a bodice is an error. Missing excluded pieces are reported and can resolve when another pack registers them later.

Choose when the pattern unlocks

Garments are available by default. Add "unlockByDefault": false inside a garment entry to wait for an unlock, then add a friendship reward to grant it. This does not revoke patterns already earned in a save. There is no garment unlockLevel or shop cost field.

Example with custom panel settings

Save this as mod.json to make a bodice with a custom back panel and surface maps. Supply the named images and model before installing, or remove optional image fields you do not use.

{
  "id": "yourname.practice-bodice",
  "name": "Practice Bodice Pack",
  "author": "Your name",
  "version": "1.0.0",
  "garmentComponents": [
    {
      "id": "bodice",
      "name": "Practice Bodice",
      "baseComponent": "Split Crew Neck Bodice",
      "icon": "images/bodice-icon.png",
      "sketch": "images/bodice-sketch.png",
      "unlockByDefault": true,
      "replaceTags": false,
      "tagWeights": [
        {
          "tag": "Handmade",
          "weight": 5
        }
      ],
      "notes": "Practice garment.",
      "compatibility": {
        "usesSleeves": true,
        "collarType": "Round",
        "waistType": "NaturalWaist",
        "excludedComponents": []
      },
      "normalMap": "images/bodice-normal.png",
      "ambientOcclusionMap": "images/bodice-ao.png",
      "flipNormalGreen": false,
      "variants": [
        {
          "baseVariant": 0,
          "sketch": "images/variant-sketch.png",
          "panels": [
            {
              "basePanel": 0
            },
            {
              "basePanel": 1,
              "name": "Back",
              "model": "pieces/back.obj",
              "zones": [
                "BodiceBack"
              ],
              "grainDirection": [
                0,
                1,
                0
              ],
              "isBiasCut": false,
              "transform": {
                "scale": [
                  1,
                  1,
                  1
                ],
                "rotation": [
                  0,
                  0,
                  0
                ],
                "offset": [
                  0,
                  0,
                  0
                ]
              },
              "normalMap": "images/back-normal.png",
              "ambientOcclusionMap": "images/back-ao.png",
              "flipNormalGreen": false
            },
            {
              "basePanel": 2
            },
            {
              "basePanel": 3
            }
          ]
        }
      ]
    }
  ],
  "garmentTags": [
    {
      "id": "Handmade",
      "name": "Handmade"
    }
  ]
}

The back panel uses back-normal.png and back-ao.png; the other panels use the garment-level maps. The variant sketch overrides the garment sketch. Remove that variant-level sketch line to use bodice-sketch.png instead.

Install and test

  1. Back up a save through Mod Manager > Save backups.
  2. Install the pack folder or ZIP through Install/Update Mod, then restart Dressmaker.
  3. Find the piece and try each variant. Check its icon, drawing and available sleeves, collar and skirt.
  4. Cut and sew all panels. Check UV layout, seam lengths and fit at different mannequin measurements.
  5. Save the dress, quit and reopen it. Check the shape, fabrics and surface maps again.

If something is wrong

Problem Check
The piece is missing Open Mod Manager's Loading problems. Check the base ID, paths and whether unlockByDefault is false.
Only one panel or variant appears A supplied list replaces the whole base list. Add entries for the ones you wanted to keep.
Invalid basePanel It is the source panel index, not the new panel's number. Use a valid source, or omit it and supply model and zones.
The model looks right but cannot be cut or sewn Check UV area, overlaps and matching seam edges. A 3D preview alone does not test these.
The sketch still looks like the base garment Supply sketch. Importing a model does not draw a sketch.
Sleeves or skirts do not fit Check the compatibility rules and the mesh. Allowing a combination does not make its seams meet.

Side Placket Top workshop

The Side Placket Top workshop ZIP contains an OBJ, panel exporter and example pack. It is unfinished: the placket has seam and fit problems, and its sketch contains mesh lines. Use a spare save.

For its Blender steps, panel mapping and exporter command, see Side Placket Top files. The exporter is specific to that model. New packs can use separate OBJ panels without it.

Open the workshop model

Follow the Blender steps in the workshop notes.

Export the workshop panels

Use the workshop exporter only for its supplied model.

Field reference and C#

For field defaults and limits, see Garment fields. Use dressTemplates to offer a preset combination of pieces. For plugins, see C# registration, mesh helpers and garment events.

Use a category from another mod

If a plugin adds a category such as overskirts, ask its author for the piece type ID. Set pieceType beside baseComponent:

{
  "id": "lace-overskirt",
  "name": "Lace overskirt",
  "baseComponent": "Apron Skirt",
  "pieceType": "example.overskirt"
}

This example goes inside garmentComponents. Replace example.overskirt with the ID registered by your category plugin. The base still supplies panels and fitting settings. Add your own variants and models as usual.

The category plugin must handle the extra slot, selection and saved dresses. Setting this field alone does not add another slot. If the plugin is missing, Mod Loader skips the piece and reports the unknown type. Leave the field out to inherit the base piece's category.

Back to the Mod Loader guide