BakeTask in Plugin

What have you tried? The documentation has a section on making custom bake tasks.