dedupe_materials
Merge duplicate or near-identical materials by color, texture, and properties to reduce draw calls, delete unused slots/orphans, and report removed materials and final counts.
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 |