How can I get a reference to a Material with C++?

Already been asked before: