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:
commit
d3874644c1
@ -1425,7 +1425,21 @@ namespace MWScript
|
|||||||
SceneUtil::PositionAttitudeTransform* baseNode = ptr.getRefData().getBaseNode();
|
SceneUtil::PositionAttitudeTransform* baseNode = ptr.getRefData().getBaseNode();
|
||||||
if (baseNode)
|
if (baseNode)
|
||||||
baseNode->accept(visitor);
|
baseNode->accept(visitor);
|
||||||
|
// 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: ";
|
msg << "Bound textures: ";
|
||||||
|
}
|
||||||
if (!visitor.mTextures.empty())
|
if (!visitor.mTextures.empty())
|
||||||
{
|
{
|
||||||
msg << std::endl;
|
msg << std::endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user