EMotion FX: Automatically clear selection when closing skeleton outliner

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
monroegm-disable-blank-issue-2
Benjamin Jillich 4 years ago
parent cf9825d37e
commit 40c0edde85

@ -16,11 +16,8 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHeaderView> #include <QHeaderView>
namespace EMotionFX namespace EMotionFX
{ {
int SkeletonOutlinerPlugin::s_iconSize = 16;
SkeletonOutlinerPlugin::SkeletonOutlinerPlugin() SkeletonOutlinerPlugin::SkeletonOutlinerPlugin()
: EMStudio::DockWidgetPlugin() : EMStudio::DockWidgetPlugin()
, m_mainWidget(nullptr) , m_mainWidget(nullptr)
@ -30,13 +27,16 @@ namespace EMotionFX
SkeletonOutlinerPlugin::~SkeletonOutlinerPlugin() SkeletonOutlinerPlugin::~SkeletonOutlinerPlugin()
{ {
// Reset selection on close.
m_skeletonModel->GetSelectionModel().clearSelection();
m_skeletonModel.reset();
for (MCore::Command::Callback* callback : m_commandCallbacks) for (MCore::Command::Callback* callback : m_commandCallbacks)
{ {
CommandSystem::GetCommandManager()->RemoveCommandCallback(callback, true); CommandSystem::GetCommandManager()->RemoveCommandCallback(callback, true);
} }
m_commandCallbacks.clear(); m_commandCallbacks.clear();
SkeletonOutlinerNotificationBus::Broadcast(&SkeletonOutlinerNotifications::SingleNodeSelectionChanged, nullptr, nullptr);
EMotionFX::SkeletonOutlinerRequestBus::Handler::BusDisconnect(); EMotionFX::SkeletonOutlinerRequestBus::Handler::BusDisconnect();
} }

@ -19,7 +19,6 @@
#include <QTreeView> #include <QTreeView>
#endif #endif
QT_FORWARD_DECLARE_CLASS(QLabel) QT_FORWARD_DECLARE_CLASS(QLabel)
namespace EMotionFX namespace EMotionFX
@ -73,7 +72,7 @@ namespace EMotionFX
AZStd::unique_ptr<SkeletonModel> m_skeletonModel; AZStd::unique_ptr<SkeletonModel> m_skeletonModel;
QModelIndexList m_selectedRows; QModelIndexList m_selectedRows;
SkeletonSortFilterProxyModel* m_filterProxyModel; SkeletonSortFilterProxyModel* m_filterProxyModel;
static int s_iconSize; static constexpr int s_iconSize = 16;
// Callbacks // Callbacks
// Works for all commands that use the actor id as well as the joint name mixins // Works for all commands that use the actor id as well as the joint name mixins

Loading…
Cancel
Save