do

function ExtractCloakMeshBlueprint(bp)
    local meshid = bp.Display.MeshBlueprint
    if not meshid then return end

    local meshbp = original_blueprints.Mesh[meshid]
    if not meshbp then return end

    local shadername = 'UnitFormationPreview'

    local cloakmeshbp = table.deepcopy(meshbp)
    if cloakmeshbp.LODs then
        for i,lod in cloakmeshbp.LODs do
            lod.ShaderName = shadername
	  end
    end
    cloakmeshbp.BlueprintId = meshid .. '_cloak'
    bp.Display.CloakMeshBlueprint = cloakmeshbp.BlueprintId
    MeshBlueprint(cloakmeshbp)
end

local OldModBlueprints = ModBlueprints
function ModBlueprints(all_blueprints)
    OldModBlueprints(all_blueprints)
    for id,bp in all_blueprints.Unit do
        ExtractCloakMeshBlueprint(bp)
    end
end

end