1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #ifndef __MANN_TRANSITION_EDITOR_PAGE__H__
4 #define __MANN_TRANSITION_EDITOR_PAGE__H__
6 #include <ICryMannequin.h>
8 #include "MannequinEditorPage.h"
9 #include "../MannequinBase.h"
10 #include "../MannequinNodes.h"
11 #include "Controls/PropertiesPanel.h"
12 #include "../SequencerSplitter.h"
13 #include "Dialogs/ToolbarDialog.h"
14 #include "../MannKeyPropertiesDlgFE.h"
15 #include "../SequencerDopeSheetToolbar.h"
16 #include "QMfcApp/qmfcviewporthost.h"
18 #include "MannDopeSheet.h"
20 struct SMannequinContexts
;
21 class CMannequinModelViewport
;
22 class CSequencerSequence
;
23 class CFragmentSequencePlayback
;
25 class CTransitionEditorPage
: public CMannequinEditorPage
27 DECLARE_DYNAMIC(CTransitionEditorPage
)
30 CTransitionEditorPage(CWnd
* pParent
= NULL
);
31 ~CTransitionEditorPage();
33 enum { IDD
= IDD_MANN_TRANSITION_EDITOR_PAGE
};
35 virtual CMannequinModelViewport
* ModelViewport() const { return m_modelViewport
; }
36 virtual CMannDopeSheet
* TrackPanel() { return &m_wndTrackPanel
; }
37 virtual CMannNodesCtrl
* Nodes() { return &m_wndNodes
; }
38 CMannKeyPropertiesDlgFE
* KeyProperties() { return &m_wndKeyProperties
; }
40 CSequencerSequence
* Sequence() const { return m_sequence
.get(); }
41 SFragmentHistoryContext
* FragmentHistory() const { return m_fragmentHistory
.get(); }
43 void SaveLayout(const XmlNodeRef
& xmlLayout
);
44 void LoadLayout(const XmlNodeRef
& xmlLayout
);
46 virtual void ValidateToolbarButtonsState();
48 void PopulateAllClipTracks();
49 void InsertContextHistoryItems(const SScopeData
& scopeData
, const float keyTime
);
50 void SetUIFromHistory();
51 void SetHistoryFromUI();
52 void OnUpdateTV(bool forceUpdate
= false);
53 void OnSequenceRestart(float newTime
);
54 void InitialiseToPreviewFile(const XmlNodeRef
& xmlSequenceRoot
);
55 void SetTagState(const TagState
& tagState
);
57 void SetTime(float fTime
);
59 float GetMarkerTimeStart() const;
60 float GetMarkerTimeEnd() const;
62 void LoadSequence(const int scopeContextIdx
, const FragmentID fromID
, const FragmentID toID
, const SFragTagState fromFragTag
, const SFragTagState toFragTag
, const SFragmentBlendUid blendUid
);
66 virtual BOOL
OnInitDialog();
68 afx_msg
void OnGoToStart();
69 afx_msg
void OnGoToEnd();
70 afx_msg
void OnPlay();
71 afx_msg
void OnLoop();
72 afx_msg
void OnToggle1P();
73 afx_msg
void OnShowDebugOptions();
74 afx_msg
void OnToggleTimelineUnits();
75 afx_msg
void OnReloadAnimations();
76 afx_msg
void OnToggleLookat();
77 afx_msg
void OnClickRotateLocator();
78 afx_msg
void OnClickTranslateLocator();
79 afx_msg
void OnToggleShowSceneRoots();
80 afx_msg
void OnToggleAttachToEntity();
82 afx_msg
void OnToolbarDropDown(NMHDR
* pnhdr
, LRESULT
* plr
);
84 afx_msg
void OnUpdateGoToStart(CCmdUI
* pCmdUI
);
85 afx_msg
void OnUpdateGoToEnd(CCmdUI
* pCmdUI
);
86 afx_msg
void OnUpdatePlay(CCmdUI
* pCmdUI
);
87 afx_msg
void OnUpdateLoop(CCmdUI
* pCmdUI
);
89 afx_msg
void OnSetFocus(CWnd
* pOldWnd
);
93 void OnPlayMenu(CPoint pos
);
94 float PopulateClipTracks(CSequencerNode
* node
, const int scopeID
);
95 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
100 void PopulateTagList();
101 void SetTagStateOnCtrl(const SFragTagState
& tagState
);
102 SFragTagState
GetTagStateFromCtrl() const;
103 void OnInternalVariableChange(IVariable
* pVar
);
104 void ResetForcedBlend();
105 void SelectFirstKey();
107 CMannDopeSheet m_wndTrackPanel
;
108 CMannNodesCtrl m_wndNodes
;
109 CPropertiesPanel m_tagsPanel
;
110 CMannKeyPropertiesDlgFE m_wndKeyProperties
;
111 CSequencerSplitter m_wndSplitterTracks
;
112 CClampedSplitterWnd m_wndSplitterHorz
;
113 CClampedSplitterWnd m_wndSplitterVert
;
114 CSequencerDopeSheetToolbar m_cDlgToolBar
;
115 CMannequinModelViewport
* m_modelViewport
;
116 QMfcContainer m_viewportHost
;
117 QMfcViewportHost
* m_pViewportWidget
;
118 SMannequinContexts
* m_contexts
;
119 CFragmentSequencePlayback
* m_sequencePlayback
;
121 std::unique_ptr
<SFragmentHistoryContext
> m_contextHistory
;
122 std::unique_ptr
<SFragmentHistoryContext
> m_fragmentHistory
;
123 _smart_ptr
<CSequencerSequence
> m_sequence
;
132 bool m_bRestartingSequence
;
134 SLastChange m_lastChange
;
136 bool m_bRefreshingTagCtrl
;
137 TSmartPtr
<CVarBlock
> m_tagVars
;
138 CTagControl m_tagControls
;
140 SFragmentBlendUid m_forcedBlendUid
;
144 SFragTagState m_fromFragTag
;
145 SFragTagState m_toFragTag
;
146 ActionScopes m_scopeMaskFrom
;
147 ActionScopes m_scopeMaskTo
;
149 HACCEL m_hAccelerators
;