mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 11:06:39 +00:00
Use model template as a fallback in BetaComment
This commit is contained in:
parent
de2bd6d802
commit
e96448d66f
1 changed files with 15 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue