add material export
fix file writing proc