dedupe_materials
Merge duplicate materials by matching color, textures, and properties within tolerance, delete extras, join repeated mesh slots, and clean unused or orphan materials to cut draw calls.
Instructions
Merge materials that look the same: same colour, roughness, metallic, alpha, emission, coat and same textures,
each within tolerance (0.01 means 1 percent). Users move to the first material of each group, the extras are deleted,
and slots that now repeat inside a mesh are joined. Fewer materials means fewer draw calls. names limits the check.
Returns how many were removed and the material count before and after. Textured and procedural materials only merge
when their images and node types are the same.
It also cleans up, on every mesh: clean_slots=true removes empty slots and slots that no face uses
(empty_slots_removed, unused_slots_removed); remove_orphans=true deletes materials with zero users (orphans_removed).
An empty slot that faces still point at is kept and listed in faces_without_material: assign those faces first.
tolerance=0 merges only exact copies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | No | ||
| tolerance | No | ||
| clean_slots | No | ||
| remove_orphans | No |