1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Merge branch 'oripaging' into 'master'

Try printing template textures if instance textures are unavailable for any reason

See merge request OpenMW/openmw!2709
This commit is contained in:
psi29a 2023-02-10 16:53:02 +00:00
commit d3874644c1

View File

@ -1425,7 +1425,21 @@ namespace MWScript
SceneUtil::PositionAttitudeTransform* baseNode = ptr.getRefData().getBaseNode();
if (baseNode)
baseNode->accept(visitor);
msg << "Bound textures: ";
// The instance might not have a physical model due to paging or scripting.
// If this is the case, fall back to the template
if (visitor.mTextures.empty())
{
Resource::SceneManager* sceneManager
= MWBase::Environment::get().getResourceSystem()->getSceneManager();
const_cast<osg::Node*>(sceneManager->getTemplate(model).get())->accept(visitor);
msg << "Bound textures: [None]" << std::endl;
if (!visitor.mTextures.empty())
msg << "Model textures: ";
}
else
{
msg << "Bound textures: ";
}
if (!visitor.mTextures.empty())
{
msg << std::endl;