Skip to content

Commit

Permalink
#5482: Display the .def filename the modelDef is declared in
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 5, 2021
1 parent 81bc118 commit 8496561
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion radiant/ui/modelselector/ModelSelector.cpp
Expand Up @@ -237,12 +237,24 @@ void ModelSelector::onModelLoaded(const model::ModelNodePtr& modelNode)
// Update the text in the info table
const model::IModel& model = modelNode->getIModel();

_infoTable->Append(_("Model name"), _modelPreview->getModel());
auto modelName = _modelPreview->getModel();
_infoTable->Append(_("Model name"), modelName);
_infoTable->Append(_("Skin name"), _modelPreview->getSkin());
_infoTable->Append(_("Total vertices"), string::to_string(model.getVertexCount()));
_infoTable->Append(_("Total polys"), string::to_string(model.getPolyCount()));
_infoTable->Append(_("Material surfaces"), string::to_string(model.getSurfaceCount()));

if (modelName.find_last_of('/') == std::string::npos)
{
// Model name doesn't have a folder, this could be a modelDef
auto modelDef = GlobalEntityClassManager().findModel(modelName);

if (modelDef)
{
_infoTable->Append(_("Defined in"), modelDef->defFilename);
}
}

// Add the list of active materials
_materialsList->clear();

Expand Down
2 changes: 1 addition & 1 deletion radiantcore/eclass/Doom3ModelDef.h
Expand Up @@ -46,7 +46,7 @@ class Doom3ModelDef :
parent.clear();
anims.clear();
modName = "base";
defFileName.clear();
defFilename.clear();
}

// Reads the data from the given tokens into the member variables
Expand Down

0 comments on commit 8496561

Please sign in to comment.