Material from Layer?

Is there any way to transfer the material from a layer to a Custom Preview module?

Me playing in the sandbox with what i can find…

or if someone can point me to the how to in c#/py? (Im willing to learn yet another language or two!, im not sure where to start…)

TIA

you can already just pick from the component
image

Dumbfounded! Never saw that coming!
Always had something plugged in and ignored the disabled submenu!

Thank you!