merge from main

This commit is contained in:
greerdv
2021-05-19 12:14:25 +01:00
11816 changed files with 189923 additions and 1002401 deletions
@@ -22,7 +22,7 @@
#include <AzCore/Name/Name.h>
#include <AzFramework/Entity/GameEntityContextBus.h>
#include <AzFramework/Scene/Scene.h>
#include <AzFramework/Scene/SceneSystemBus.h>
#include <AzFramework/Scene/SceneSystemInterface.h>
namespace TrackView
{
@@ -643,7 +643,7 @@ void CSequenceBatchRenderDialog::OnResolutionSelected()
CCustomResolutionDlg resDlg(defaultW, defaultH, this);
if (resDlg.exec() == QDialog::Accepted)
{
const int maxRes = GetIEditor()->GetRenderer()->GetMaxSquareRasterDimension();
const int maxRes = 8192;
m_customResW = min(resDlg.GetWidth(), maxRes);
m_customResH = min(resDlg.GetHeight(), maxRes);
const QString resText = QString(customResFormat).arg(m_customResW).arg(m_customResH);
@@ -807,18 +807,11 @@ void CTrackViewDialog::UpdateActions()
m_actions[ID_TRACKVIEW_MUTE_ALL]->setEnabled(true);
m_actions[ID_ADDSCENETRACK]->setEnabled(true);
AzToolsFramework::EntityIdList entityIds;
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
entityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
bool areAnyEntitiesSelected = false;
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
areAnyEntitiesSelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected);
if (entityIds.empty())
{
m_actions[ID_ADDNODE]->setEnabled(false);
}
else
{
m_actions[ID_ADDNODE]->setEnabled(true);
}
m_actions[ID_ADDNODE]->setEnabled(areAnyEntitiesSelected);
}
else
{
@@ -1512,12 +1505,6 @@ void CTrackViewDialog::OnEditorNotifyEvent(EEditorNotifyEvent event)
m_bIgnoreUpdates = false;
OnGameOrSimModeLock(false);
break;
case eNotify_OnMissionChange:
if (!m_bIgnoreUpdates)
{
ReloadSequences();
}
break;
case eNotify_OnReloadTrackView:
if (!m_bIgnoreUpdates)
{
@@ -1569,12 +1556,12 @@ void CTrackViewDialog::OnAddSelectedNode()
sequence->MarkAsModified();
}
AzToolsFramework::EntityIdList entityIds;
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
entityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
int selectedEntitiesCount = 0;
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount);
// check to make sure all nodes were added and notify user if they weren't
if (addedNodes.GetCount() != entityIds.size())
if (addedNodes.GetCount() != selectedEntitiesCount)
{
IMovieSystem* movieSystem = GetIEditor()->GetMovieSystem();
@@ -2734,9 +2734,6 @@ void CTrackViewDopeSheetBase::DrawKeys(CTrackViewTrack* pTrack, QPainter* painte
const int kDefaultWidthForDescription = 200;
const int kSmallMargin = 10;
FixedDynArray<float> drawnKeyTimes;
drawnKeyTimes.set(ArrayT((float*)alloca(numKeys * sizeof(float)), numKeys));
AZStd::vector<CTrackViewKeyHandle> sortedKeys;
sortedKeys.reserve(numKeys);
for (int i = 0; i < numKeys; ++i)
@@ -2751,11 +2748,6 @@ void CTrackViewDopeSheetBase::DrawKeys(CTrackViewTrack* pTrack, QPainter* painte
CTrackViewKeyHandle keyHandle = sortedKeys[i];
const float time = keyHandle.GetTime();
if (!stl::push_back_unique(drawnKeyTimes, time))
{
continue;
}
int x = TimeToClient(time);
if (x - kSmallMargin > rect.right())
{
@@ -28,4 +28,4 @@ protected:
signals:
void stepByFinished();
};
};
@@ -1,23 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#include "EditorDefs.h"
#if defined(USE_GEOM_CACHES)
#include "TrackViewGeomCacheAnimationTrack.h"
CTrackViewKeyHandle CTrackViewGeomCacheAnimationTrack::CreateKey(const float time)
{
return CTrackViewTrack::CreateKey(time);
}
#endif
@@ -1,37 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#ifndef CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWGEOMCACHEANIMATIONTRACK_H
#define CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWGEOMCACHEANIMATIONTRACK_H
#pragma once
#if defined(USE_GEOM_CACHES)
#include "IMovieSystem.h"
#include "TrackViewTrack.h"
////////////////////////////////////////////////////////////////////////////
// This class represents a time range track of a geom cache node in TrackView
////////////////////////////////////////////////////////////////////////////
class CTrackViewGeomCacheAnimationTrack
: public CTrackViewTrack
{
public:
CTrackViewGeomCacheAnimationTrack(IAnimTrack* pTrack, CTrackViewAnimNode* pTrackAnimNode,
CTrackViewNode* pParentNode, bool bIsSubTrack = false, unsigned int subTrackIndex = 0)
: CTrackViewTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex) {}
virtual CTrackViewKeyHandle CreateKey(const float time);
};
#endif
#endif // CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWGEOMCACHEANIMATIONTRACK_H
@@ -21,7 +21,6 @@
// Editor
#include "TrackViewEventNode.h"
#include "TrackViewGeomCacheAnimationTrack.h"
CTrackViewAnimNode* CTrackViewAnimNodeFactory::BuildAnimNode(IAnimSequence* pSequence, IAnimNode* pAnimNode, CTrackViewNode* pParentNode)
@@ -43,12 +42,5 @@ CTrackViewAnimNode* CTrackViewAnimNodeFactory::BuildAnimNode(IAnimSequence* pSeq
CTrackViewTrack* CTrackViewTrackFactory::BuildTrack(IAnimTrack* pTrack, CTrackViewAnimNode* pTrackAnimNode,
CTrackViewNode* pParentNode, bool bIsSubTrack, unsigned int subTrackIndex)
{
#if defined(USE_GEOM_CACHES)
if (pTrack->GetParameterType() == AnimParamType::TimeRanges && pTrackAnimNode->GetType() == AnimNodeType::GeomCache)
{
return new CTrackViewGeomCacheAnimationTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex);
}
#endif
return new CTrackViewTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex);
}
@@ -832,32 +832,7 @@ void CTrackViewNodesCtrl::UpdateAnimNodeRecord(CRecord* record, CTrackViewAnimNo
}
else if (nodeType == AnimNodeType::Material)
{
// Check if a valid material can be found by the node name.
_smart_ptr<IMaterial> pMaterial = nullptr;
QString matName;
int subMtlIndex = GetMatNameAndSubMtlIndexFromName(matName, animNode->GetName());
pMaterial = gEnv->p3DEngine->GetMaterialManager()->FindMaterial(matName.toUtf8().data());
if (pMaterial)
{
bool bMultiMat = pMaterial->GetSubMtlCount() > 0;
bool bMultiMatWithoutValidIndex = bMultiMat && (subMtlIndex < 0 || subMtlIndex >= pMaterial->GetSubMtlCount());
bool bLeafMatWithIndex = !bMultiMat && subMtlIndex != -1;
if (bMultiMatWithoutValidIndex || bLeafMatWithIndex)
{
pMaterial = nullptr;
}
}
if (!pMaterial)
{
record->setForeground(0, TextColorForInvalidMaterial);
}
else
{
// set to default color from palette
// materials that originally pointed to material groups and are changed to sub-materials need this to reset their color
record->setForeground(0, palette().color(foregroundRole()));
}
record->setForeground(0, TextColorForInvalidMaterial);
}
// Mark the active director and other directors properly.
@@ -1137,12 +1112,12 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
CTrackViewAnimNodeBundle addedNodes = groupNode->AddSelectedEntities(m_pTrackViewDialog->GetDefaultTracksForEntityNode());
undoBatch.MarkEntityDirty(groupNode->GetSequence()->GetSequenceComponentEntityId());
AzToolsFramework::EntityIdList entityIds;
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
entityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
int selectedEntitiesCount = 0;
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount);
// check to make sure all nodes were added and notify user if they weren't
if (addedNodes.GetCount() != entityIds.size())
if (addedNodes.GetCount() != selectedEntitiesCount)
{
IMovieSystem* movieSystem = GetIEditor()->GetMovieSystem();
@@ -2163,43 +2138,6 @@ int CTrackViewNodesCtrl::ShowPopupMenuSingleSelection(SContextMenu& contextMenu,
bAppended = true;
}
// Sub material menu
if (bOnNode && animNode->GetType() == AnimNodeType::Material)
{
QString matName;
int subMtlIndex = GetMatNameAndSubMtlIndexFromName(matName, animNode->GetName());
_smart_ptr<IMaterial> pMtl = gEnv->p3DEngine->GetMaterialManager()->FindMaterial(matName.toUtf8().data());
bool bMultMatNode = pMtl ? pMtl->GetSubMtlCount() > 0 : false;
bool bMatAppended = false;
if (bMultMatNode)
{
for (int k = 0; k < pMtl->GetSubMtlCount(); ++k)
{
_smart_ptr<IMaterial> pSubMaterial = pMtl->GetSubMtl(k);
if (pSubMaterial)
{
QString subMaterialName = pSubMaterial->GetName();
if (!subMaterialName.isEmpty())
{
AddMenuSeperatorConditional(contextMenu.main, bAppended);
QString subMatName = QString("[%1] %2").arg(k + 1).arg(subMaterialName);
QAction* a = contextMenu.main.addAction(subMatName);
a->setData(eMI_SelectSubmaterialBase + k);
a->setCheckable(true);
a->setChecked(k == subMtlIndex);
bMatAppended = true;
}
}
}
}
bAppended = bAppended || bMatAppended;
}
// Delete track menu
if (bOnTrackNotSub)
{
@@ -27,7 +27,6 @@
#include "AnimationContext.h"
#include "GameEngine.h"
#include "Include/IObjectManager.h"
#include "Material/MaterialManager.h"
#include "Objects/ObjectManager.h"
@@ -35,7 +34,6 @@
CTrackViewSequenceManager::CTrackViewSequenceManager()
{
GetIEditor()->RegisterNotifyListener(this);
GetIEditor()->GetMaterialManager()->AddListener(this);
AZ::EntitySystemBus::Handler::BusConnect();
}
@@ -45,7 +43,6 @@ CTrackViewSequenceManager::~CTrackViewSequenceManager()
{
AZ::EntitySystemBus::Handler::BusDisconnect();
GetIEditor()->GetMaterialManager()->RemoveListener(this);
GetIEditor()->UnregisterNotifyListener(this);
}