Skip to content

Commit

Permalink
#5402: Workaround to remove all remnants that are possibly added to t…
Browse files Browse the repository at this point in the history
…he ModelPreview's entity by undo/redo operations in the map scene.
  • Loading branch information
codereader committed Nov 14, 2020
1 parent ef72964 commit 161deef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/wxutil/preview/ModelPreview.cpp
Expand Up @@ -9,6 +9,7 @@
#include "math/AABB.h"
#include "modelskin.h"
#include "entitylib.h"
#include "scenelib.h"
#include "scene/Node.h"
#include "scene/BasicRootNode.h"
#include "wxutil/dialog/MessageBox.h"
Expand Down Expand Up @@ -159,8 +160,12 @@ void ModelPreview::prepareScene()

_modelNode = GlobalModelCache().getModelNode(_model);

if (_modelNode)
if (_modelNode)
{
// Workaround until #5408 is implemented: remove all remnants from the entity
scene::NodeRemover remover;
_entity->traverseChildren(remover);

_entity->addChildNode(_modelNode);

// Apply the skin
Expand Down

0 comments on commit 161deef

Please sign in to comment.