Merge pull request #3428 from aws-lumberyard-dev/cgalvan/FixedTrackViewNodeCrash
Fixed memory stomping leading to Track View nodes with invalid labels and crash.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1125,7 +1125,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2033,7 +2033,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);
|
||||
@@ -2309,7 +2309,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)";
|
||||
|
||||
|
||||
@@ -3453,7 +3453,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)
|
||||
|
||||
@@ -626,7 +626,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;
|
||||
@@ -638,7 +638,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();
|
||||
|
||||
@@ -159,7 +159,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; }
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -894,14 +894,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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1246,7 +1246,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);
|
||||
@@ -1266,17 +1266,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);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1413,7 +1411,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)
|
||||
@@ -1557,7 +1555,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;
|
||||
|
||||
@@ -992,7 +992,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);
|
||||
}
|
||||
}
|
||||
@@ -1132,7 +1132,7 @@ void CUiAnimViewDialog::OnSequenceChanged(CUiAnimViewSequence* pSequence)
|
||||
|
||||
if (pSequence)
|
||||
{
|
||||
m_currentSequenceName = pSequence->GetName();
|
||||
m_currentSequenceName = QString::fromUtf8(pSequence->GetName().c_str());
|
||||
|
||||
pSequence->Reset(true);
|
||||
SaveZoomScrollSettings();
|
||||
@@ -1733,7 +1733,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();
|
||||
|
||||
@@ -2980,7 +2980,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)
|
||||
{
|
||||
|
||||
@@ -598,7 +598,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;
|
||||
@@ -610,7 +610,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();
|
||||
|
||||
@@ -159,7 +159,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");
|
||||
@@ -1232,7 +1232,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;
|
||||
@@ -1250,7 +1250,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());
|
||||
@@ -1386,7 +1386,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
|
||||
@@ -1690,7 +1690,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; }
|
||||
|
||||
@@ -65,7 +65,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))
|
||||
@@ -636,7 +636,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; };
|
||||
|
||||
@@ -384,7 +384,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))
|
||||
@@ -402,7 +402,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; };
|
||||
|
||||
@@ -736,7 +736,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)
|
||||
{
|
||||
@@ -757,23 +757,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; };
|
||||
|
||||
Reference in New Issue
Block a user