ufo2map seems to have a material file generation feature. Have you tried that ?
I did. But, using this for the tiles of an RMA it generates a file for each tile, e.g. iterating over +mansion gives 29 new .mat files. For some reason it always only adds exactly one entry to the file. Therefore, it uses some hardcoded values that are not the best imo.
Also, it doesn´t check whether an entry already existst or not, so it is not usable for maintenance.