Its a bit complex in my way. two layers used… one is with vertex map in all edges, from AO I am not getting mask from all sides, so I did with vertex and second layer is a bit dirt spots.
bake texture is ignoring these layer materials… getting full black and white all channels (attached), not getting mask in any channel except C4D AO, that is in gradient.
I wish I share the file… but not now, may be later after release but I can show in other sample scene later.