ENH: write out material file