// retrieve the material name associated with a scene node Ogre::SceneNode* sceneNode = ... // some scene node Ogre::MaterialPtr mat = sceneNode->getAttachedObject(0)->getSubEntity(0)->getMaterial(); std::string materialName = mat->getName();In this example, we first retrieve the material associated with the first sub-entity of the first attached object of the given scene node. We then call the getName function on the material object to retrieve its name. This code example is using the C++ version of the Ogre 3D graphics rendering engine. The Ogre package library contains a variety of functions and classes that can be used to create and manipulate 3D scenes and assets within a game or application.