added function to write materials to h5m