v4.0
This command deletes all the materials in all the Material Libraries that are not currently used.
DeleteAllUnusedMaterials();