Remove TrackView-related camera logic
TrackView uses 'normal' camera entities now Signed-off-by: Yuriy Toporovskyy <toporovskyy.y@gmail.com>
This commit is contained in:
@@ -39,7 +39,6 @@ namespace Camera
|
||||
{
|
||||
CameraListItem::CameraListItem(const AZ::EntityId& cameraId)
|
||||
: m_cameraId(cameraId)
|
||||
, m_sequenceId(AZ::EntityId())
|
||||
{
|
||||
if (cameraId.IsValid())
|
||||
{
|
||||
@@ -52,44 +51,24 @@ namespace Camera
|
||||
}
|
||||
}
|
||||
|
||||
// Used for a virtual camera that is really whatever camera is being
|
||||
// used for a Track View Sequence.
|
||||
CameraListItem::CameraListItem(const char* cameraName, const AZ::EntityId& sequenceId)
|
||||
: m_cameraName(cameraName)
|
||||
, m_sequenceId(sequenceId)
|
||||
{
|
||||
Maestro::SequenceComponentNotificationBus::Handler::BusConnect(sequenceId);
|
||||
}
|
||||
|
||||
CameraListItem::~CameraListItem()
|
||||
{
|
||||
Maestro::SequenceComponentNotificationBus::Handler::BusDisconnect();
|
||||
|
||||
if (m_cameraId.IsValid())
|
||||
{
|
||||
AZ::EntityBus::Handler::BusDisconnect(m_cameraId);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::SequenceComponentNotificationBus::Handler
|
||||
void CameraListItem::OnCameraChanged(const AZ::EntityId& oldCameraEntityId, const AZ::EntityId& newCameraEntityId)
|
||||
{
|
||||
AZ_UNUSED(oldCameraEntityId);
|
||||
m_cameraId = newCameraEntityId;
|
||||
}
|
||||
|
||||
bool CameraListItem::operator<(const CameraListItem& rhs)
|
||||
{
|
||||
return m_cameraId < rhs.m_cameraId;
|
||||
}
|
||||
|
||||
CameraListModel::CameraListModel(ViewportCameraSelectorWindow* myParent)
|
||||
: QAbstractListModel(myParent), m_parent(myParent)
|
||||
CameraListModel::CameraListModel(QWidget* myParent)
|
||||
: QAbstractListModel(myParent)
|
||||
{
|
||||
m_cameraItems.push_back(AZ::EntityId());
|
||||
CameraNotificationBus::Handler::BusConnect();
|
||||
Maestro::EditorSequenceNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
CameraListModel::~CameraListModel()
|
||||
@@ -97,7 +76,6 @@ namespace Camera
|
||||
// set the view entity id back to Invalid, thus enabling the editor camera
|
||||
EditorCameraRequests::Bus::Broadcast(&EditorCameraRequests::SetViewFromEntityPerspective, AZ::EntityId());
|
||||
|
||||
Maestro::EditorSequenceNotificationBus::Handler::BusDisconnect();
|
||||
CameraNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
@@ -154,12 +132,6 @@ namespace Camera
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::EditorSequenceNotificationBus::Handler
|
||||
void CameraListModel::OnSequenceSelected(const AZ::EntityId& )
|
||||
{
|
||||
}
|
||||
|
||||
QModelIndex CameraListModel::GetIndexForEntityId(const AZ::EntityId entityId)
|
||||
{
|
||||
int row = 0;
|
||||
@@ -203,17 +175,10 @@ namespace Camera
|
||||
// bus connections
|
||||
EditorCameraNotificationBus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
|
||||
Maestro::EditorSequenceNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
ViewportCameraSelectorWindow::~ViewportCameraSelectorWindow()
|
||||
{
|
||||
if (Maestro::SequenceComponentNotificationBus::Handler::BusIsConnected())
|
||||
{
|
||||
Maestro::SequenceComponentNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
Maestro::EditorSequenceNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
|
||||
EditorCameraNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
@@ -257,29 +222,6 @@ namespace Camera
|
||||
setDisabled(false);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::EditorSequenceNotificationBus::Handler
|
||||
void ViewportCameraSelectorWindow::OnSequenceSelected(const AZ::EntityId& sequenceEntityId)
|
||||
{
|
||||
// Connect to the Sequence Component Bus when a sequence is selected for OnCameraChanged.
|
||||
if (Maestro::SequenceComponentNotificationBus::Handler::BusIsConnected())
|
||||
{
|
||||
Maestro::SequenceComponentNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
if (sequenceEntityId.IsValid())
|
||||
{
|
||||
Maestro::SequenceComponentNotificationBus::Handler::BusConnect(sequenceEntityId);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::SequenceComponentNotificationBus::Handler
|
||||
void ViewportCameraSelectorWindow::OnCameraChanged(const AZ::EntityId& oldCameraEntityId, const AZ::EntityId& newCameraEntityId)
|
||||
{
|
||||
AZ_UNUSED(oldCameraEntityId);
|
||||
AZ_UNUSED(newCameraEntityId);
|
||||
}
|
||||
|
||||
// swallow mouse move events so we can disable sloppy selection
|
||||
void ViewportCameraSelectorWindow::mouseMoveEvent(QMouseEvent*) {}
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QListView>
|
||||
#include <Maestro/Bus/EditorSequenceBus.h>
|
||||
#include <Maestro/Bus/SequenceComponentBus.h>
|
||||
#include <AzFramework/Components/CameraBus.h>
|
||||
#include <AzCore/Component/EntityBus.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
|
||||
@@ -25,37 +23,26 @@ namespace Camera
|
||||
// Each item in the list holds the camera's entityId and name
|
||||
struct CameraListItem
|
||||
: public AZ::EntityBus::Handler
|
||||
, public Maestro::SequenceComponentNotificationBus::Handler
|
||||
{
|
||||
public:
|
||||
CameraListItem(const AZ::EntityId& cameraId);
|
||||
// Used for a virtual camera that is really whatever camera is being
|
||||
// used for a Track View Sequence.
|
||||
CameraListItem(const char* cameraName, const AZ::EntityId& sequenceId);
|
||||
~CameraListItem();
|
||||
|
||||
void OnEntityNameChanged(const AZStd::string& name) override { m_cameraName = name; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::SequenceComponentNotificationBus::Handler
|
||||
void OnCameraChanged(const AZ::EntityId& oldCameraEntityId, const AZ::EntityId& newCameraEntityId) override;
|
||||
bool operator<(const CameraListItem& rhs);
|
||||
|
||||
AZ::EntityId m_cameraId;
|
||||
AZStd::string m_cameraName;
|
||||
AZ::EntityId m_sequenceId;
|
||||
};
|
||||
|
||||
struct ViewportCameraSelectorWindow;
|
||||
|
||||
// holds a list of camera items
|
||||
struct CameraListModel
|
||||
: public QAbstractListModel
|
||||
, public CameraNotificationBus::Handler
|
||||
, public Maestro::EditorSequenceNotificationBus::Handler
|
||||
{
|
||||
public:
|
||||
CameraListModel(ViewportCameraSelectorWindow* myParent);
|
||||
CameraListModel(QWidget* myParent);
|
||||
~CameraListModel();
|
||||
|
||||
// QAbstractItemModel interface
|
||||
@@ -66,24 +53,18 @@ namespace Camera
|
||||
void OnCameraAdded(const AZ::EntityId& cameraId) override;
|
||||
void OnCameraRemoved(const AZ::EntityId& cameraId) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::EditorSequenceNotificationBus::Handler
|
||||
void OnSequenceSelected(const AZ::EntityId& sequenceEntityId) override;
|
||||
QModelIndex GetIndexForEntityId(const AZ::EntityId entityId);
|
||||
|
||||
private:
|
||||
AZStd::vector<CameraListItem> m_cameraItems;
|
||||
AZ::EntityId m_sequenceCameraEntityId;
|
||||
bool m_sequenceCameraSelected;
|
||||
ViewportCameraSelectorWindow* m_parent;
|
||||
};
|
||||
|
||||
struct ViewportCameraSelectorWindow
|
||||
: public QListView
|
||||
, public EditorCameraNotificationBus::Handler
|
||||
, public AzToolsFramework::EditorEntityContextNotificationBus::Handler
|
||||
, public Maestro::EditorSequenceNotificationBus::Handler
|
||||
, public Maestro::SequenceComponentNotificationBus::Handler
|
||||
{
|
||||
public:
|
||||
ViewportCameraSelectorWindow(QWidget* parent = nullptr);
|
||||
@@ -101,14 +82,6 @@ namespace Camera
|
||||
void OnStartPlayInEditor() override;
|
||||
void OnStopPlayInEditor() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::EditorSequenceNotificationBus::Handler
|
||||
void OnSequenceSelected(const AZ::EntityId& sequenceEntityId) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Maestro::SequenceComponentNotificationBus::Handler
|
||||
void OnCameraChanged(const AZ::EntityId& oldCameraEntityId, const AZ::EntityId& newCameraEntityId) override;
|
||||
|
||||
void mouseMoveEvent(QMouseEvent*) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
||||
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
|
||||
|
||||
Reference in New Issue
Block a user