How to use ROOT's GDML visualisation in a script?

Have you mistakenly not defined materials as I had?

Since the links no longer render for context here is the original post: