Skip to content
.Staples. edited this page Feb 25, 2026 · 9 revisions

Elastic Clothing Fit - Developer Wiki

Elastic Clothing Fit is a Blender add-on that fits clothing meshes onto body meshes. It uses a proxy-based shrinkwrap pipeline to deform the clothing so it conforms to the body surface while preserving the clothing's original UV coordinates and silhouette as much as possible.

This wiki is written for developers who are new to the codebase. It explains not just what each piece of code does but why it works the way it does.


Pages

Page What it covers
Architecture How the modules fit together, data flow, key data structures
Fitting Pipeline Step-by-step walkthrough of the core fit algorithm
Live Preview How slider changes update the mesh in real time without re-running the full fit
Properties Every user-facing property, what it controls, and which callbacks it triggers
Operators Every operator: what it does, when it is available, and how it works
Panel UI How the sidebar panel is built and how it responds to add-on state
Updater The background update checker, download system, and one-shot startup installer

Quick Overview

What the add-on does

A user selects a body mesh and a clothing mesh. They click Fit Clothing. The add-on:

  1. Creates a temporary high-resolution copy of the clothing (the proxy).
  2. Shrinkwraps the proxy onto the body surface.
  3. Measures how each proxy vertex moved and transfers that displacement to the real clothing mesh using a weighted average.
  4. Optionally smooths sharp creases in tight areas.
  5. Enters preview mode - the clothing now sits on the body, and the user can adjust sliders to fine-tune the result in real time without re-running the full fit.
  6. The user clicks Apply to finalize or Cancel to restore the original shape.

What each module is responsible for

elastic_fit/
├── __init__.py      Registration, bl_info, add-on preferences
├── state.py         Shared globals and pure utility functions
├── preview.py       Live preview engine and all property update callbacks
├── properties.py    Every user-facing property (PropertyGroup definitions)
├── operators.py     Every Blender operator (Fit, Apply, Cancel, Remove, etc.)
├── panels.py        The sidebar panel UI
└── updater.py       Background update checker, downloader, and restart logic

Key concepts

Blender operators

An operator in Blender is a unit of work that can be undone. Every button in the panel corresponds to an operator. Operators have a poll() class method that controls whether the button is greyed out, and an execute() method that does the actual work.

Blender properties and callbacks

Properties are the sliders, checkboxes, and dropdowns in the panel. When you register a FloatProperty with an update= argument, Blender calls that function every time the value changes. The add-on uses this to refresh the 3D view live when a slider moves during preview.

The preview cache

After a fit runs, the displacement data is stored in a dict called state._efit_cache. When a slider changes, instead of re-running the full fit (which takes seconds), the preview engine reads the cached displacement and reapplies it with the new slider values in milliseconds. This is what makes the sliders feel interactive.

The flat array for undo

Before fitting, the clothing's original vertex positions are saved as a flat list: [x0, y0, z0, x1, y1, z1, ...]. This gets stored both in a Python dict (state._efit_originals) and as a custom property on the object (obj["_efit_originals"]). The Python dict is fast and reliable within a session; the custom property survives saving and reopening a .blend file.

Elastic Clothing Fit

Home


Core

Architecture

Fitting Pipeline

Pipeline Module

Live Preview


Reference

Operators

Properties

Panel UI

Updater

Math Reference

Testing

Clone this wiki locally