Skip to content

Commit

Permalink
#5996: Fix ModelSelector not displaying the skin defined in modelDefs
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 14, 2024
1 parent 8812ae4 commit 1ae7ccf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/wxutil/preview/ModelPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ void ModelPreview::prepareScene()
// Apply the idle pose if possible
if (modelDef)
{
// Set the default skin to the one defined in the modelDef
auto skinned = std::dynamic_pointer_cast<SkinnedModel>(_modelNode);

if (skinned && !modelDef->getSkin().empty())
{
skinned->setDefaultSkin(modelDef->getSkin());
skinned->skinChanged(std::string()); // trigger a remap
}

scene::applyIdlePose(_modelNode, modelDef);
}

Expand Down

0 comments on commit 1ae7ccf

Please sign in to comment.