Unified code for material config file generation