Merge branch 'development' into cmake/linux_fix_warn_unused

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-26 08:23:02 -07:00
66 changed files with 331 additions and 232 deletions
+1 -1
View File
@@ -628,7 +628,7 @@ void CAnimationContext::GoToFrameCmd(IConsoleCmdArgs* pArgs)
float targetFrame = (float)atof(pArgs->GetArg(1));
if (pSeq->GetTimeRange().start > targetFrame || targetFrame > pSeq->GetTimeRange().end)
{
gEnv->pLog->LogError("GoToFrame: requested time %f is outside the range of sequence %s (%f, %f)", targetFrame, pSeq->GetName(), pSeq->GetTimeRange().start, pSeq->GetTimeRange().end);
gEnv->pLog->LogError("GoToFrame: requested time %f is outside the range of sequence %s (%f, %f)", targetFrame, pSeq->GetName().c_str(), pSeq->GetTimeRange().start, pSeq->GetTimeRange().end);
return;
}
GetIEditor()->GetAnimation()->m_currTime = targetFrame;
@@ -5,6 +5,7 @@
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "EditorDefs.h"
#include "EditorPreferencesPageViewportMovement.h"
@@ -12,44 +13,96 @@
#include <AzQtComponents/Components/StyleManager.h>
// Editor
#include "Settings.h"
#include "EditorViewportSettings.h"
#include "Settings.h"
void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& serialize)
{
serialize.Class<CameraMovementSettings>()
->Version(1)
->Field("MoveSpeed", &CameraMovementSettings::m_moveSpeed)
->Version(2)
->Field("TranslateSpeed", &CameraMovementSettings::m_translateSpeed)
->Field("RotateSpeed", &CameraMovementSettings::m_rotateSpeed)
->Field("FastMoveSpeed", &CameraMovementSettings::m_fastMoveSpeed)
->Field("WheelZoomSpeed", &CameraMovementSettings::m_wheelZoomSpeed)
->Field("InvertYAxis", &CameraMovementSettings::m_invertYRotation)
->Field("InvertPan", &CameraMovementSettings::m_invertPan);
->Field("BoostMultiplier", &CameraMovementSettings::m_boostMultiplier)
->Field("ScrollSpeed", &CameraMovementSettings::m_scrollSpeed)
->Field("DollySpeed", &CameraMovementSettings::m_dollySpeed)
->Field("PanSpeed", &CameraMovementSettings::m_panSpeed)
->Field("RotateSmoothing", &CameraMovementSettings::m_rotateSmoothing)
->Field("RotateSmoothness", &CameraMovementSettings::m_rotateSmoothness)
->Field("TranslateSmoothing", &CameraMovementSettings::m_translateSmoothing)
->Field("TranslateSmoothness", &CameraMovementSettings::m_translateSmoothness)
->Field("CaptureCursorLook", &CameraMovementSettings::m_captureCursorLook)
->Field("OrbitYawRotationInverted", &CameraMovementSettings::m_orbitYawRotationInverted)
->Field("PanInvertedX", &CameraMovementSettings::m_panInvertedX)
->Field("PanInvertedY", &CameraMovementSettings::m_panInvertedY);
serialize.Class<CEditorPreferencesPage_ViewportMovement>()
->Version(1)
->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings);
serialize.Class<CEditorPreferencesPage_ViewportMovement>()->Version(1)->Field(
"CameraMovementSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings);
AZ::EditContext* editContext = serialize.GetEditContext();
if (editContext)
if (AZ::EditContext* editContext = serialize.GetEditContext())
{
editContext->Class<CameraMovementSettings>("Camera Movement Settings", "")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_moveSpeed, "Camera Movement Speed", "Camera Movement Speed")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSpeed, "Camera Rotation Speed", "Camera Rotation Speed")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_fastMoveSpeed, "Fast Movement Scale", "Fast Movement Scale (holding shift")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_wheelZoomSpeed, "Wheel Zoom Speed", "Wheel Zoom Speed")
->DataElement(AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_invertYRotation, "Invert Y Axis", "Invert Y Rotation (holding RMB)")
->DataElement(AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_invertPan, "Invert Pan", "Invert Pan (holding MMB)");
editContext->Class<CameraMovementSettings>("Camera Settings", "")
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_translateSpeed, "Camera Movement Speed", "Camera movement speed")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSpeed, "Camera Rotation Speed", "Camera rotation speed")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_boostMultiplier, "Camera Boost Multiplier",
"Camera boost multiplier to apply to movement speed")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_scrollSpeed, "Camera Scroll Speed",
"Camera movement speed while using scroll/wheel input")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_dollySpeed, "Camera Dolly Speed",
"Camera movement speed while using mouse motion to move in and out")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_panSpeed, "Camera Pan Speed",
"Camera movement speed while panning using the mouse")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_rotateSmoothing, "Camera Rotate Smoothing",
"Is camera rotation smoothing enabled or disabled")
->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSmoothness, "Camera Rotate Smoothness",
"Amount of camera smoothing to apply while rotating the camera")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Visibility, &CameraMovementSettings::RotateSmoothingVisibility)
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_translateSmoothing, "Camera Translate Smoothing",
"Is camera translation smoothing enabled or disabled")
->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_translateSmoothness, "Camera Translate Smoothness",
"Amount of camera smoothing to apply while translating the camera")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Visibility, &CameraMovementSettings::TranslateSmoothingVisibility)
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_orbitYawRotationInverted, "Camera Orbit Yaw Inverted",
"Inverted yaw rotation while orbiting")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_panInvertedX, "Invert Pan X",
"Invert direction of pan in local X axis")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_panInvertedY, "Invert Pan Y",
"Invert direction of pan in local Y axis")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_captureCursorLook, "Camera Capture Look Cursor",
"Should the cursor be captured (hidden) while performing free look");
editContext->Class<CEditorPreferencesPage_ViewportMovement>("Gizmo Movement Preferences", "Gizmo Movement Preferences")
editContext->Class<CEditorPreferencesPage_ViewportMovement>("Viewport Preferences", "Viewport Preferences")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings, "Camera Movement Settings", "Camera Movement Settings");
->DataElement(
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings,
"Camera Movement Settings", "Camera Movement Settings");
}
}
CEditorPreferencesPage_ViewportMovement::CEditorPreferencesPage_ViewportMovement()
{
InitializeSettings();
@@ -68,21 +121,36 @@ QIcon& CEditorPreferencesPage_ViewportMovement::GetIcon()
void CEditorPreferencesPage_ViewportMovement::OnApply()
{
SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_moveSpeed);
SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_translateSpeed);
SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed);
SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_fastMoveSpeed);
SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_wheelZoomSpeed);
SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_invertYRotation);
SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_invertPan);
SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_invertPan);
SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_boostMultiplier);
SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_scrollSpeed);
SandboxEditor::SetCameraDollyMotionSpeed(m_cameraMovementSettings.m_dollySpeed);
SandboxEditor::SetCameraPanSpeed(m_cameraMovementSettings.m_panSpeed);
SandboxEditor::SetCameraRotateSmoothness(m_cameraMovementSettings.m_rotateSmoothness);
SandboxEditor::SetCameraRotateSmoothingEnabled(m_cameraMovementSettings.m_rotateSmoothing);
SandboxEditor::SetCameraTranslateSmoothness(m_cameraMovementSettings.m_translateSmoothness);
SandboxEditor::SetCameraTranslateSmoothingEnabled(m_cameraMovementSettings.m_translateSmoothing);
SandboxEditor::SetCameraCaptureCursorForLook(m_cameraMovementSettings.m_captureCursorLook);
SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_orbitYawRotationInverted);
SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_panInvertedX);
SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_panInvertedY);
}
void CEditorPreferencesPage_ViewportMovement::InitializeSettings()
{
m_cameraMovementSettings.m_moveSpeed = SandboxEditor::CameraTranslateSpeed();
m_cameraMovementSettings.m_translateSpeed = SandboxEditor::CameraTranslateSpeed();
m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed();
m_cameraMovementSettings.m_fastMoveSpeed = SandboxEditor::CameraBoostMultiplier();
m_cameraMovementSettings.m_wheelZoomSpeed = SandboxEditor::CameraScrollSpeed();
m_cameraMovementSettings.m_invertYRotation = SandboxEditor::CameraOrbitYawRotationInverted();
m_cameraMovementSettings.m_invertPan = SandboxEditor::CameraPanInvertedX() && SandboxEditor::CameraPanInvertedY();
m_cameraMovementSettings.m_boostMultiplier = SandboxEditor::CameraBoostMultiplier();
m_cameraMovementSettings.m_scrollSpeed = SandboxEditor::CameraScrollSpeed();
m_cameraMovementSettings.m_dollySpeed = SandboxEditor::CameraDollyMotionSpeed();
m_cameraMovementSettings.m_panSpeed = SandboxEditor::CameraPanSpeed();
m_cameraMovementSettings.m_rotateSmoothness = SandboxEditor::CameraRotateSmoothness();
m_cameraMovementSettings.m_rotateSmoothing = SandboxEditor::CameraRotateSmoothingEnabled();
m_cameraMovementSettings.m_translateSmoothness = SandboxEditor::CameraTranslateSmoothness();
m_cameraMovementSettings.m_translateSmoothing = SandboxEditor::CameraTranslateSmoothingEnabled();
m_cameraMovementSettings.m_captureCursorLook = SandboxEditor::CameraCaptureCursorForLook();
m_cameraMovementSettings.m_orbitYawRotationInverted = SandboxEditor::CameraOrbitYawRotationInverted();
m_cameraMovementSettings.m_panInvertedX = SandboxEditor::CameraPanInvertedX();
m_cameraMovementSettings.m_panInvertedY = SandboxEditor::CameraPanInvertedY();
}
@@ -5,17 +5,21 @@
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include "Include/IPreferencesPage.h"
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/RTTI/RTTI.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <QIcon>
inline AZ::Crc32 EditorPropertyVisibility(const bool enabled)
{
return enabled ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide;
}
class CEditorPreferencesPage_ViewportMovement
: public IPreferencesPage
class CEditorPreferencesPage_ViewportMovement : public IPreferencesPage
{
public:
AZ_RTTI(CEditorPreferencesPage_ViewportMovement, "{BC593332-7EAF-4171-8A35-1C5DE5B40909}", IPreferencesPage)
@@ -25,12 +29,22 @@ public:
CEditorPreferencesPage_ViewportMovement();
virtual ~CEditorPreferencesPage_ViewportMovement() = default;
virtual const char* GetCategory() override { return "Viewports"; }
virtual const char* GetCategory() override
{
return "Viewports";
}
virtual const char* GetTitle();
virtual QIcon& GetIcon() override;
virtual void OnApply() override;
virtual void OnCancel() override {}
virtual bool OnQueryCancel() override { return true; }
virtual void OnCancel() override
{
}
virtual bool OnQueryCancel() override
{
return true;
}
private:
void InitializeSettings();
@@ -39,16 +53,32 @@ private:
{
AZ_TYPE_INFO(CameraMovementSettings, "{60B8C07E-5F48-4171-A50B-F45558B5CCA1}")
float m_moveSpeed;
float m_translateSpeed;
float m_rotateSpeed;
float m_fastMoveSpeed;
float m_wheelZoomSpeed;
bool m_invertYRotation;
bool m_invertPan;
float m_scrollSpeed;
float m_dollySpeed;
float m_panSpeed;
float m_boostMultiplier;
float m_rotateSmoothness;
bool m_rotateSmoothing;
float m_translateSmoothness;
bool m_translateSmoothing;
bool m_captureCursorLook;
bool m_orbitYawRotationInverted;
bool m_panInvertedX;
bool m_panInvertedY;
AZ::Crc32 RotateSmoothingVisibility() const
{
return EditorPropertyVisibility(m_rotateSmoothing);
}
AZ::Crc32 TranslateSmoothingVisibility() const
{
return EditorPropertyVisibility(m_translateSmoothing);
}
};
CameraMovementSettings m_cameraMovementSettings;
QIcon m_icon;
};
+7 -7
View File
@@ -622,7 +622,7 @@ bool CExportManager::ShowFBXExportDialog()
if (pivotObjectNode && !pivotObjectNode->IsGroupNode())
{
m_pivotEntityObject = static_cast<CEntityObject*>(GetIEditor()->GetObjectManager()->FindObject(pivotObjectNode->GetName()));
m_pivotEntityObject = static_cast<CEntityObject*>(GetIEditor()->GetObjectManager()->FindObject(pivotObjectNode->GetName().c_str()));
if (m_pivotEntityObject)
{
@@ -807,7 +807,7 @@ void CExportManager::FillAnimTimeNode(XmlNodeRef writeNode, CTrackViewAnimNode*
if (numAllTracks > 0)
{
XmlNodeRef objNode = writeNode->createNode(CleanXMLText(pObjectNode->GetName()).toUtf8().data());
XmlNodeRef objNode = writeNode->createNode(CleanXMLText(pObjectNode->GetName().c_str()).toUtf8().data());
writeNode->setAttr("time", m_animTimeExportPrimarySequenceCurrentTime);
for (unsigned int trackID = 0; trackID < numAllTracks; ++trackID)
@@ -818,7 +818,7 @@ void CExportManager::FillAnimTimeNode(XmlNodeRef writeNode, CTrackViewAnimNode*
if (trackType == AnimParamType::Animation || trackType == AnimParamType::Sound)
{
QString childName = CleanXMLText(childTrack->GetName());
QString childName = CleanXMLText(childTrack->GetName().c_str());
if (childName.isEmpty())
{
@@ -976,7 +976,7 @@ bool CExportManager::AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNo
else
{
// In case of exporting animation/sound times data
const QString sequenceName = pSubSequence->GetName();
const QString sequenceName = QString::fromUtf8(pSubSequence->GetName().c_str());
XmlNodeRef subSeqNode2 = seqNode->createNode(sequenceName.toUtf8().data());
if (sequenceName == m_animTimeExportPrimarySequenceName)
@@ -1253,14 +1253,14 @@ void CExportManager::SaveNodeKeysTimeToXML()
m_soundKeyTimeExport = exportDialog.IsSoundExportChecked();
QString filters = "All files (*.xml)";
QString defaultName = QString(pSequence->GetName()) + ".xml";
QString defaultName = QString::fromUtf8(pSequence->GetName().c_str()) + ".xml";
QtUtil::QtMFCScopedHWNDCapture cap;
CAutoDirectoryRestoreFileDialog dlg(QFileDialog::AcceptSave, QFileDialog::AnyFile, "xml", defaultName, filters, {}, {}, cap);
if (dlg.exec())
{
m_animTimeNode = XmlHelpers::CreateXmlNode(pSequence->GetName());
m_animTimeExportPrimarySequenceName = pSequence->GetName();
m_animTimeNode = XmlHelpers::CreateXmlNode(pSequence->GetName().c_str());
m_animTimeExportPrimarySequenceName = QString::fromUtf8(pSequence->GetName().c_str());
m_data.Clear();
m_animTimeExportPrimarySequenceCurrentTime = 0.0;
+2 -2
View File
@@ -53,7 +53,7 @@ CTVSequenceProps::~CTVSequenceProps()
// CTVSequenceProps message handlers
bool CTVSequenceProps::OnInitDialog()
{
ui->NAME->setText(m_pSequence->GetName());
ui->NAME->setText(m_pSequence->GetName().c_str());
int seqFlags = m_pSequence->GetFlags();
ui->ALWAYS_PLAY->setChecked((seqFlags & IAnimSequence::eSeqFlags_PlayOnReset));
@@ -141,7 +141,7 @@ void CTVSequenceProps::UpdateSequenceProps(const QString& name)
ac->UpdateTimeRange();
}
QString seqName = m_pSequence->GetName();
QString seqName = QString::fromUtf8(m_pSequence->GetName().c_str());
if (name != seqName)
{
// Rename sequence.
+9 -10
View File
@@ -423,7 +423,7 @@ CTrackViewAnimNode* CTrackViewAnimNode::CreateSubNode(
AZStd::string::format(
"Failed to add '%s' to sequence '%s', could not find associated entity. "
"Please try adding the entity associated with '%s'.",
originalNameStr.constData(), director->GetName(), originalNameStr.constData()));
originalNameStr.constData(), director->GetName().c_str(), originalNameStr.constData()));
return nullptr;
}
@@ -472,7 +472,7 @@ CTrackViewAnimNode* CTrackViewAnimNode::CreateSubNode(
{
GetIEditor()->GetMovieSystem()->LogUserNotificationMsg(
AZStd::string::format("'%s' already exists in sequence '%s', skipping...",
originalNameStr.constData(), director2->GetName()));
originalNameStr.constData(), director2->GetName().c_str()));
return nullptr;
}
@@ -488,7 +488,7 @@ CTrackViewAnimNode* CTrackViewAnimNode::CreateSubNode(
if (!newAnimNode)
{
GetIEditor()->GetMovieSystem()->LogUserNotificationMsg(
AZStd::string::format("Failed to add '%s' to sequence '%s'.", nameStr.constData(), director->GetName()));
AZStd::string::format("Failed to add '%s' to sequence '%s'.", nameStr.constData(), director->GetName().c_str()));
return nullptr;
}
@@ -1195,7 +1195,7 @@ CTrackViewAnimNodeBundle CTrackViewAnimNode::GetAnimNodesByName(const char* pNam
{
CTrackViewAnimNodeBundle bundle;
QString nodeName = GetName();
QString nodeName = QString::fromUtf8(GetName().c_str());
if (GetNodeType() == eTVNT_AnimNode && QString::compare(pName, nodeName, Qt::CaseInsensitive) == 0)
{
bundle.AppendAnimNode(this);
@@ -1215,10 +1215,9 @@ CTrackViewAnimNodeBundle CTrackViewAnimNode::GetAnimNodesByName(const char* pNam
}
//////////////////////////////////////////////////////////////////////////
const char* CTrackViewAnimNode::GetParamName(const CAnimParamType& paramType) const
AZStd::string CTrackViewAnimNode::GetParamName(const CAnimParamType& paramType) const
{
const char* pName = m_animNode->GetParamName(paramType);
return pName ? pName : "";
return m_animNode->GetParamName(paramType);
}
//////////////////////////////////////////////////////////////////////////
@@ -1274,7 +1273,7 @@ CTrackViewAnimNodeBundle CTrackViewAnimNode::AddSelectedEntities(const AZStd::ve
if (existingNode->GetDirector() == GetDirector())
{
GetIEditor()->GetMovieSystem()->LogUserNotificationMsg(AZStd::string::format(
"'%s' was already added to '%s', skipping...", entity->GetName().c_str(), GetDirector()->GetName()));
"'%s' was already added to '%s', skipping...", entity->GetName().c_str(), GetDirector()->GetName().c_str()));
continue;
}
@@ -1377,7 +1376,7 @@ void CTrackViewAnimNode::UpdateDynamicParams()
void CTrackViewAnimNode::CopyKeysToClipboard(XmlNodeRef& xmlNode, const bool bOnlySelectedKeys, const bool bOnlyFromSelectedTracks)
{
XmlNodeRef childNode = xmlNode->createNode("Node");
childNode->setAttr("name", GetName());
childNode->setAttr("name", GetName().c_str());
childNode->setAttr("type", static_cast<int>(GetType()));
for (auto iter = m_childNodes.begin(); iter != m_childNodes.end(); ++iter)
@@ -1683,7 +1682,7 @@ bool CTrackViewAnimNode::IsValidReparentingTo(CTrackViewAnimNode* pNewParent)
}
// Check if the new parent already contains a node with this name
CTrackViewAnimNodeBundle foundNodes = pNewParent->GetAnimNodesByName(GetName());
CTrackViewAnimNodeBundle foundNodes = pNewParent->GetAnimNodesByName(GetName().c_str());
if (foundNodes.GetCount() > 1 || (foundNodes.GetCount() == 1 && foundNodes.GetNode(0) != this))
{
return false;
+2 -2
View File
@@ -124,7 +124,7 @@ public:
virtual void SetAsViewCamera();
// Name setter/getter
virtual const char* GetName() const override { return m_animNode->GetName(); }
AZStd::string GetName() const override { return m_animNode->GetName(); }
virtual bool SetName(const char* pName) override;
virtual bool CanBeRenamed() const override;
@@ -187,7 +187,7 @@ public:
// Param
unsigned int GetParamCount() const;
CAnimParamType GetParamType(unsigned int index) const;
const char* GetParamName(const CAnimParamType& paramType) const;
AZStd::string GetParamName(const CAnimParamType& paramType) const;
bool IsParamValid(const CAnimParamType& param) const;
IAnimNode::ESupportedParamFlags GetParamFlags(const CAnimParamType& paramType) const;
AnimValueType GetParamValueType(const CAnimParamType& paramType) const;
+3 -3
View File
@@ -1122,7 +1122,7 @@ void CTrackViewDialog::ReloadSequencesComboBox()
{
CTrackViewSequence* sequence = pSequenceManager->GetSequenceByIndex(k);
QString entityIdString = GetEntityIdAsString(sequence->GetSequenceComponentEntityId());
m_sequencesComboBox->addItem(sequence->GetName(), entityIdString);
m_sequencesComboBox->addItem(QString::fromUtf8(sequence->GetName().c_str()), entityIdString);
}
}
@@ -2030,7 +2030,7 @@ void CTrackViewDialog::UpdateTracksToolBar()
continue;
}
name = pAnimNode->GetParamName(paramType);
name = QString::fromUtf8(pAnimNode->GetParamName(paramType).c_str());
QString sToolTipText("Add " + name + " Track");
QIcon hIcon = m_wndNodesCtrl->GetIconForTrack(pTrack);
@@ -2306,7 +2306,7 @@ void CTrackViewDialog::SaveCurrentSequenceToFBX()
return;
}
QString selectedSequenceFBXStr = QString(sequence->GetName()) + ".fbx";
QString selectedSequenceFBXStr = QString::fromUtf8(sequence->GetName().c_str()) + ".fbx";
CExportManager* pExportManager = static_cast<CExportManager*>(GetIEditor()->GetExportManager());
const char szFilters[] = "FBX Files (*.fbx)";
@@ -3446,7 +3446,7 @@ void CTrackViewDopeSheetBase::DrawNodeTrack(CTrackViewAnimNode* animNode, QPaint
const QRect textRect = trackRect.adjusted(4, 0, -4, 0);
QString sAnimNodeName = animNode->GetName();
QString sAnimNodeName = QString::fromUtf8(animNode->GetName().c_str());
const bool hasObsoleteTrack = animNode->HasObsoleteTrack();
if (hasObsoleteTrack)
+2 -2
View File
@@ -622,7 +622,7 @@ bool CTrackViewNode::operator<(const CTrackViewNode& otherNode) const
if (thisTypeOrder == otherTypeOrder)
{
// Same node type, sort by name
return azstricmp(thisAnimNode.GetName(), otherAnimNode.GetName()) < 0;
return thisAnimNode.GetName() < otherAnimNode.GetName();
}
return thisTypeOrder < otherTypeOrder;
@@ -634,7 +634,7 @@ bool CTrackViewNode::operator<(const CTrackViewNode& otherNode) const
if (thisTrack.GetParameterType() == otherTrack.GetParameterType())
{
// Same parameter type, sort by name
return azstricmp(thisTrack.GetName(), otherTrack.GetName()) < 0;
return thisTrack.GetName() < otherTrack.GetName();
}
return thisTrack.GetParameterType() < otherTrack.GetParameterType();
+1 -1
View File
@@ -156,7 +156,7 @@ public:
virtual ~CTrackViewNode() {}
// Name
virtual const char* GetName() const = 0;
virtual AZStd::string GetName() const = 0;
virtual bool SetName([[maybe_unused]] const char* pName) { return false; };
virtual bool CanBeRenamed() const { return false; }
+21 -22
View File
@@ -616,7 +616,7 @@ CTrackViewNodesCtrl::CRecord* CTrackViewNodesCtrl::AddAnimNodeRecord(CRecord* pP
{
CRecord* pNewRecord = new CRecord(animNode);
pNewRecord->setText(0, animNode->GetName());
pNewRecord->setText(0, QString::fromUtf8(animNode->GetName().c_str()));
UpdateAnimNodeRecord(pNewRecord, animNode);
pParentRecord->insertChild(GetInsertPosition(pParentRecord, animNode), pNewRecord);
FillNodesRec(pNewRecord, animNode);
@@ -629,7 +629,7 @@ CTrackViewNodesCtrl::CRecord* CTrackViewNodesCtrl::AddTrackRecord(CRecord* pPare
{
CRecord* pNewTrackRecord = new CRecord(pTrack);
pNewTrackRecord->setSizeHint(0, QSize(30, 18));
pNewTrackRecord->setText(0, pTrack->GetName());
pNewTrackRecord->setText(0, QString::fromUtf8(pTrack->GetName().c_str()));
UpdateTrackRecord(pNewTrackRecord, pTrack);
pParentRecord->insertChild(GetInsertPosition(pParentRecord, pTrack), pNewTrackRecord);
FillNodesRec(pNewTrackRecord, pTrack);
@@ -860,7 +860,7 @@ void CTrackViewNodesCtrl::OnFillItems()
m_nodeToRecordMap.clear();
CRecord* pRootGroupRec = new CRecord(sequence);
pRootGroupRec->setText(0, sequence->GetName());
pRootGroupRec->setText(0, QString::fromUtf8(sequence->GetName().c_str()));
QFont f = font();
f.setBold(true);
pRootGroupRec->setData(0, Qt::FontRole, f);
@@ -1032,8 +1032,8 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
return;
}
QString file = QString(sequence2->GetName()) + QString(".fbx");
QString selectedSequenceFBXStr = QString(sequence2->GetName()) + ".fbx";
QString file = QString::fromUtf8(sequence2->GetName().c_str()) + QString(".fbx");
QString selectedSequenceFBXStr = QString::fromUtf8(sequence2->GetName().c_str()) + ".fbx";
if (numSelectedNodes > 1)
{
@@ -1041,7 +1041,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
}
else
{
file = QString(selectedNodes.GetNode(0)->GetName()) + QString(".fbx");
file = QString::fromUtf8(selectedNodes.GetNode(0)->GetName().c_str()) + QString(".fbx");
}
QString path = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)"));
@@ -1338,7 +1338,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
if (animNode || groupNode)
{
CTrackViewAnimNode* animNode2 = static_cast<CTrackViewAnimNode*>(pNode);
QString oldName = animNode2->GetName();
QString oldName = QString::fromUtf8(animNode2->GetName().c_str());
StringDlg dlg(tr("Rename Node"));
dlg.SetString(oldName);
@@ -1494,7 +1494,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
if (animNode)
{
QString matName;
GetMatNameAndSubMtlIndexFromName(matName, animNode->GetName());
GetMatNameAndSubMtlIndexFromName(matName, animNode->GetName().c_str());
QString newMatName;
newMatName = tr("%1.[%2]").arg(matName).arg(cmd - eMI_SelectSubmaterialBase + 1);
CUndo undo("Rename TrackView node");
@@ -1576,7 +1576,7 @@ CTrackViewTrack* CTrackViewNodesCtrl::GetTrackViewTrack(const Export::EntityAnim
for (unsigned int trackID = 0; trackID < trackBundle.GetCount(); ++trackID)
{
CTrackViewTrack* pTrack = trackBundle.GetTrack(trackID);
const QString bundleTrackName = pTrack->GetAnimNode()->GetName();
const QString bundleTrackName = QString::fromUtf8(pTrack->GetAnimNode()->GetName().c_str());
if (bundleTrackName.compare(nodeName, Qt::CaseInsensitive) != 0)
{
@@ -2164,7 +2164,7 @@ int CTrackViewNodesCtrl::ShowPopupMenuSingleSelection(SContextMenu& contextMenu,
if (bOnNode && !pNode->IsGroupNode())
{
AddMenuSeperatorConditional(contextMenu.main, bAppended);
QString string = QString("%1 Tracks").arg(animNode->GetName());
QString string = QString("%1 Tracks").arg(animNode->GetName().c_str());
contextMenu.main.addAction(string)->setEnabled(false);
bool bAppendedTrackFlag = false;
@@ -2182,7 +2182,7 @@ int CTrackViewNodesCtrl::ShowPopupMenuSingleSelection(SContextMenu& contextMenu,
continue;
}
QAction* a = contextMenu.main.addAction(QString(" %1").arg(pTrack2->GetName()));
QAction* a = contextMenu.main.addAction(QString(" %1").arg(pTrack2->GetName().c_str()));
a->setData(eMI_ShowHideBase + childIndex);
a->setCheckable(true);
a->setChecked(!pTrack2->IsHidden());
@@ -2348,13 +2348,12 @@ bool CTrackViewNodesCtrl::FillAddTrackMenu(STrackMenuTreeNode& menuAddTrack, con
continue;
}
}
name = animNode->GetParamName(paramType);
QStringList splittedName = name.split("/", Qt::SkipEmptyParts);
name = QString::fromUtf8(animNode->GetParamName(paramType).c_str());
QStringList splitName = name.split("/", Qt::SkipEmptyParts);
STrackMenuTreeNode* pCurrentNode = &menuAddTrack;
for (int j = 0; j < splittedName.size() - 1; ++j)
for (const QString& segment : splitName)
{
const QString& segment = splittedName[j];
auto findIter = pCurrentNode->children.find(segment);
if (findIter != pCurrentNode->children.end())
{
@@ -2370,10 +2369,10 @@ bool CTrackViewNodesCtrl::FillAddTrackMenu(STrackMenuTreeNode& menuAddTrack, con
// only add tracks to the that STrackMenuTreeNode tree that haven't already been added
CTrackViewTrackBundle matchedTracks = animNode->GetTracksByParam(paramType);
if (matchedTracks.GetCount() == 0)
if (matchedTracks.GetCount() == 0 && !splitName.isEmpty())
{
STrackMenuTreeNode* pParamNode = new STrackMenuTreeNode;
pCurrentNode->children[splittedName.back()] = std::unique_ptr<STrackMenuTreeNode>(pParamNode);
pCurrentNode->children[splitName.back()] = std::unique_ptr<STrackMenuTreeNode>(pParamNode);
pParamNode->paramType = paramType;
bTracksToAdd = true;
@@ -2464,7 +2463,7 @@ void CTrackViewNodesCtrl::FillAutoCompletionListForFilter()
for (unsigned int i = 0; i < animNodeCount; ++i)
{
strings << animNodes.GetNode(i)->GetName();
strings << QString::fromUtf8(animNodes.GetNode(i)->GetName().c_str());
}
}
else
@@ -2580,10 +2579,10 @@ void CTrackViewNodesCtrl::Update()
{
const CTrackViewAnimNode* track = static_cast<const CTrackViewAnimNode*>(node);
if (track)
{
record->setText(0, track->GetName());
{
record->setText(0, QString::fromUtf8(track->GetName().c_str()));
}
}
}
}
}
}
@@ -2855,7 +2854,7 @@ void CTrackViewNodesCtrl::OnNodeRenamed(CTrackViewNode* pNode, [[maybe_unused]]
if (!m_bIgnoreNotifications)
{
CRecord* pNodeRecord = GetNodeRecord(pNode);
pNodeRecord->setText(0, pNode->GetName());
pNodeRecord->setText(0, QString::fromUtf8(pNode->GetName().c_str()));
update();
}
+1 -1
View File
@@ -66,7 +66,7 @@ public:
CRecord(CTrackViewNode* pNode = nullptr);
CTrackViewNode* GetNode() const { return m_pNode; }
bool IsGroup() const { return m_pNode->GetChildCount() != 0; }
const QString GetName() const { return m_pNode->GetName(); }
const QString GetName() const { return QString::fromUtf8(m_pNode->GetName().c_str()); }
// Workaround: CXTPReportRecord::IsVisible is
// unreliable after the last visible element
@@ -293,8 +293,8 @@ namespace
CTrackViewTrack* pTrack = pNode->GetTrackForParameter(paramType);
if (!pTrack || (paramFlags & IAnimNode::eSupportedParamFlags_MultipleTracks))
{
const char* name = pNode->GetParamName(paramType);
if (_stricmp(name, paramName) == 0)
AZStd::string name = pNode->GetParamName(paramType);
if (name == paramName)
{
CUndo undo("Create track");
if (!pNode->CreateTrack(paramType))
+3 -3
View File
@@ -892,14 +892,14 @@ bool CTrackViewSequence::SetName(const char* name)
return false;
}
const char* oldName = GetName();
if (0 != strcmp(name, oldName))
AZStd::string oldName = GetName();
if (name != oldName)
{
m_pAnimSequence->SetName(name);
MarkAsModified();
AzToolsFramework::ScopedUndoBatch undoBatch("Rename Sequence");
GetSequence()->OnNodeRenamed(this, oldName);
GetSequence()->OnNodeRenamed(this, oldName.c_str());
undoBatch.MarkEntityDirty(m_pAnimSequence->GetSequenceEntityId());
}
+1 -1
View File
@@ -102,7 +102,7 @@ public:
// ITrackViewNode
virtual ETrackViewNodeType GetNodeType() const override { return eTVNT_Sequence; }
virtual const char* GetName() const override { return m_pAnimSequence->GetName(); }
virtual AZStd::string GetName() const override { return m_pAnimSequence->GetName(); }
virtual bool SetName(const char* pName) override;
virtual bool CanBeRenamed() const override { return true; }
@@ -75,7 +75,7 @@ CTrackViewSequence* CTrackViewSequenceManager::GetSequenceByName(QString name) c
{
CTrackViewSequence* sequence = (*iter).get();
if (sequence->GetName() == name)
if (QString::fromUtf8(sequence->GetName().c_str()) == name)
{
return sequence;
}
@@ -371,8 +371,8 @@ void CTrackViewSequenceManager::SortSequences()
std::stable_sort(m_sequences.begin(), m_sequences.end(),
[](const std::unique_ptr<CTrackViewSequence>& a, const std::unique_ptr<CTrackViewSequence>& b) -> bool
{
QString aName = a.get()->GetName();
QString bName = b.get()->GetName();
QString aName = QString::fromUtf8(a.get()->GetName().c_str());
QString bName = QString::fromUtf8(b.get()->GetName().c_str());
return aName < bName;
});
}
+2 -2
View File
@@ -472,7 +472,7 @@ void CTrackViewTrack::RestoreFromMemento(const CTrackViewTrackMemento& memento)
}
//////////////////////////////////////////////////////////////////////////
const char* CTrackViewTrack::GetName() const
AZStd::string CTrackViewTrack::GetName() const
{
CTrackViewNode* pParentNode = GetParentNode();
@@ -810,7 +810,7 @@ void CTrackViewTrack::CopyKeysToClipboard(XmlNodeRef& xmlNode, const bool bOnlyS
}
XmlNodeRef childNode = xmlNode->newChild("Track");
childNode->setAttr("name", GetName());
childNode->setAttr("name", GetName().c_str());
GetParameterType().SaveToXml(childNode);
childNode->setAttr("valueType", static_cast<int>(GetValueType()));
+1 -1
View File
@@ -80,7 +80,7 @@ public:
CTrackViewAnimNode* GetAnimNode() const;
// Name getter
virtual const char* GetName() const;
AZStd::string GetName() const override;
// CTrackViewNode
virtual ETrackViewNodeType GetNodeType() const override { return eTVNT_Track; }
+1 -1
View File
@@ -75,7 +75,7 @@ CTrackViewTrack* CUndoComponentEntityTrackObject::FindTrack(CTrackViewSequence*
CTrackViewTrack* curTrack = allTracks.GetTrack(trackIndex);
if (curTrack->GetAnimNode() && curTrack->GetAnimNode()->GetComponentId() == m_trackComponentId)
{
if (0 == azstricmp(curTrack->GetName(), m_trackName.c_str()))
if (curTrack->GetName() == m_trackName)
{
CTrackViewAnimNode* parentAnimNode = static_cast<CTrackViewAnimNode*>(curTrack->GetAnimNode()->GetParentNode());
if (parentAnimNode && parentAnimNode->GetAzEntityId() == m_entityId)
+1 -1
View File
@@ -81,7 +81,7 @@ void CTVNewSequenceDialog::OnOK()
for (unsigned int k = 0; k < GetIEditor()->GetSequenceManager()->GetCount(); ++k)
{
CTrackViewSequence* pSequence = GetIEditor()->GetSequenceManager()->GetSequenceByIndex(k);
QString fullname = pSequence->GetName();
QString fullname = QString::fromUtf8(pSequence->GetName().c_str());
if (fullname.compare(m_sequenceName, Qt::CaseInsensitive) == 0)
{
+2 -4
View File
@@ -1221,15 +1221,14 @@ bool CFileUtil::CreatePath(const QString& strPath)
if (!strDriveLetter.isEmpty())
{
strCurrentDirectoryPath = strDriveLetter;
strCurrentDirectoryPath += "\\";
strCurrentDirectoryPath += AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING;
}
nTotalPathQueueElements = cstrDirectoryQueue.size();
for (nCurrentPathQueue = 0; nCurrentPathQueue < nTotalPathQueueElements; ++nCurrentPathQueue)
{
strCurrentDirectoryPath += cstrDirectoryQueue[static_cast<int>(nCurrentPathQueue)];
strCurrentDirectoryPath += "\\";
strCurrentDirectoryPath += AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING;
// The value which will go out of this loop is the result of the attempt to create the
// last directory, only.
@@ -2158,7 +2157,6 @@ uint32 CFileUtil::GetAttributes(const char* filename, bool bUseSourceControl /*=
return SCC_FILE_ATTRIBUTE_READONLY | SCC_FILE_ATTRIBUTE_INPAK;
}
const char* adjustedFile = file.GetAdjustedFilename();
if (!AZ::IO::SystemFile::Exists(adjustedFile))
{
@@ -77,11 +77,4 @@ namespace AZ::Debug
};
} // namespace AZ::Debug
#ifdef USE_PIX
// The pix3 header unfortunately brings in other Windows macros we need to undef
#undef DeleteFile
#undef LoadImage
#undef GetCurrentTime
#endif
#include <AzCore/Debug/Profiler.inl>
@@ -70,3 +70,13 @@
#if defined(GetCommandLine)
#undef GetCommandLine
#endif
#if defined(LoadImage)
#undef LoadImage
#endif
#if defined(DeleteFile)
#undef DeleteFile
#endif
#if defined(GetCurrentTime)
#undef GetCurrentTime
#endif
+3 -3
View File
@@ -376,7 +376,7 @@ struct IAnimTrack
virtual int GetSubTrackCount() const = 0;
// Retrieve pointer the specfied sub track.
virtual IAnimTrack* GetSubTrack(int nIndex) const = 0;
virtual const char* GetSubTrackName(int nIndex) const = 0;
virtual AZStd::string GetSubTrackName(int nIndex) const = 0;
virtual void SetSubTrackName(int nIndex, const char* name) = 0;
//////////////////////////////////////////////////////////////////////////
@@ -623,7 +623,7 @@ public:
, valueType(_valueType)
, flags(_flags) {};
const char* name; // parameter name.
AZStd::string name; // parameter name.
CAnimParamType paramType; // parameter id.
AnimValueType valueType; // value type, defines type of track to use for animating this parameter.
ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags.
@@ -736,7 +736,7 @@ public:
// Returns name of supported parameter of this animation node or NULL if not available
// Arguments:
// paramType - parameter id
virtual const char* GetParamName(const CAnimParamType& paramType) const = 0;
virtual AZStd::string GetParamName(const CAnimParamType& paramType) const = 0;
// Description:
// Returns the params value type
@@ -440,7 +440,7 @@ struct IUiAnimTrack
virtual int GetSubTrackCount() const = 0;
// Retrieve pointer the specfied sub track.
virtual IUiAnimTrack* GetSubTrack(int nIndex) const = 0;
virtual const char* GetSubTrackName(int nIndex) const = 0;
virtual AZStd::string GetSubTrackName(int nIndex) const = 0;
virtual void SetSubTrackName(int nIndex, const char* name) = 0;
//////////////////////////////////////////////////////////////////////////
@@ -632,7 +632,7 @@ public:
virtual void SetName(const char* name) = 0;
//! Get node name.
virtual const char* GetName() = 0;
virtual AZStd::string GetName() = 0;
// Get Type of this node.
virtual EUiAnimNodeType GetType() const = 0;
@@ -708,13 +708,13 @@ public:
// Returns name of supported parameter of this animation node or NULL if not available
// Arguments:
// paramType - parameter id
virtual const char* GetParamName(const CUiAnimParamType& paramType) const = 0;
virtual AZStd::string GetParamName(const CUiAnimParamType& paramType) const = 0;
// Description:
// Returns name of supported parameter of this animation node or NULL if not available
// Arguments:
// paramType - parameter id
virtual const char* GetParamNameForTrack(const CUiAnimParamType& paramType, [[maybe_unused]] const IUiAnimTrack* track) const { return GetParamName(paramType); }
virtual AZStd::string GetParamNameForTrack(const CUiAnimParamType& paramType, [[maybe_unused]] const IUiAnimTrack* track) const { return GetParamName(paramType); }
// Description:
// Returns the params value type
+1 -1
View File
@@ -361,7 +361,7 @@ public:
else
{
// remove from start up folder
DeleteFile(fullLinkName);
DeleteFileW(fullLinkName);
}
#endif
#if AZ_TRAIT_OS_PLATFORM_APPLE
@@ -521,7 +521,7 @@ void CUiAnimationContext::OnEditorNotifyEvent(EEditorNotifyEvent event)
case eNotify_OnBeginLayerExport:
if (m_pSequence)
{
m_sequenceName = m_pSequence->GetName();
m_sequenceName = QString::fromUtf8(m_pSequence->GetName().c_str());
}
else
{
@@ -45,7 +45,7 @@ CUiAVSequenceProps::~CUiAVSequenceProps()
// CUiAVSequenceProps message handlers
bool CUiAVSequenceProps::OnInitDialog()
{
QString name = m_pSequence->GetName();
QString name = QString::fromUtf8(m_pSequence->GetName().c_str());
ui->NAME->setText(name);
ui->MOVE_SCALE_KEYS->setChecked(false);
@@ -135,7 +135,7 @@ void CUiAVSequenceProps::OnOK()
ac->UpdateTimeRange();
}
QString seqName = m_pSequence->GetName();
QString seqName = QString::fromUtf8(m_pSequence->GetName().c_str());
if (name != seqName)
{
// Rename sequence.
@@ -1241,7 +1241,7 @@ CUiAnimViewAnimNodeBundle CUiAnimViewAnimNode::GetAnimNodesByName(const char* pN
{
CUiAnimViewAnimNodeBundle bundle;
QString nodeName = GetName();
QString nodeName = QString::fromUtf8(GetName().c_str());
if (GetNodeType() == eUiAVNT_AnimNode && QString::compare(pName, nodeName, Qt::CaseInsensitive) == 0)
{
bundle.AppendAnimNode(this);
@@ -1261,17 +1261,15 @@ CUiAnimViewAnimNodeBundle CUiAnimViewAnimNode::GetAnimNodesByName(const char* pN
}
//////////////////////////////////////////////////////////////////////////
const char* CUiAnimViewAnimNode::GetParamName(const CUiAnimParamType& paramType) const
AZStd::string CUiAnimViewAnimNode::GetParamName(const CUiAnimParamType& paramType) const
{
const char* pName = m_pAnimNode->GetParamName(paramType);
return pName ? pName : "";
return m_pAnimNode->GetParamName(paramType);
}
//////////////////////////////////////////////////////////////////////////
const char* CUiAnimViewAnimNode::GetParamNameForTrack(const CUiAnimParamType& paramType, const IUiAnimTrack* track) const
AZStd::string CUiAnimViewAnimNode::GetParamNameForTrack(const CUiAnimParamType& paramType, const IUiAnimTrack* track) const
{
const char* pName = m_pAnimNode->GetParamNameForTrack(paramType, track);
return pName ? pName : "";
return m_pAnimNode->GetParamNameForTrack(paramType, track);
}
//////////////////////////////////////////////////////////////////////////
@@ -1408,7 +1406,7 @@ void CUiAnimViewAnimNode::UpdateDynamicParams()
void CUiAnimViewAnimNode::CopyKeysToClipboard(XmlNodeRef& xmlNode, const bool bOnlySelectedKeys, const bool bOnlyFromSelectedTracks)
{
XmlNodeRef childNode = xmlNode->createNode("Node");
childNode->setAttr("name", GetName());
childNode->setAttr("name", GetName().c_str());
childNode->setAttr("type", GetType());
for (auto iter = m_childNodes.begin(); iter != m_childNodes.end(); ++iter)
@@ -1552,7 +1550,7 @@ bool CUiAnimViewAnimNode::IsValidReparentingTo(CUiAnimViewAnimNode* pNewParent)
}
// Check if the new parent already contains a node with this name
CUiAnimViewAnimNodeBundle foundNodes = pNewParent->GetAnimNodesByName(GetName());
CUiAnimViewAnimNodeBundle foundNodes = pNewParent->GetAnimNodesByName(GetName().c_str());
if (foundNodes.GetCount() > 1 || (foundNodes.GetCount() == 1 && foundNodes.GetNode(0) != this))
{
return false;
@@ -118,7 +118,7 @@ public:
virtual bool IsActive();
// Name setter/getter
virtual const char* GetName() const override { return m_pAnimNode->GetName(); }
AZStd::string GetName() const override { return m_pAnimNode->GetName(); }
virtual bool SetName(const char* pName) override;
virtual bool CanBeRenamed() const override;
@@ -164,8 +164,8 @@ public:
// Param
unsigned int GetParamCount() const;
CUiAnimParamType GetParamType(unsigned int index) const;
const char* GetParamName(const CUiAnimParamType& paramType) const;
const char* GetParamNameForTrack(const CUiAnimParamType& paramType, const IUiAnimTrack* track) const;
AZStd::string GetParamName(const CUiAnimParamType& paramType) const;
AZStd::string GetParamNameForTrack(const CUiAnimParamType& paramType, const IUiAnimTrack* track) const;
bool IsParamValid(const CUiAnimParamType& param) const;
IUiAnimNode::ESupportedParamFlags GetParamFlags(const CUiAnimParamType& paramType) const;
EUiAnimValue GetParamValueType(const CUiAnimParamType& paramType) const;
@@ -980,7 +980,7 @@ void CUiAnimViewDialog::ReloadSequencesComboBox()
for (unsigned int k = 0; k < numSequences; ++k)
{
CUiAnimViewSequence* pSequence = pSequenceManager->GetSequenceByIndex(k);
QString fullname = pSequence->GetName();
QString fullname = QString::fromUtf8(pSequence->GetName().c_str());
m_sequencesComboBox->addItem(fullname);
}
}
@@ -1120,7 +1120,7 @@ void CUiAnimViewDialog::OnSequenceChanged(CUiAnimViewSequence* pSequence)
if (pSequence)
{
m_currentSequenceName = pSequence->GetName();
m_currentSequenceName = QString::fromUtf8(pSequence->GetName().c_str());
pSequence->Reset(true);
SaveZoomScrollSettings();
@@ -1721,7 +1721,7 @@ void CUiAnimViewDialog::OnNodeRenamed(CUiAnimViewNode* pNode, const char* pOldNa
{
if (m_currentSequenceName == QString(pOldName))
{
m_currentSequenceName = pNode->GetName();
m_currentSequenceName = QString::fromUtf8(pNode->GetName().c_str());
}
ReloadSequencesComboBox();
@@ -2974,7 +2974,7 @@ void CUiAnimViewDopeSheetBase::DrawNodeTrack(CUiAnimViewAnimNode* pAnimNode, QPa
const QRect textRect = trackRect.adjusted(4, 0, -4, 0);
QString sAnimNodeName = pAnimNode->GetName();
QString sAnimNodeName = QString::fromUtf8(pAnimNode->GetName().c_str());
const bool hasObsoleteTrack = pAnimNode->HasObsoleteTrack();
if (hasObsoleteTrack)
@@ -61,8 +61,8 @@ void CUiAnimViewFindDlg::FillData()
{
IUiAnimNode* pNode = seq->GetNode(i);
ObjName obj;
obj.m_objName = pNode->GetName();
obj.m_directorName = pNode->HasDirectorAsParent() ? pNode->HasDirectorAsParent()->GetName() : "";
obj.m_objName = QString::fromUtf8(pNode->GetName().c_str());
obj.m_directorName = pNode->HasDirectorAsParent() ? QString::fromUtf8(pNode->HasDirectorAsParent()->GetName().c_str()) : "";
AZStd::string fullname = seq->GetName();
obj.m_seqName = fullname.c_str();
m_objs.push_back(obj);
@@ -46,7 +46,7 @@ void CUiAVNewSequenceDialog::OnOK()
for (unsigned int k = 0; k < CUiAnimViewSequenceManager::GetSequenceManager()->GetCount(); ++k)
{
CUiAnimViewSequence* pSequence = CUiAnimViewSequenceManager::GetSequenceManager()->GetSequenceByIndex(k);
QString fullname = pSequence->GetName();
QString fullname = QString::fromUtf8(pSequence->GetName().c_str());
if (fullname.compare(m_sequenceName, Qt::CaseInsensitive) == 0)
{
@@ -594,7 +594,7 @@ bool CUiAnimViewNode::operator<(const CUiAnimViewNode& otherNode) const
if (thisTypeOrder == otherTypeOrder)
{
// Same node type, sort by name
return azstricmp(thisAnimNode.GetName(), otherAnimNode.GetName()) < 0;
return thisAnimNode.GetName() < otherAnimNode.GetName();
}
return thisTypeOrder < otherTypeOrder;
@@ -606,7 +606,7 @@ bool CUiAnimViewNode::operator<(const CUiAnimViewNode& otherNode) const
if (thisTrack.GetParameterType() == otherTrack.GetParameterType())
{
// Same parameter type, sort by name
return azstricmp(thisTrack.GetName(), otherTrack.GetName()) < 0;
return thisTrack.GetName() < otherTrack.GetName();
}
return thisTrack.GetParameterType() < otherTrack.GetParameterType();
@@ -156,7 +156,7 @@ public:
virtual ~CUiAnimViewNode() {}
// Name
virtual const char* GetName() const = 0;
virtual AZStd::string GetName() const = 0;
virtual bool SetName([[maybe_unused]] const char* pName) { return false; };
virtual bool CanBeRenamed() const { return false; }
@@ -413,7 +413,7 @@ CUiAnimViewNodesCtrl::CRecord* CUiAnimViewNodesCtrl::AddAnimNodeRecord(CRecord*
{
CRecord* pNewRecord = new CRecord(pAnimNode);
pNewRecord->setText(0, pAnimNode->GetName());
pNewRecord->setText(0, QString::fromUtf8(pAnimNode->GetName().c_str()));
UpdateUiAnimNodeRecord(pNewRecord, pAnimNode);
pParentRecord->insertChild(GetInsertPosition(pParentRecord, pAnimNode), pNewRecord);
FillNodesRec(pNewRecord, pAnimNode);
@@ -426,7 +426,7 @@ CUiAnimViewNodesCtrl::CRecord* CUiAnimViewNodesCtrl::AddTrackRecord(CRecord* pPa
{
CRecord* pNewTrackRecord = new CRecord(pTrack);
pNewTrackRecord->setSizeHint(0, QSize(30, 18));
pNewTrackRecord->setText(0, pTrack->GetName());
pNewTrackRecord->setText(0, QString::fromUtf8(pTrack->GetName().c_str()));
UpdateTrackRecord(pNewTrackRecord, pTrack);
pParentRecord->insertChild(GetInsertPosition(pParentRecord, pTrack), pNewTrackRecord);
FillNodesRec(pNewTrackRecord, pTrack);
@@ -576,7 +576,7 @@ void CUiAnimViewNodesCtrl::UpdateUiAnimNodeRecord(CRecord* pRecord, CUiAnimViewA
int nNodeImage = GetIconIndexForNode(nodeType);
assert(m_imageList.contains(nNodeImage));
QString nodeName = pAnimNode->GetName();
QString nodeName = QString::fromUtf8(pAnimNode->GetName().c_str());
pRecord->setIcon(0, m_imageList[nNodeImage]);
@@ -635,7 +635,7 @@ void CUiAnimViewNodesCtrl::OnFillItems()
m_nodeToRecordMap.clear();
CRecord* pRootGroupRec = new CRecord(pSequence);
pRootGroupRec->setText(0, pSequence->GetName());
pRootGroupRec->setText(0, QString::fromUtf8(pSequence->GetName().c_str()));
QFont f = font();
f.setBold(true);
pRootGroupRec->setData(0, Qt::FontRole, f);
@@ -987,7 +987,7 @@ void CUiAnimViewNodesCtrl::OnNMRclick(QPoint point)
if (pAnimNode)
{
QString matName;
GetMatNameAndSubMtlIndexFromName(matName, pAnimNode->GetName());
GetMatNameAndSubMtlIndexFromName(matName, pAnimNode->GetName().c_str());
QString newMatName;
newMatName = QStringLiteral("%1.[%2]").arg(matName).arg(cmd - eMI_SelectSubmaterialBase + 1);
UiAnimUndo undo("Rename Animation node");
@@ -1229,7 +1229,7 @@ int CUiAnimViewNodesCtrl::ShowPopupMenuSingleSelection(UiAnimContextMenu& contex
if (bOnNode && !pNode->IsGroupNode())
{
AddMenuSeperatorConditional(contextMenu.main, bAppended);
QString string = QString("%1 Tracks").arg(pAnimNode->GetName());
QString string = QString("%1 Tracks").arg(QString::fromUtf8(pAnimNode->GetName().c_str()));
contextMenu.main.addAction(string)->setEnabled(false);
bool bAppendedTrackFlag = false;
@@ -1247,7 +1247,7 @@ int CUiAnimViewNodesCtrl::ShowPopupMenuSingleSelection(UiAnimContextMenu& contex
continue;
}
QAction* a = contextMenu.main.addAction(QString(" %1").arg(pTrack2->GetName()));
QAction* a = contextMenu.main.addAction(QString(" %1").arg(QString::fromUtf8(pTrack2->GetName().c_str())));
a->setData(eMI_ShowHideBase + childIndex);
a->setCheckable(true);
a->setChecked(!pTrack2->IsHidden());
@@ -1383,7 +1383,7 @@ void CUiAnimViewNodesCtrl::FillAutoCompletionListForFilter()
for (unsigned int i = 0; i < animNodeCount; ++i)
{
strings << QString(animNodes.GetNode(i)->GetName());
strings << QString::fromUtf8(animNodes.GetNode(i)->GetName().c_str());
}
}
else
@@ -1687,7 +1687,7 @@ void CUiAnimViewNodesCtrl::OnNodeRenamed(CUiAnimViewNode* pNode, [[maybe_unused]
if (!m_bIgnoreNotifications)
{
CRecord* pNodeRecord = GetNodeRecord(pNode);
pNodeRecord->setText(0, pNode->GetName());
pNodeRecord->setText(0, QString::fromUtf8(pNode->GetName().c_str()));
update();
}
@@ -56,7 +56,7 @@ public:
CRecord(CUiAnimViewNode* pNode = nullptr);
CUiAnimViewNode* GetNode() const { return m_pNode; }
bool IsGroup() const { return m_pNode->GetChildCount() != 0; }
const QString GetName() const { return m_pNode->GetName(); }
const QString GetName() const { return QString::fromUtf8(m_pNode->GetName().c_str()); }
// Workaround: CXTPReportRecord::IsVisible is
// unreliable after the last visible element
@@ -334,7 +334,7 @@ void CUiAnimViewSequence::OnNodeRenamed(CUiAnimViewNode* pNode, const char* pOld
bool bLightAnimationSetActive = GetFlags() & IUiAnimSequence::eSeqFlags_LightAnimationSet;
if (bLightAnimationSetActive)
{
UpdateLightAnimationRefs(pOldName, pNode->GetName());
UpdateLightAnimationRefs(pOldName, pNode->GetName().c_str());
}
if (m_bNoNotifications)
@@ -86,7 +86,7 @@ public:
// IUiAnimViewNode
virtual EUiAnimViewNodeType GetNodeType() const override { return eUiAVNT_Sequence; }
virtual const char* GetName() const override { return m_pAnimSequence->GetName(); }
AZStd::string GetName() const override { return m_pAnimSequence->GetName(); }
virtual bool SetName(const char* pName) override;
virtual bool CanBeRenamed() const override { return true; }
@@ -58,7 +58,7 @@ CUiAnimViewSequence* CUiAnimViewSequenceManager::GetSequenceByName(QString name)
{
CUiAnimViewSequence* pSequence = (*iter).get();
if (pSequence->GetName() == name)
if (QString::fromUtf8(pSequence->GetName().c_str()) == name)
{
return pSequence;
}
@@ -156,8 +156,8 @@ void CUiAnimViewSequenceManager::SortSequences()
std::stable_sort(m_sequences.begin(), m_sequences.end(),
[](const std::unique_ptr<CUiAnimViewSequence>& a, const std::unique_ptr<CUiAnimViewSequence>& b) -> bool
{
QString aName = a.get()->GetName();
QString bName = b.get()->GetName();
QString aName = QString::fromUtf8(a.get()->GetName().c_str());
QString bName = QString::fromUtf8(b.get()->GetName().c_str());
return aName < bName;
});
}
@@ -28,7 +28,7 @@ public:
CUndoUiAnimViewSplineCtrl(CUiAnimViewSplineCtrl* pCtrl, std::vector<ISplineInterpolator*>& splineContainer)
: CUndoAnimKeySelection(CUiAnimViewSequenceManager::GetSequenceManager()->GetAnimationContext()->GetSequence())
{
m_sequenceName = CUiAnimViewSequenceManager::GetSequenceManager()->GetAnimationContext()->GetSequence()->GetName();
m_sequenceName = QString::fromUtf8(CUiAnimViewSequenceManager::GetSequenceManager()->GetAnimationContext()->GetSequence()->GetName().c_str());
m_pCtrl = pCtrl;
@@ -405,7 +405,7 @@ void CUiAnimViewTrack::RestoreFromMemento(const CUiAnimViewTrackMemento& memento
}
//////////////////////////////////////////////////////////////////////////
const char* CUiAnimViewTrack::GetName() const
AZStd::string CUiAnimViewTrack::GetName() const
{
CUiAnimViewNode* pParentNode = GetParentNode();
@@ -630,7 +630,7 @@ void CUiAnimViewTrack::CopyKeysToClipboard(XmlNodeRef& xmlNode, const bool bOnly
EBUS_EVENT_RESULT(animationSystem, UiEditorAnimationBus, GetAnimationSystem);
XmlNodeRef childNode = xmlNode->newChild("Track");
childNode->setAttr("name", GetName());
childNode->setAttr("name", GetName().c_str());
GetParameterType().Serialize(animationSystem, childNode, false);
childNode->setAttr("valueType", GetValueType());
@@ -73,7 +73,7 @@ public:
CUiAnimViewAnimNode* GetAnimNode() const;
// Name getter
virtual const char* GetName() const;
AZStd::string GetName() const override;
// CUiAnimViewNode
virtual EUiAnimViewNodeType GetNodeType() const override { return eUiAVNT_Track; }
@@ -56,7 +56,7 @@ int CUiAnimNode::GetTrackCount() const
return static_cast<int>(m_tracks.size());
}
const char* CUiAnimNode::GetParamName(const CUiAnimParamType& paramType) const
AZStd::string CUiAnimNode::GetParamName(const CUiAnimParamType& paramType) const
{
SParamInfo info;
if (GetParamInfoFromType(paramType, info))
@@ -627,7 +627,7 @@ void CUiAnimNode::Serialize(XmlNodeRef& xmlNode, bool bLoading, bool bLoadEmptyT
EUiAnimNodeType nodeType = GetType();
static_cast<UiAnimationSystem*>(GetUiAnimationSystem())->SerializeNodeType(nodeType, xmlNode, bLoading, IUiAnimSequence::kSequenceVersion, m_flags);
xmlNode->setAttr("Name", GetName());
xmlNode->setAttr("Name", GetName().c_str());
// Don't store expanded or selected flags
int flags = GetFlags() & ~(eUiAnimNodeFlags_Expanded | eUiAnimNodeFlags_EntitySelected);
@@ -39,7 +39,7 @@ public:
, valueType(_valueType)
, flags(_flags) {};
const char* name; // parameter name.
AZStd::string name; // parameter name.
CUiAnimParamType paramType; // parameter id.
EUiAnimValue valueType; // value type, defines type of track to use for animating this parameter.
ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags.
@@ -58,7 +58,7 @@ public:
//////////////////////////////////////////////////////////////////////////
void SetName(const char* name) override { m_name = name; };
const char* GetName() { return m_name.c_str(); };
AZStd::string GetName() override { return m_name; };
void SetSequence(IUiAnimSequence* pSequence) override { m_pSequence = pSequence; }
// Return Animation Sequence that owns this node.
@@ -81,7 +81,7 @@ public:
//////////////////////////////////////////////////////////////////////////
bool IsParamValid(const CUiAnimParamType& paramType) const;
virtual const char* GetParamName(const CUiAnimParamType& param) const;
AZStd::string GetParamName(const CUiAnimParamType& param) const override;
virtual EUiAnimValue GetParamValueType(const CUiAnimParamType& paramType) const;
virtual IUiAnimNode::ESupportedParamFlags GetParamFlags(const CUiAnimParamType& paramType) const;
virtual unsigned int GetParamCount() const { return 0; };
@@ -47,7 +47,7 @@ public:
virtual int GetSubTrackCount() const { return 0; };
virtual IUiAnimTrack* GetSubTrack([[maybe_unused]] int nIndex) const { return 0; };
virtual const char* GetSubTrackName([[maybe_unused]] int nIndex) const { return NULL; };
AZStd::string GetSubTrackName([[maybe_unused]] int nIndex) const override { return AZStd::string(); };
virtual void SetSubTrackName([[maybe_unused]] int nIndex, [[maybe_unused]] const char* name) { assert(0); }
virtual const CUiAnimParamType& GetParameterType() const { return m_nParamType; };
@@ -32,7 +32,7 @@ public:
virtual int GetSubTrackCount() const { return 0; };
virtual IUiAnimTrack* GetSubTrack([[maybe_unused]] int nIndex) const { return 0; };
virtual const char* GetSubTrackName([[maybe_unused]] int nIndex) const { return NULL; };
AZStd::string GetSubTrackName([[maybe_unused]] int nIndex) const override { return AZStd::string(); };
virtual void SetSubTrackName([[maybe_unused]] int nIndex, [[maybe_unused]] const char* name) { assert(0); }
virtual const CUiAnimParamType& GetParameterType() const { return m_nParamType; };
@@ -363,7 +363,7 @@ void CUiAnimAzEntityNode::ComputeOffsetsFromElementNames()
}
//////////////////////////////////////////////////////////////////////////
const char* CUiAnimAzEntityNode::GetParamName(const CUiAnimParamType& param) const
AZStd::string CUiAnimAzEntityNode::GetParamName(const CUiAnimParamType& param) const
{
SParamInfo info;
if (GetParamInfoFromType(param, info))
@@ -381,7 +381,7 @@ const char* CUiAnimAzEntityNode::GetParamName(const CUiAnimParamType& param) con
}
//////////////////////////////////////////////////////////////////////////
const char* CUiAnimAzEntityNode::GetParamNameForTrack(const CUiAnimParamType& param, const IUiAnimTrack* track) const
AZStd::string CUiAnimAzEntityNode::GetParamNameForTrack(const CUiAnimParamType& param, const IUiAnimTrack* track) const
{
// for Az Component Fields we use the name from the ClassElement
if (param == eUiAnimParamType_AzComponentField)
@@ -91,8 +91,8 @@ public:
//////////////////////////////////////////////////////////////////////////
virtual unsigned int GetParamCount() const;
virtual CUiAnimParamType GetParamType(unsigned int nIndex) const;
virtual const char* GetParamName(const CUiAnimParamType& param) const;
const char* GetParamNameForTrack(const CUiAnimParamType& param, const IUiAnimTrack* track) const override;
AZStd::string GetParamName(const CUiAnimParamType& param) const override;
AZStd::string GetParamNameForTrack(const CUiAnimParamType& param, const IUiAnimTrack* track) const override;
static int GetParamCountStatic();
static bool GetParamInfoStatic(int nIndex, SParamInfo& info);
@@ -386,10 +386,10 @@ IUiAnimTrack* UiCompoundSplineTrack::GetSubTrack(int nIndex) const
}
//////////////////////////////////////////////////////////////////////////
const char* UiCompoundSplineTrack::GetSubTrackName(int nIndex) const
AZStd::string UiCompoundSplineTrack::GetSubTrackName(int nIndex) const
{
assert(nIndex >= 0 && nIndex < m_nDimensions);
return m_subTrackNames[nIndex].c_str();
return m_subTrackNames[nIndex];
}
@@ -37,7 +37,7 @@ public:
virtual int GetSubTrackCount() const { return m_nDimensions; };
virtual IUiAnimTrack* GetSubTrack(int nIndex) const;
virtual const char* GetSubTrackName(int nIndex) const;
AZStd::string GetSubTrackName(int nIndex) const override;
virtual void SetSubTrackName(int nIndex, const char* name);
virtual EUiAnimCurveType GetCurveType() { return eUiAnimCurveType_BezierFloat; };
@@ -735,7 +735,7 @@ void UiAnimationSystem::ShowPlayedSequencesDebug()
//f32 purple[4] = {1, 0, 1, 1};
//f32 white[4] = {1, 1, 1, 1};
float y = 10.0f;
std::vector<const char*> names;
AZStd::vector<AZStd::string> names;
for (PlayingSequences::iterator it = m_playingSequences.begin(); it != m_playingSequences.end(); ++it)
{
@@ -756,23 +756,18 @@ void UiAnimationSystem::ShowPlayedSequencesDebug()
{
// Checks nodes which happen to be in several sequences.
// Those can be a bug, since several sequences may try to control the same entity.
const char* name = playingSequence.sequence->GetNode(i)->GetName();
AZStd::string name = playingSequence.sequence->GetNode(i)->GetName();
bool alreadyThere = false;
for (size_t k = 0; k < names.size(); ++k)
if (AZStd::find(names.begin(), names.end(), name) != names.end())
{
if (strcmp(names[k], name) == 0)
{
alreadyThere = true;
break;
}
alreadyThere = true;
}
if (alreadyThere == false)
else
{
names.push_back(name);
}
//gEnv->pRenderer->Draw2dLabel((21.0f + 100.0f * i), ((i % 2) ? (y + 8.0f) : y), 1.0f, alreadyThere ? white : purple, false, "%s", name);
//gEnv->pRenderer->Draw2dLabel((21.0f + 100.0f * i), ((i % 2) ? (y + 8.0f) : y), 1.0f, alreadyThere ? white : purple, false, "%s", name.c_str());
}
y += 32.0f;
@@ -152,14 +152,14 @@ private:
{
m_displayName = other.m_displayName;
m_animNodeParamInfo.paramType = other.m_displayName;
m_animNodeParamInfo.name = &m_displayName[0];
m_animNodeParamInfo.name = m_displayName;
}
BehaviorPropertyInfo& operator=(const AZStd::string& str)
{
// TODO: clean this up - this weird memory sharing was copied from legacy Cry - could be better.
m_displayName = str;
m_animNodeParamInfo.paramType = str; // set type to AnimParamType::ByString by assigning a string
m_animNodeParamInfo.name = &m_displayName[0];
m_animNodeParamInfo.name = m_displayName;
return *this;
}
@@ -77,7 +77,7 @@ int CAnimNode::GetTrackCount() const
return static_cast<int>(m_tracks.size());
}
const char* CAnimNode::GetParamName(const CAnimParamType& paramType) const
AZStd::string CAnimNode::GetParamName(const CAnimParamType& paramType) const
{
SParamInfo info;
if (GetParamInfoFromType(paramType, info))
@@ -86,7 +86,7 @@ public:
//////////////////////////////////////////////////////////////////////////
bool IsParamValid(const CAnimParamType& paramType) const;
virtual const char* GetParamName(const CAnimParamType& param) const;
AZStd::string GetParamName(const CAnimParamType& param) const override;
virtual AnimValueType GetParamValueType(const CAnimParamType& paramType) const;
virtual IAnimNode::ESupportedParamFlags GetParamFlags(const CAnimParamType& paramType) const;
virtual unsigned int GetParamCount() const { return 0; };
@@ -54,7 +54,7 @@ public:
virtual int GetSubTrackCount() const { return 0; };
virtual IAnimTrack* GetSubTrack([[maybe_unused]] int nIndex) const { return 0; };
virtual const char* GetSubTrackName([[maybe_unused]] int nIndex) const { return NULL; };
AZStd::string GetSubTrackName([[maybe_unused]] int nIndex) const { return AZStd::string(); };
virtual void SetSubTrackName([[maybe_unused]] int nIndex, [[maybe_unused]] const char* name) { assert(0); }
void SetNode(IAnimNode* node) override { m_node = node; }
@@ -37,7 +37,7 @@ public:
virtual int GetSubTrackCount() const { return 0; };
virtual IAnimTrack* GetSubTrack([[maybe_unused]] int nIndex) const { return 0; };
virtual const char* GetSubTrackName([[maybe_unused]] int nIndex) const { return NULL; };
AZStd::string GetSubTrackName([[maybe_unused]] int nIndex) const override { return AZStd::string(); };
virtual void SetSubTrackName([[maybe_unused]] int nIndex, [[maybe_unused]] const char* name) { assert(0); }
virtual const CAnimParamType& GetParameterType() const { return m_nParamType; };
@@ -346,10 +346,10 @@ IAnimTrack* CCompoundSplineTrack::GetSubTrack(int nIndex) const
}
//////////////////////////////////////////////////////////////////////////
const char* CCompoundSplineTrack::GetSubTrackName(int nIndex) const
AZStd::string CCompoundSplineTrack::GetSubTrackName(int nIndex) const
{
assert(nIndex >= 0 && nIndex < m_nDimensions);
return m_subTrackNames[nIndex].c_str();
return m_subTrackNames[nIndex];
}
@@ -38,7 +38,7 @@ public:
virtual int GetSubTrackCount() const { return m_nDimensions; };
virtual IAnimTrack* GetSubTrack(int nIndex) const;
virtual const char* GetSubTrackName(int nIndex) const;
AZStd::string GetSubTrackName(int nIndex) const;
virtual void SetSubTrackName(int nIndex, const char* name);
virtual EAnimCurveType GetCurveType() { return eAnimCurveType_BezierFloat; };
@@ -217,7 +217,7 @@ bool CAnimMaterialNode::GetParamInfoFromType(const CAnimParamType& paramId, SPar
}
//////////////////////////////////////////////////////////////////////////
const char* CAnimMaterialNode::GetParamName(const CAnimParamType& param) const
AZStd::string CAnimMaterialNode::GetParamName(const CAnimParamType& param) const
{
if (param.GetType() == AnimParamType::ByString)
{
@@ -37,7 +37,7 @@ public:
//////////////////////////////////////////////////////////////////////////
virtual unsigned int GetParamCount() const;
virtual CAnimParamType GetParamType(unsigned int nIndex) const;
virtual const char* GetParamName(const CAnimParamType& paramType) const;
AZStd::string GetParamName(const CAnimParamType& paramType) const override;
virtual void GetKeyValueRange(float& fMin, float& fMax) const { fMin = m_fMinKeyValue; fMax = m_fMaxKeyValue; };
virtual void SetKeyValueRange(float fMin, float fMax){ m_fMinKeyValue = fMin; m_fMaxKeyValue = fMax; };
@@ -40,6 +40,8 @@ AZ_PUSH_DISABLE_WARNING(4702, "-Wunknown-warning-option") // OpenMesh\Core\Utils
#include <OpenMesh/Core/Utils/vector_traits.hh>
AZ_POP_DISABLE_WARNING
AZ_DECLARE_BUDGET(AzToolsFramework);
namespace OpenMesh
{
template<>
@@ -11,6 +11,8 @@
#include <AzCore/Debug/Profiler.h>
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
AZ_DECLARE_BUDGET(AzToolsFramework);
namespace WhiteBox
{
void DrawEdges(
+24 -19
View File
@@ -112,7 +112,8 @@ function(read_engine_restricted_path output_restricted_path)
# Set manifest path to path in the user home directory
set(manifest_path ${LY_ROOT_FOLDER}/engine.json)
if(EXISTS ${manifest_path})
o3de_restricted_path(${manifest_path} output_restricted_path)
o3de_restricted_path(${manifest_path} read_restricted_path)
set(${output_restricted_path} ${read_restricted_path} PARENT_SCOPE)
endif()
endfunction()
@@ -133,16 +134,17 @@ ly_set(PAL_HOST_PLATFORM_NAME_LOWERCASE ${PAL_HOST_PLATFORM_NAME_LOWERCASE})
set(PAL_RESTRICTED_PLATFORMS)
string(LENGTH "${O3DE_ENGINE_RESTRICTED_PATH}" engine_restricted_length)
file(GLOB pal_restricted_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PAL_*.cmake)
foreach(pal_restricted_file ${pal_restricted_files})
string(FIND ${pal_restricted_file} "/cmake/PAL" end)
if(${end} GREATER -1)
math(EXPR platform_length "${end} - ${engine_restricted_length} - 1")
math(EXPR platform_start "${engine_restricted_length} + 1")
string(SUBSTRING ${pal_restricted_file} ${platform_start} ${platform_length} platform)
list(APPEND PAL_RESTRICTED_PLATFORMS "${platform}")
endif()
# Get relative path from restricted root directory
cmake_path(RELATIVE_PATH pal_restricted_file BASE_DIRECTORY ${O3DE_ENGINE_RESTRICTED_PATH} OUTPUT_VARIABLE relative_pal_restricted_file)
# Split relative restricted path into path segments
string(REPLACE "/" ";" pal_restricted_segments ${relative_pal_restricted_file})
# Retrieve the first path segment which should be the restricted platform
list(GET pal_restricted_segments 0 platform)
# Append the new restricted platform
string(TOLOWER ${platform} platform_lower)
list(APPEND PAL_RESTRICTED_PLATFORMS ${platform_lower})
endforeach()
ly_set(PAL_RESTRICTED_PLATFORMS ${PAL_RESTRICTED_PLATFORMS})
@@ -186,11 +188,17 @@ function(ly_get_absolute_pal_filename out_name in_name)
# Remove one path segment from the end of the current_object_path and prepend it to the list path_segments
cmake_path(GET current_object_path PARENT_PATH parent_path)
cmake_path(GET current_object_path FILENAME path_segment)
list(PREPEND path_segments_visited path_segment)
list(PREPEND path_segments_visited ${path_segment})
cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment)
cmake_path(SET current_object_path "${parent_path}")
set(is_prev_path_segment TRUE)
while(is_prev_path_segment)
# Remove one path segment from the end of the current_object_path and prepend it to the list path_segments
cmake_path(GET current_object_path PARENT_PATH parent_path)
cmake_path(GET current_object_path FILENAME path_segment)
cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment)
cmake_path(SET current_object_path "${parent_path}")
# The Path is in a PAL structure
# Decompose the path into sections before "Platform" and after "Platform"
if(path_segment STREQUAL "Platform")
@@ -205,21 +213,17 @@ function(ly_get_absolute_pal_filename out_name in_name)
break()
endif()
# Remove one path segment from the end of the current_object_path and prepend it to the list path_segments
cmake_path(GET current_object_path PARENT_PATH parent_path)
cmake_path(GET current_object_path FILENAME path_segment)
list(PREPEND path_segments_visited path_segment)
cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment)
cmake_path(SET current_object_path "${parent_path}")
list(PREPEND path_segments_visited ${path_segment})
endwhile()
# Compose a candidate restricted path and examine if it exists
cmake_path(APPEND object_restricted_path ${pre_platform_paths} "Platform" ${post_platform_paths}
cmake_path(APPEND ${pre_platform_paths} "Platform" ${post_platform_paths}
OUTPUT_VARIABLE candidate_PAL_path)
if(NOT EXISTS ${candidate_PAL_path})
if("${candidate_platform_name}" IN_LIST PAL_RESTRICTED_PLATFORMS)
string(TOLOWER ${candidate_platform_name} candidate_platform_name_lower)
if("${candidate_platform_name_lower}" IN_LIST PAL_RESTRICTED_PLATFORMS)
cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${object_name}
${pre_platform_paths} ${post_platform_paths} OUTPUT_VARIABLE candidate_PAL_path)
${pre_platform_paths} OUTPUT_VARIABLE candidate_PAL_path)
endif()
endif()
if(EXISTS ${candidate_PAL_path})
@@ -227,6 +231,7 @@ function(ly_get_absolute_pal_filename out_name in_name)
endif()
endif()
endif()
cmake_path(ABSOLUTE_PATH full_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
set(${out_name} ${full_name} PARENT_SCOPE)
endfunction()