[DF-3937] Added correct saving of materials