From e28ff0beea17a3a63e3804ad11c8e16c6c2a4edb Mon Sep 17 00:00:00 2001
From: lumberyard-employee-dm
<56135373+lumberyard-employee-dm@users.noreply.github.com>
Date: Fri, 16 Jul 2021 03:52:11 -0500
Subject: [PATCH 01/15] Adding rapidjson.natvis file to the AzCore project to
Visualizers to VS
By adding the natvis to a vcxproj Visual Studio automatically loads it
when using the source engine
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
---
.../AzCore/Natvis/rapidjson.natvis | 38 +++++++++++++++++++
.../Windows/platform_windows_files.cmake | 1 +
2 files changed, 39 insertions(+)
create mode 100644 Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/rapidjson.natvis
diff --git a/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/rapidjson.natvis b/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/rapidjson.natvis
new file mode 100644
index 0000000000..5167714f20
--- /dev/null
+++ b/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/rapidjson.natvis
@@ -0,0 +1,38 @@
+
+
+
+
+ null
+ true
+ false
+ {data_.ss.str}
+ {(const char*)((size_t)data_.s.str & 0x0000FFFFFFFFFFFF)}
+ {data_.n.i.i}
+ {data_.n.u.u}
+ {data_.n.i64}
+ {data_.n.u64}
+ {data_.n.d}
+ Object members={data_.o.size}
+ Array members={data_.a.size}
+
+ - data_.o.size
+ - data_.o.capacity
+
+ data_.o.size
+
+ (rapidjson_ly::GenericMember<$T1,$T2>*)(((size_t)data_.o.members) & 0x0000FFFFFFFFFFFF)
+
+
+ - data_.a.size
+ - data_.a.capacity
+
+ data_.a.size
+
+ (rapidjson_ly::GenericValue<$T1,$T2>*)(((size_t)data_.a.elements) & 0x0000FFFFFFFFFFFF)
+
+
+
+
+
+
+
diff --git a/Code/Framework/AzCore/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzCore/Platform/Windows/platform_windows_files.cmake
index 520c53f74c..97ab3c86d6 100644
--- a/Code/Framework/AzCore/Platform/Windows/platform_windows_files.cmake
+++ b/Code/Framework/AzCore/Platform/Windows/platform_windows_files.cmake
@@ -29,6 +29,7 @@ set(FILES
../Common/VisualStudio/AzCore/Natvis/azcore.natvis
../Common/VisualStudio/AzCore/Natvis/azcore.natstepfilter
../Common/VisualStudio/AzCore/Natvis/azcore.natjmc
+ ../Common/VisualStudio/AzCore/Natvis/rapidjson.natvis
AzCore/Debug/StackTracer_Windows.cpp
../Common/WinAPI/AzCore/Debug/Trace_WinAPI.cpp
../Common/WinAPI/AzCore/IO/Streamer/StreamerContext_WinAPI.cpp
From a3e90b878c6a33780425e6b27eaff4dc8286c7f0 Mon Sep 17 00:00:00 2001
From: Benjamin Jillich
Date: Mon, 26 Jul 2021 09:55:37 +0200
Subject: [PATCH 02/15] Removed legacy anim graph node parsers and legacy file
format chunks
Signed-off-by: Benjamin Jillich
---
.../Source/Importer/AnimGraphFileFormat.cpp | 120 -
.../Source/Importer/AnimGraphFileFormat.h | 231 -
.../Importer/LegacyAnimGraphNodeParser.cpp | 4772 -----------------
.../Importer/LegacyAnimGraphNodeParser.h | 259 -
.../Source/Importer/MotionSetFileFormat.h | 60 -
5 files changed, 5442 deletions(-)
delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.cpp
delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.h
delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Importer/LegacyAnimGraphNodeParser.cpp
delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Importer/LegacyAnimGraphNodeParser.h
delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Importer/MotionSetFileFormat.h
diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.cpp
deleted file mode 100644
index f79057dfa8..0000000000
--- a/Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include "AnimGraphFileFormat.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace EMotionFX
-{
- namespace FileFormat
- {
- AZ::TypeId GetParameterTypeIdForInterfaceType(uint32 interfaceType)
- {
- switch (interfaceType)
- {
- case MCore::ATTRIBUTE_INTERFACETYPE_FLOATSPINNER:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_FLOATSLIDER:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_INTSPINNER:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_INTSLIDER:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_CHECKBOX:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR2:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3GIZMO:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR4:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_COLOR:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_STRING:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3:
- return azrtti_typeid();
- case MCore::ATTRIBUTE_INTERFACETYPE_TAG:
- return azrtti_typeid();
-
- case MCore::ATTRIBUTE_INTERFACETYPE_COMBOBOX:
- case MCore::ATTRIBUTE_INTERFACETYPE_PROPERTYSET:
- case MCore::ATTRIBUTE_INTERFACETYPE_DEFAULT:
- default:
- break;
- }
- return AZ::TypeId();
- }
-
- uint32 GetInterfaceTypeForParameterTypeId(const AZ::TypeId& parameterTypeId)
- {
- if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_FLOATSPINNER;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_FLOATSLIDER;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_INTSPINNER;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_INTSLIDER;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_CHECKBOX;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR2;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3GIZMO;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR4;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_COLOR;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_STRING;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3;
- }
- else if (parameterTypeId == azrtti_typeid())
- {
- return MCore::ATTRIBUTE_INTERFACETYPE_TAG;
- }
- return MCORE_INVALIDINDEX32;
- }
- }
-} // namespace EMotionFX
diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.h b/Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.h
deleted file mode 100644
index 3b88c3605f..0000000000
--- a/Gems/EMotionFX/Code/EMotionFX/Source/Importer/AnimGraphFileFormat.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include "SharedFileFormatStructs.h"
-#include "AzCore/RTTI/TypeInfo.h"
-
-namespace EMotionFX
-{
- namespace FileFormat // so now we are in the namespace EMotionFX::FileFormat
- {
- // collection of animGraph chunk IDs
- enum
- {
- ANIMGRAPH_CHUNK_BLENDNODE = 400,
- ANIMGRAPH_CHUNK_STATETRANSITIONS = 401,
- ANIMGRAPH_CHUNK_NODECONNECTIONS = 402,
- ANIMGRAPH_CHUNK_PARAMETERS = 403,
- ANIMGRAPH_CHUNK_NODEGROUPS = 404,
- ANIMGRAPH_CHUNK_GROUPPARAMETERS = 405,
- ANIMGRAPH_CHUNK_GAMECONTROLLERSETTINGS = 406,
- ANIMGRAPH_CHUNK_ADDITIONALINFO = 407,
- ANIMGRAPH_FORCE_32BIT = 0xFFFFFFFF
- };
-
- enum
- {
- ANIMGRAPH_NODEFLAG_COLLAPSED = 1 << 0,
- ANIMGRAPH_NODEFLAG_VISUALIZED = 1 << 1,
- ANIMGRAPH_NODEFLAG_DISABLED = 1 << 2,
- ANIMGRAPH_NODEFLAG_VIRTUALFINALOUTPUT = 1 << 3
- };
-
- /*
- AnimGraph_Header
-
- ANIMGRAPH_CHUNK_PARAMETERS: (global animgraph parameters)
- uint32 numParameters
- AnimGraph_ParamInfo[numParameters]
-
- ANIMGRAPH_CHUNK_BLENDNODE:
- AnimGraph_NodeHeader
-
- ANIMGRAPH_CHUNK_NODECONNECTIONS: (for last loaded BLENDNODE)
- uint32 numConnections
- AnimGraph_NodeConnection[numConnections]
-
- ANIMGRAPH_CHUNK_STATETRANSITIONS: (for last loaded node, assumed to be a state machine)
- uint32 numStateTransitions
- uint32 blendNodeIndex (the state machine the transitions are for)
- AnimGraph_StateTransition[numStateTransitions]
-
- ANIMGRAPH_CHUNK_NODEGROUPS:
- uint32 numNodeGroups
- AnimGraph_NodeGroup[numNodeGroups]
-
- ANIMGRAPH_CHUNK_GAMECONTROLLERSETTINGS:
- uint32 activePresetIndex
- uint32 numPresets
- AnimGraph_GameControllerPreset[numPresets]
- */
-
- // AnimGraph file header
- struct AnimGraph_Header
- {
- char mFourCC[4];
- uint8 mEndianType;
- uint32 mFileVersion;
- uint32 mNumNodes;
- uint32 mNumStateTransitions;
- uint32 mNumNodeConnections;
- uint32 mNumParameters;
-
- // followed by:
- // string mName;
- // string mCopyright;
- // string mDescription;
- // string mCompany;
- // string mEMFXVersion;
- // string mEMStudioBuildDate;
- };
-
- // additional info
- struct AnimGraph_AdditionalInfo
- {
- uint8 mUnitType;
- };
-
-
- // the node header
- struct AnimGraph_NodeHeader
- {
- uint32 mTypeID;
- uint32 mParentIndex;
- uint32 mVersion;
- uint32 mNumCustomDataBytes; // number of bytes of node custom data to follow
- uint32 mNumChildNodes;
- uint32 mNumAttributes;
- int32 mVisualPosX;
- int32 mVisualPosY;
- uint32 mVisualizeColor;
- uint8 mFlags;
-
- // followed by:
- // string mName;
- // animGraphNode->Save(...) or animGraphNode->Load(...), writing or reading mNumBytes bytes
- };
-
-
- struct AnimGraph_ParameterInfo
- {
- uint32 mNumComboValues;
- uint32 mInterfaceType;
- uint32 mAttributeType;
- uint16 mFlags;
- char mHasMinMax;
-
- // followed by:
- // string mName
- // string mInternalName
- // string mDescription
- // if (mHasMinMax == 1)
- // {
- // AnimGraph_Attribute mMinValue
- // AnimGraph_Attribute mMaxValue
- // }
- // AnimGraph_Attribute mDefaultValue
- // string mComboValues[mNumComboValues]
- };
-
-
- // a node connection
- struct AnimGraph_NodeConnection
- {
- uint32 mSourceNode;
- uint32 mTargetNode;
- uint16 mSourceNodePort;
- uint16 mTargetNodePort;
- };
-
-
- // a state transition
- struct AnimGraph_StateTransition
- {
- uint32 mSourceNode;
- uint32 mDestNode;
- int32 mStartOffsetX;
- int32 mStartOffsetY;
- int32 mEndOffsetX;
- int32 mEndOffsetY;
- uint32 mNumConditions;
-
- // followed by:
- // AnimGraph_NodeHeader (and its followed by data, EXCEPT THE NAME STRING, which is skipped)
- // AnimGraph_NodeHeader[mConditions] (and its followed by data, EXCEPT THE NAME STRING, which is skipped)
- };
-
-
- // a node group
- struct AnimGraph_NodeGroup
- {
- FileColor mColor;
- uint8 mIsVisible;
- uint32 mNumNodes;
-
- // followed by:
- // string mName
- // uint32[mNumNodes] (node indices that belong to the group)
- };
-
-
- // a group parameter
- struct AnimGraph_GroupParameter
- {
- uint32 mNumParameters;
- uint8 mCollapsed;
-
- // followed by:
- // string mName
- // uint32[mNumParameters] (parameter indices that belong to the group)
- };
-
-
- // a game controller parameter info
- struct AnimGraph_GameControllerParameterInfo
- {
- uint8 mAxis;
- uint8 mMode;
- uint8 mInvert;
-
- // followed by:
- // string mName
- };
-
-
- // a game controller button info
- struct AnimGraph_GameControllerButtonInfo
- {
- uint8 mButtonIndex;
- uint8 mMode;
-
- // followed by:
- // string mString
- };
-
-
- // a game controller preset
- struct AnimGraph_GameControllerPreset
- {
- uint32 mNumParameterInfos;
- uint32 mNumButtonInfos;
-
- // followed by:
- // string mName
- // AnimGraph_GameControllerParameterInfo[mNumParameterInfos]
- // AnimGraph_GameControllerButtonInfo[mNumButtonInfos]
- };
-
- // Conversion functions to support attributes with the old serialization.
- // Once we deprecate the old format we can remove these two functions.
- AZ::TypeId GetParameterTypeIdForInterfaceType(uint32 interfaceType);
- uint32 GetInterfaceTypeForParameterTypeId(const AZ::TypeId& parameterTypeId);
-
- } // namespace FileFormat
-} // namespace EMotionFX
diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Importer/LegacyAnimGraphNodeParser.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Importer/LegacyAnimGraphNodeParser.cpp
deleted file mode 100644
index db3db121dd..0000000000
--- a/Gems/EMotionFX/Code/EMotionFX/Source/Importer/LegacyAnimGraphNodeParser.cpp
+++ /dev/null
@@ -1,4772 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-#include "LegacyAnimGraphNodeParser.h"
-#include
-#include
-#include "../ConstraintTransformRotationAngles.h"
-#include "ChunkProcessors.h"
-#include "../AnimGraph.h"
-#include "../AnimGraphStateMachine.h"
-#include "../AnimGraphBindPoseNode.h"
-#include "../AnimGraphHubNode.h"
-#include "../AnimGraphParameterCondition.h"
-#include "../AnimGraphVector2Condition.h"
-#include "../AnimGraphMotionCondition.h"
-#include "../AnimGraphStateCondition.h"
-#include "../AnimGraphTimeCondition.h"
-#include "../AnimGraphPlayTimeCondition.h"
-#include "../AnimGraphTagCondition.h"
-#include "../BlendTreeMotionFrameNode.h"
-#include "../BlendTreeBlendNNode.h"
-#include "../BlendTreeFloatConditionNode.h"
-#include "../BlendTreeFloatSwitchNode.h"
-#include "../BlendTreeBoolLogicNode.h"
-#include "../AnimGraphMotionNode.h"
-#include "../BlendTreeAccumTransformNode.h"
-#include "../BlendTreeBlend2LegacyNode.h"
-#include "../BlendTreeFloatConstantNode.h"
-#include "../BlendTreeFloatMath1Node.h"
-#include "../BlendTreeFloatMath2Node.h"
-#include "../BlendTreeMorphTargetNode.h"
-#include "../BlendTreeVector2ComposeNode.h"
-#include "../BlendTreeVector3ComposeNode.h"
-#include "../BlendTreeVector4ComposeNode.h"
-#include "../BlendTreeVector3Math1Node.h"
-#include "../BlendTreeVector3Math2Node.h"
-#include "../BlendTreeSmoothingNode.h"
-#include "../BlendTreeRangeRemapperNode.h"
-#include "../BlendTreeTwoLinkIKNode.h"
-#include "../BlendTreeLookAtNode.h"
-#include "../BlendTreeTransformNode.h"
-#include "../BlendTreeMaskLegacyNode.h"
-#include "../BlendTreePoseSwitchNode.h"
-#include "../BlendTreeVector2DecomposeNode.h"
-#include "../BlendTreeVector3DecomposeNode.h"
-#include "../BlendTreeVector4DecomposeNode.h"
-#include "../BlendTreeDirectionToWeightNode.h"
-#include "../BlendTreeMirrorPoseNode.h"
-#include "../AnimGraphEntryNode.h"
-#include "../AnimGraphExitNode.h"
-#include "../BlendTreeParameterNode.h"
-#include "../BlendSpace1DNode.h"
-#include "../BlendSpace2DNode.h"
-#include "../BlendTreeFinalNode.h"
-#include "../BlendTree.h"
-#include "../BlendSpaceNode.h"
-#include "../AnimGraphStateTransition.h"
-#include "../AnimGraphMotionCondition.h"
-#include "../AnimGraphParameterCondition.h"
-#include "../AnimGraphPlayTimeCondition.h"
-#include "../AnimGraphStateCondition.h"
-#include "../AnimGraphTagCondition.h"
-#include "../AnimGraphTimeCondition.h"
-#include "../AnimGraphVector2Condition.h"
-#include "../BlendTreeFloatConstantNode.h"
-#include "../BlendTreeMorphTargetNode.h"
-#include "../BlendTreeVector2ComposeNode.h"
-#include "../BlendTreeVector3ComposeNode.h"
-#include "../BlendTreeVector4ComposeNode.h"
-#include "../TwoStringEventData.h"
-
-
-namespace EMotionFX
-{
- const AZ::TypeId GetNewTypeIdByOldNodeTypeId(uint32 oldNodeTypeId)
- {
- switch (oldNodeTypeId)
- {
- case 0x00000017: return azrtti_typeid(); break;
- case 0x00000005: return azrtti_typeid(); break;
- case 0x00000002: return azrtti_typeid(); break;
- case 0x38658581: return azrtti_typeid(); break;
- case 0x32521069: return azrtti_typeid(); break;
- case 0x38020071: return azrtti_typeid(); break;
- case 0x00000006: return azrtti_typeid(); break;
- case 0x00000001: return azrtti_typeid(); break;
- case 0x00022100: return azrtti_typeid(); break;
- case 0x00022200: return azrtti_typeid(); break;
- case 0x00000004: return azrtti_typeid(); break;
- case 0x00000013: return azrtti_typeid(); break;
- case 0x00000007: return azrtti_typeid(); break;
- case 0x00000008: return azrtti_typeid(); break;
- case 0x00000009: return azrtti_typeid(); break;
- case 0x00000010: return azrtti_typeid(); break;
- case 0x00000148: return azrtti_typeid(); break;
- case 0x00000012: return azrtti_typeid(); break;
- case 0x00000011: return azrtti_typeid(); break;
- case 0x00000014: return azrtti_typeid(); break;
- case 0x00000016: return azrtti_typeid(); break;
- case 0x00002445: return azrtti_typeid(); break;
- case 0x00000018: return azrtti_typeid(); break;
- case 0x00000020: return azrtti_typeid(); break;
- case 0x00000021: return azrtti_typeid(); break;
- case 0x00000126: return azrtti_typeid(); break;
- case 0x00000227: return azrtti_typeid(); break;
- case 0x00000129: return azrtti_typeid(); break;
- case 0x00000228: return azrtti_typeid(); break;
- case 0x00000128: return azrtti_typeid(); break;
- case 0x00000229: return azrtti_typeid(); break;
- case 0x00000456: return azrtti_typeid(); break;
- case 0x02094017: return azrtti_typeid(); break;
- case 0x38427080: return azrtti_typeid(); break;
- case 0x00000214: return azrtti_typeid(); break;
- case 0x00001286: return azrtti_typeid(); break;
- case 0x00040360: return azrtti_typeid(); break;
- case 0x00012345: return azrtti_typeid(); break;
- case 0x00012346: return azrtti_typeid(); break;
- case 0x00001000: return azrtti_typeid(); break;
- case 0x00002000: return azrtti_typeid(); break;
- case 0x00002123: return azrtti_typeid(); break;
- case 0x00002001: return azrtti_typeid(); break;
- case 0x09502005: return azrtti_typeid(); break;
- case 0x00005210: return azrtti_typeid(); break;
- case 0x00029610: return azrtti_typeid(); break;
- case 0x00005321: return azrtti_typeid(); break;
- default: return AZ::TypeId::CreateNull();
- };
- }
-
- class LegacyAttributeRotation
- {
- public:
- LegacyAttributeRotation()
- {}
-
- LegacyAttributeRotation(const LegacyAttributeRotation& src):
- m_rotation(src.m_rotation),
- m_degrees(src.m_degrees),
- m_order(src.m_order)
- {}
-
- LegacyAttributeRotation& operator=(const LegacyAttributeRotation& src)
- {
- m_rotation = src.m_rotation;
- m_degrees = src.m_degrees;
- m_order = src.m_order;
- return *this;
- }
-
- void SetRotation(const AZ::Quaternion& rotation)
- {
- m_rotation = rotation;
- }
-
- void SetDegrees(const AZ::Vector3& degrees)
- {
- m_degrees = degrees;
- }
-
- void SetOrder(LegacyERotationOrder order)
- {
- m_order = order;
- }
-
- const AZ::Quaternion& GetRotation() const
- {
- return m_rotation;
- }
-
- const AZ::Vector3& GetDegrees() const
- {
- return m_degrees;
- }
-
- LegacyERotationOrder GetOrder() const
- {
- return m_order;
- }
-
- private:
- AZ::Quaternion m_rotation; /**< The unit quaternion rotation. */
- AZ::Vector3 m_degrees; /**< The rotation angles. As programmer you don't need to setup these values. They are only to display in the GUI. */
- LegacyERotationOrder m_order; /**< The rotation order, which defaults to ZYX. */
- };
-
- class LegacyStateFilterLocal
- {
- public:
- LegacyStateFilterLocal() { }
-
- LegacyStateFilterLocal(const LegacyStateFilterLocal& src) :
- m_nodeNames(src.m_nodeNames),
- m_groupNames(src.m_groupNames)
- { }
-
- LegacyStateFilterLocal& operator=(const LegacyStateFilterLocal& src)
- {
- m_nodeNames = src.m_nodeNames;
- m_groupNames = src.m_groupNames;
- return *this;
- }
-
- void SetNodeNmes(const AZStd::vector& nodeNames)
- {
- m_nodeNames = nodeNames;
- }
-
- void SetGroupNames(const AZStd::vector& groupNames)
- {
- m_groupNames = groupNames;
- }
-
- const AZStd::vector& GetNodeNames() const
- {
- return m_nodeNames;
- }
-
- const AZStd::vector& GetGroupNames() const
- {
- return m_groupNames;
- }
-
- private:
- AZStd::vector m_nodeNames;
- AZStd::vector m_groupNames;
- };
-
-bool LegacyAnimGraphNodeParser::Forward(MCore::File* stream, size_t numBytes)
-{
- if(!stream->Forward(numBytes))
- {
- AZ_Error("EMotionFX", false, "Unable to skip data in stream");
- return false;
- }
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- AZStd::string motionId;
-
- AZ::u32 numCharacters;
- if (stream->Read(&numCharacters, sizeof(AZ::u32)) != sizeof(AZ::u32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numCharacters, endianType);
-
- if (numCharacters > 0)
- {
- motionId.resize(numCharacters);
- if (stream->Read(motionId.data(), numCharacters) != numCharacters)
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- }
-
- AZ::Vector2 position;
- if (stream->Read(&position, MCore::AttributeVector2::sizeofVector2) != MCore::AttributeVector2::sizeofVector2)
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- float x = position.GetX();
- float y = position.GetY();
- MCore::Endian::ConvertFloat(&x, endianType);
- MCore::Endian::ConvertFloat(&y, endianType);
- position.Set(x, y);
-
-
- AZ::u8 streamTypeFlags;
- if (stream->Read(&streamTypeFlags, sizeof(AZ::u8)) != sizeof(AZ::u8))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- BlendSpaceNode::BlendSpaceMotion::TypeFlags typeFlags = static_cast(streamTypeFlags);
- m_value.Set(motionId, position, typeFlags);
- return true;
-}
-
-template<>
-bool LegacyAttribute>::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- // Read the number of entries
- uint32 numEntries;
- if (stream->Read(&numEntries, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numEntries, endianType);
-
- m_value.resize(numEntries);
- for (uint32 i = 0; i < numEntries; ++i)
- {
- // Read the number of string bytes to follow
- uint32 numStringBytes;
- if (stream->Read(&numStringBytes, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "LegacyParameterMask: unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numStringBytes, endianType);
- AZStd::string name;
- if (numStringBytes > 0)
- {
- name.resize(numStringBytes);
- // Read the string data
- if (stream->Read(name.data(), numStringBytes) != numStringBytes)
- {
- AZ_Error("EMotionFX", false, "LegacyParameterMask: Unable to read data in stream");
- return false;
- }
- }
- m_value[i] = name;
- }
-
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- // Read the value
- AZ::Vector2 streamValue;
- if (stream->Read(&streamValue, MCore::AttributeVector2::sizeofVector2) != MCore::AttributeVector2::sizeofVector2)
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- // Convert endian
- MCore::Endian::ConvertVector2(&streamValue, endianType);
- m_value = streamValue;
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- uint8 version;
- if(stream->Read(&version, sizeof(uint8)) != sizeof(uint8))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- switch (version)
- {
- case 1:
- {
- AZ::PackedVector3f streamValue;
- if (stream->Read(&streamValue, sizeof(AZ::PackedVector3f)) != sizeof(AZ::PackedVector3f))
- {
- return false;
- }
-
- // Convert endian
- AZ::Vector3 value(streamValue);
- MCore::Endian::ConvertVector3(&value, endianType);
-
- // Read only the degrees, automatically calculate the quaternion
- m_value.SetDegrees(value);
- const AZ::Quaternion rotation = MCore::AzEulerAnglesToAzQuat(MCore::Math::DegreesToRadians(value.GetX()), MCore::Math::DegreesToRadians(value.GetY()), MCore::Math::DegreesToRadians(value.GetZ()));
- m_value.SetRotation(rotation);
- }
- break;
- case 2:
- {
- AZ::PackedVector3f streamValue;
- if (stream->Read(&streamValue, sizeof(AZ::PackedVector3f)) != sizeof(AZ::PackedVector3f))
- {
- return false;
- }
-
- // Convert endian
- AZ::Vector3 value(streamValue);
- MCore::Endian::ConvertVector3(&value, endianType);
- m_value.SetDegrees(value);
-
- AZ::Quaternion streamValueQ;
- if (stream->Read(&streamValueQ, sizeof(AZ::Quaternion)) != sizeof(AZ::Quaternion))
- {
- return false;
- }
-
- // Convert endian
- MCore::Endian::ConvertQuaternion(&streamValueQ, endianType);
- m_value.SetRotation(streamValueQ);
- }
- break;
- case 3:
- {
- // Read the value
- AZ::PackedVector3f streamValue;
- if (stream->Read(&streamValue, sizeof(AZ::PackedVector3f)) != sizeof(AZ::PackedVector3f))
- {
- return false;
- }
-
- // Convert endian
- AZ::Vector3 value(streamValue);
- MCore::Endian::ConvertVector3(&value, endianType);
- m_value.SetDegrees(value);
-
- // Read the quaternion
- AZ::Quaternion streamValueQ;
- if (stream->Read(&streamValueQ, sizeof(AZ::Quaternion)) != sizeof(AZ::Quaternion))
- {
- return false;
- }
-
- // Convert endian
- MCore::Endian::ConvertQuaternion(&streamValueQ, endianType);
- m_value.SetRotation(streamValueQ);
-
- // Read the rotation order
- uint8 order = 0;
- if (stream->Read(&order, sizeof(uint8)) != sizeof(uint8))
- {
- return false;
- }
-
- m_value.SetOrder(static_cast(order));
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unknown version %u parsing legacy attribute rotation", version);
- return false;
- }
- break;
- }
-
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- // Read the value
- AZ::PackedVector3f streamValue(0.0f);
- if (stream->Read(&streamValue, sizeof(AZ::PackedVector3f)) != sizeof(AZ::PackedVector3f))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- // Convert endian
- AZ::Vector3 value(streamValue);
- MCore::Endian::ConvertVector3(&value, endianType);
-
- m_value = AZ::PackedVector3f(value.GetX(), value.GetY(), value.GetZ());
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- AZ_UNUSED(endianType);
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- int8 streamValue;
- if (stream->Read(&streamValue, sizeof(int8)) != sizeof(int8))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- m_value = (streamValue == 0) ? false : true;
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- // Read the number of characters
- uint32 numCharacters;
- if (stream->Read(&numCharacters, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- // Convert endian
- MCore::Endian::ConvertUnsignedInt32(&numCharacters, endianType);
- AZStd::string nodeName;
- // Read the character data
- if (numCharacters > 0)
- {
- nodeName.resize(numCharacters);
- if (stream->Read( nodeName.data(), sizeof(char) * numCharacters) != (sizeof(char) * numCharacters))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- }
-
- // Read the parent depth
- uint32 parentDepth;
- if (stream->Read(&parentDepth, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- // Convert endian
- MCore::Endian::ConvertUnsignedInt32(&parentDepth, endianType);
- m_value.first = nodeName;
- m_value.second = parentDepth;
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType streamEndianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- AZ_Error("EMotionFX", false, "Unable to skip version for legacy attribute State Filter");
- return false;
- }
-
- // Read the number of group entries
- uint32 numGroupEntries;
- if (stream->Read(&numGroupEntries, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read num groups");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numGroupEntries, streamEndianType);
-
- // Read the number of node entries
- uint32 numNodeEntries;
- if (stream->Read(&numNodeEntries, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read num nodes");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numNodeEntries, streamEndianType);
-
- // Read the group entries
- AZStd::string convTemp;
-
- AZStd::vector groupNames;
- groupNames.resize(numGroupEntries);
-
- for (uint32 i = 0; i < numGroupEntries; ++i)
- {
- // Read the number of string bytes to follow
- uint32 numStringBytes;
- if (stream->Read(&numStringBytes, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read group name size");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numStringBytes, streamEndianType);
-
- // Read the string data
- if (numStringBytes > 0)
- {
- convTemp.resize(numStringBytes);
- if (stream->Read(convTemp.data(), numStringBytes) != numStringBytes)
- {
- AZ_Error("EMotionFX", false, "Unable to read group name");
- return false;
- }
- }
- else
- {
- convTemp.clear();
- }
-
- // Add the entry to the mask
- groupNames[i] = convTemp;
- }
-
- // Read the node entries
- AZStd::vector nodeNames;
- nodeNames.resize(numNodeEntries);
- for (uint32 i = 0; i < numNodeEntries; ++i)
- {
- // Read the number of string bytes to follow
- uint32 numStringBytes;
- if (stream->Read(&numStringBytes, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read node name size");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numStringBytes, streamEndianType);
-
- // Read the string data
- if (numStringBytes > 0)
- {
- convTemp.resize(numStringBytes);
- if (stream->Read(convTemp.data(), numStringBytes) != numStringBytes)
- {
- AZ_Error("EMotionFX", false, "Unable to read node name");
- return false;
- }
- }
- else
- {
- convTemp.clear();
- }
-
- // Add the entry to the mask
- nodeNames[i] = convTemp;
- }
- m_value.SetNodeNmes(nodeNames);
- m_value.SetGroupNames(groupNames);
-
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- int32 streamValue;
- if (stream->Read(&streamValue, sizeof(int32)) != sizeof(int32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- MCore::Endian::ConvertSignedInt32(&streamValue, endianType);
- m_value = streamValue;
- return true;
-}
-
-template<>
-bool LegacyAttribute>::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- // Read the number of entries
- uint32 numEntries;
- if (stream->Read(&numEntries, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numEntries, endianType);
- m_value.resize(numEntries);
- // Read the entries
- for (uint32 i = 0; i < numEntries; ++i)
- {
- // Read the weight
- float weight;
- if (stream->Read(&weight, sizeof(float)) != sizeof(float))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertFloat(&weight, endianType);
-
- // Read the number of string bytes to follow
- uint32 numStringBytes;
- if (stream->Read(&numStringBytes, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numStringBytes, endianType);
- AZStd::string name;
-
- if (numStringBytes > 0)
- {
- name.resize(numStringBytes);
-
- // Read the string data
- if (stream->Read(name.data(), numStringBytes) != numStringBytes)
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- }
-
- // Add the entry to the mask
- m_value[i].first = name;
- m_value[i].second = weight;
- }
-
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- // Read the number of characters
- uint32 numCharacters;
- if (stream->Read(&numCharacters, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- // Convert endian
- MCore::Endian::ConvertUnsignedInt32(&numCharacters, endianType);
- if (numCharacters == 0)
- {
- m_value.clear();
- return true;
- }
-
- m_value.resize(numCharacters);
- if (stream->Read(m_value.data(), numCharacters) != numCharacters)
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- return true;
-}
-
-template<>
-bool LegacyAttribute::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Skip the version (not used byt this legacy attribute)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint8)))
- {
- return false;
- }
-
- float streamValue;
- if (stream->Read(&streamValue, sizeof(float)) != sizeof(float))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
-
- MCore::Endian::ConvertFloat(&streamValue, endianType);
-
- m_value = streamValue;
- return true;
-}
-
-template
-const T& LegacyAttribute::GetValue() const
-{
- return m_value;
-}
-
-bool LegacyAnimGraphNodeParser::GetBlendSpaceNodeEvaluatorTypeId(uint32 legacyIndex, AZ::TypeId& value)
-{
- bool result = true;
- switch (legacyIndex)
- {
- case 0:
- {
- value = azrtti_typeid();
- }
- break;
- case 1:
- {
- value = azrtti_typeid();
- }
- break;
- case 2:
- {
- value = azrtti_typeid();
- }
- break;
- case 3:
- {
- value = azrtti_typeid();
- }
- break;
- case 4:
- {
- value = azrtti_typeid();
- }
- break;
- case 5:
- {
- value = azrtti_typeid();
- }
- break;
- case 6:
- {
- value = azrtti_typeid();
- }
- break;
- case 7:
- {
- value = azrtti_typeid();
- }
- break;
- case 8:
- {
- value = azrtti_typeid();
- }
- break;
- default:
- {
- result = false;
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser::GetBlendSpaceNodeEvaluatorTypeId: Unknown typeid index");
- }
- break;
- }
- return result;
-}
-
-bool LegacyAnimGraphNodeParser::InitializeNodeGeneralData(const char* nodeName, Importer::ImportParameters& importParams, FileFormat::AnimGraph_NodeHeader& nodeHeader, AnimGraphNode* node)
-{
- AnimGraph* animGraph = importParams.mAnimGraph;
- node->SetName(nodeName);
-
- node->SetVisualPos(nodeHeader.mVisualPosX, nodeHeader.mVisualPosY);
- node->SetIsCollapsed(nodeHeader.mFlags & FileFormat::ANIMGRAPH_NODEFLAG_COLLAPSED);
-
- const AZ::Color color(
- MCore::ExtractRed(nodeHeader.mVisualizeColor)/255.0f,
- MCore::ExtractGreen(nodeHeader.mVisualizeColor)/255.0f,
- MCore::ExtractBlue(nodeHeader.mVisualizeColor)/255.0f,
- 1.0f);
- node->SetVisualizeColor(color);
-
- if (importParams.mAnimGraphSettings->mDisableNodeVisualization == false)
- {
- node->SetVisualization((nodeHeader.mFlags & FileFormat::ANIMGRAPH_NODEFLAG_VISUALIZED) != 0);
- }
- else
- {
- node->SetVisualization(false);
- }
-
- node->ReserveChildNodes(nodeHeader.mNumChildNodes);
-
- if (node->GetSupportsDisable())
- {
- node->SetIsEnabled(!(nodeHeader.mFlags & FileFormat::ANIMGRAPH_NODEFLAG_DISABLED));
- }
-
- MCore::Array& blendNodes = SharedHelperData::GetBlendNodes(importParams.mSharedData);
-
- // Add the new node to the list of loaded nodes
- blendNodes.Add(node);
-
- AZStd::map& entryNodeIndexToStateMachineIdLookupTable = SharedHelperData::GetEntryStateToStateMachineTable(importParams.mSharedData);
-
- // Add the node to the anim graph
- if (nodeHeader.mParentIndex == MCORE_INVALIDINDEX32)
- {
- AZ_Assert(azrtti_typeid(node) == azrtti_typeid(), "");
- AnimGraphStateMachine* stateMachine = static_cast(node);
-
- // Set the root state machine
- if (animGraph->GetRootStateMachine() == nullptr)
- {
- animGraph->SetRootStateMachine(stateMachine);
- }
- else
- {
- AZ_Warning("EMotionFX", false, "Anim graph already contains a root state machine. Skipping additional root state machines.");
- }
- }
- else
- {
- blendNodes[nodeHeader.mParentIndex]->AddChildNode(node);
-
- AZStd::rbtree_const_iterator> tableIter = entryNodeIndexToStateMachineIdLookupTable.find(AZ::u64(blendNodes[nodeHeader.mParentIndex]->GetId()));
- if (tableIter != entryNodeIndexToStateMachineIdLookupTable.end())
- {
- AnimGraphNode* animGraphNode = animGraph->RecursiveFindNodeById(AnimGraphNodeId((*tableIter).first));
- // The type id check will remove the pointer
- if (!animGraphNode)
- {
- AZ_Error("EMotionFX", false, "Unable to find expected State Machine that needs a registered entry state");
- AZ_Assert(false, "Unable to find expected State Machine that needs a registered entry state");
- return false;
- }
- if (azrtti_typeid(animGraphNode) != azrtti_typeid())
- {
- AZ_Error("EMotionFX", false, "Unexpected parent node type");
- AZ_Assert(false, "Unexpected parent node type");
- return false;
- }
- AnimGraphStateMachine& parentStateMachine = *(static_cast(animGraphNode));
- uint32 entryStateChildNodeIndex = (*tableIter).second;
- if (entryStateChildNodeIndex < parentStateMachine.GetNumChildNodes())
- {
- parentStateMachine.SetEntryStateId(parentStateMachine.GetChildNode(entryStateChildNodeIndex)->GetId());
- entryNodeIndexToStateMachineIdLookupTable.erase(tableIter);
- }
- }
-
- // Set the final node
- if (azrtti_typeid(node) == azrtti_typeid())
- {
- AZ_Assert(azrtti_typeid(blendNodes[nodeHeader.mParentIndex]) == azrtti_typeid(), "");
- BlendTree* blendTree = static_cast(blendNodes[nodeHeader.mParentIndex]);
- blendTree->SetFinalNodeId(node->GetId());
- }
-
- // Update the virtual final output node
- if (nodeHeader.mFlags & FileFormat::ANIMGRAPH_NODEFLAG_VIRTUALFINALOUTPUT)
- {
- AZ_Assert(azrtti_typeid(blendNodes[nodeHeader.mParentIndex]) == azrtti_typeid(), "");
- BlendTree* blendTree = static_cast(blendNodes[nodeHeader.mParentIndex]);
- blendTree->SetVirtualFinalNode(node);
- }
- return true;
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(stream);
- AZ_UNUSED(numAttributes);
- AZ_UNUSED(endianType);
- AZ_UNUSED(importParams);
- AZ_UNUSED(animGraphObject);
- // Do nothing
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(stream);
- AZ_UNUSED(numAttributes);
- AZ_UNUSED(endianType);
- AZ_UNUSED(importParams);
- AZ_UNUSED(animGraphObject);
- // Do nothing
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(stream);
- AZ_UNUSED(numAttributes);
- AZ_UNUSED(endianType);
- AZ_UNUSED(importParams);
- AZ_UNUSED(animGraphObject);
- // Do nothing
- return true;
-}
-
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeMorphTargetNode& blendTreeMorphTargetNode = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- LegacyAttributeArray legacyAttributeArrayStrings;
- if (!legacyAttributeArrayStrings.Parse(stream, endianType))
- {
- return false;
- }
- AZStd::vector morphTargetNames;
- morphTargetNames.resize(legacyAttributeArrayStrings.GetValue().size());
- for (int i = 0; i < legacyAttributeArrayStrings.GetValue().size(); i++)
- {
- morphTargetNames[i] = legacyAttributeArrayStrings.GetValue()[i].GetValue();
- }
- blendTreeMorphTargetNode.SetMorphTargetNames(morphTargetNames);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser::ParseLegacyAttributes: Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeFloatConstantNode& blendTreeFloatConstantNode = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeFloatConstantNode.SetValue(floatValue);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser::ParseLegacyAttributes: Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeLookAtNode& blendTreeLookAtNode = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeLookAtNode.SetTargetNodeName(legacyAttribute.GetValue());
- }
- break;
- case 1:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeLookAtNode.SetLimitMin(legacyAttribute.GetValue());
- }
- break;
- case 2:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeLookAtNode.SetLimitMax(legacyAttribute.GetValue());
- }
- break;
- case 3:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
-
- blendTreeLookAtNode.SetConstraintRotation(legacyAttribute.GetValue().GetRotation());
- }
- break;
- case 4:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
-
- blendTreeLookAtNode.SetPostRotation(legacyAttribute.GetValue().GetRotation());
- }
- break;
- case 5:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeLookAtNode.SetFollowSpeed(floatValue);
- }
- break;
- case 6:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- ConstraintTransformRotationAngles::EAxis axis = static_cast(static_cast(floatValue));
- blendTreeLookAtNode.SetTwistAxis(axis);
- }
- break;
- case 7:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool limitsEnabled = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- blendTreeLookAtNode.SetLimitsEnabled(limitsEnabled);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeTwoLinkIKNode& blendTreeTwoLinkIKNode = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeTwoLinkIKNode.SetEndNodeName(legacyAttribute.GetValue());
- }
- break;
- case 1:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeTwoLinkIKNode.SetEndEffectorNodeName(legacyAttribute.GetValue());
- }
- break;
- case 2:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeTwoLinkIKNode.SetAlignToNode(legacyAttribute.GetValue());
- }
- break;
- case 3:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeTwoLinkIKNode.SetBendDirNodeName(legacyAttribute.GetValue());
- }
- break;
- case 4:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool boolValue = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- blendTreeTwoLinkIKNode.SetRotationEnabled(boolValue);
- }
- break;
- case 5:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool boolValue = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- blendTreeTwoLinkIKNode.SetRelativeBendDir(boolValue);
- }
- break;
- case 6:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool boolValue = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- blendTreeTwoLinkIKNode.SetExtractBendDir(boolValue);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeFloatMath1Node& blendTreeFloatMath1Node = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- BlendTreeFloatMath1Node::EMathFunction eMathFunction = static_cast(static_cast(floatValue));
- blendTreeFloatMath1Node.SetMathFunction(eMathFunction);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AnimGraphStateTransition& animGraphStateTransition = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:// ATTRIB_DISABLED
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_DISABLED");
- return false;
- }
- bool isDisabled = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- animGraphStateTransition.SetIsDisabled(isDisabled);
- }
- break;
- case 1:// ATTRIB_PRIORITY
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_PRIORITY");
- return false;
- }
- int32 intValue = static_cast(floatValue);
- animGraphStateTransition.SetPriority(intValue);
- }
- break;
- case 2:// ATTRIB_CANBEINTERRUPTED
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_CANBEINTERRUPTED");
- return false;
- }
- bool canBeInterrupted = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- animGraphStateTransition.SetCanBeInterrupted(canBeInterrupted);
- }
- break;
- case 3:// ATTRIB_CANINTERRUPTOTHERTRANSITIONS
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_CANINTERRUPTOTHERTRANSITIONS");
- return false;
- }
- bool canInterruptOtherTransitions = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- animGraphStateTransition.SetCanInterruptOtherTransitions(canInterruptOtherTransitions);
- }
- break;
- case 4:// ATTRIB_ALLOWSELFINTERRUPTION
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_ALLOWSELFINTERRUPTION");
- return false;
- }
- bool allowSelfInterruption = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- animGraphStateTransition.SetCanInterruptItself(allowSelfInterruption);
- }
- break;
- case 5:// ATTRIB_ALLOWEDSTATES
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- AZ_Error("EMotionFX", false, "Unable to parse legacy attribute state filter");
- return false;
- }
-
- animGraphStateTransition.SetGroups(legacyAttribute.GetValue().GetGroupNames());
- AZStd::vector nodeIDs;
- nodeIDs.resize(legacyAttribute.GetValue().GetNodeNames().size());
- int index = 0;
- for (int i = 0; i < legacyAttribute.GetValue().GetNodeNames().size(); i++)
- {
- AnimGraphNode* node = importParams.mAnimGraph->RecursiveFindNodeByName(legacyAttribute.GetValue().GetNodeNames()[i].c_str());
- if (!node)
- {
- AZ_Warning("EMotionFX", false, "Missing allowed wild card transition on node (%s): The state (%s) in the allowed source state list does not exist in the graph. Removing."
- , animGraphStateTransition.GetTargetNode()->GetName(), legacyAttribute.GetValue().GetNodeNames()[i].c_str());
- }
- else
- {
- nodeIDs[index++] = node->GetId();
- }
- }
- animGraphStateTransition.SetStateIds(nodeIDs);
- }
- break;
- case 6:// ATTRIB_BLENDTIME
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_BLENDTIME");
- return false;
- }
- animGraphStateTransition.SetBlendTime(floatValue);
- }
- break;
- case 7:// ATTRIB_SYNC
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_SYNC");
- return false;
- }
- AnimGraphStateTransition::ESyncMode eSyncMode = static_cast(static_cast(floatValue));
- animGraphStateTransition.SetSyncMode(eSyncMode);
- }
- break;
- case 8:// ATTRIB_EVENTMODE
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_EVENTMODE");
- return false;
- }
- AnimGraphStateTransition::EEventMode eventMode = static_cast(static_cast(floatValue));
- animGraphStateTransition.SetEventFilterMode(eventMode);
- }
- break;
- case 9:// ATTRIB_INTERPOLATIONTYPE
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_INTERPOLATIONTYPE");
- return false;
- }
- AnimGraphStateTransition::EInterpolationType interpolationType = static_cast(static_cast(floatValue));
- animGraphStateTransition.SetInterpolationType(interpolationType);
- }
- break;
- case 10:// ATTRIB_EASEIN_SMOOTH
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_EASEIN_SMOOTH");
- return false;
- }
- animGraphStateTransition.SetEaseInSmoothness(floatValue);
- }
- break;
- case 11:// ATTRIB_EASEOUT_SMOOTH
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- AZ_Error("EMotionFX", false, "Unable to parse ATTRIB_EASEOUT_SMOOTH");
- return false;
- }
- animGraphStateTransition.SetEaseOutSmoothness(floatValue);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count parsing AnimGraphStateTransition");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- AnimGraphStateMachine& animGraphStateMachine = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool alwaysStartInEntryState = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- animGraphStateMachine.SetAlwaysStartInEntryState(alwaysStartInEntryState);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeRangeRemapperNode& blendTreeRangeRemapperNode = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeRangeRemapperNode.SetInputMin(floatValue);
- }
- break;
- case 1:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeRangeRemapperNode.SetInputMax(floatValue);
- }
- break;
- case 2:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeRangeRemapperNode.SetOutputMin(floatValue);
- }
- break;
- case 3:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeRangeRemapperNode.SetOutputMax(floatValue);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeSmoothingNode& blendTreeSmoothingNode = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeSmoothingNode.SetInterpolationSpeed(floatValue);
- }
- break;
- case 1:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool useStartValue = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- blendTreeSmoothingNode.SetUseStartVAlue(useStartValue);
- }
- break;
- case 2:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeSmoothingNode.SetStartVAlue(floatValue);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeVector3Math2Node& blendTreeVector3Math2Node = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- BlendTreeVector3Math2Node::EMathFunction eMathFunction = static_cast(static_cast(floatValue));
- blendTreeVector3Math2Node.SetMathFunction(eMathFunction);
- }
- break;
- case 1:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeVector3Math2Node.SetDefaultValue(AZ::Vector3(legacyAttribute.GetValue()));
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeVector3Math1Node& blendTreeVector3Math1Node = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- BlendTreeVector3Math1Node::EMathFunction eMathFunction = static_cast(static_cast(floatValue));
- blendTreeVector3Math1Node.SetMathFunction(eMathFunction);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeFloatMath2Node& blendTreeFloatMath2Node = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- BlendTreeFloatMath2Node::EMathFunction eMathFunction = static_cast(static_cast(floatValue));
- blendTreeFloatMath2Node.SetMathFunction(eMathFunction);
- }
- break;
- case 1:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- blendTreeFloatMath2Node.SetDefaultValue(floatValue);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
- }
- }
- }
- return true;
-}
-
-template<>
-bool LegacyAnimGraphNodeParser::ParseLegacyAttributes(MCore::File* stream,
- uint32 numAttributes,
- MCore::Endian::EEndianType endianType,
- Importer::ImportParameters& importParams,
- AnimGraphObject& animGraphObject)
-{
- AZ_UNUSED(importParams);
- BlendTreeBlend2LegacyNode& blendTreeBlend2Node = static_cast(animGraphObject);
- // For all attributes
- for (uint32 parsedAttributeCount = 0; parsedAttributeCount < numAttributes; ++parsedAttributeCount)
- {
- LegacyAttributeHeader legacyAttributeHeader;
- if (!LegacyAttributeHeader::Parse(stream, endianType, legacyAttributeHeader))
- {
- AZ_Error("EMotionFX", false, "Unable to parse attribute header");
- return false;
- }
-
- if (legacyAttributeHeader.GetAttributeSize() > 0)
- {
- switch (parsedAttributeCount)
- {
- case 0:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- AnimGraphObject::ESyncMode syncMode = static_cast(static_cast(floatValue));
- blendTreeBlend2Node.SetSyncMode(syncMode);
- }
- break;
- case 1:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- AnimGraphObject::EEventMode eventMode = static_cast(static_cast(floatValue));
- blendTreeBlend2Node.SetEventMode(eventMode);
- }
- break;
- case 2:
- {
- LegacyAttribute> legacyAttributeNodeMask;
- if (!legacyAttributeNodeMask.Parse(stream, endianType))
- {
- return false;
- }
- blendTreeBlend2Node.SetWeightedNodeMask(legacyAttributeNodeMask.GetValue());
- }
- break;
- case 3:
- {
- float floatValue;
- if (!LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(stream, endianType, legacyAttributeHeader, floatValue))
- {
- return false;
- }
- bool isAdditive = LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(floatValue);
- blendTreeBlend2Node.SetAdditiveBlending(isAdditive);
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute count");
- return false;
- }
- break;
-
- }
- }
- }
- return true;
-}
-
-bool LegacyAnimGraphNodeParser::ConvertFloatAttributeValueToBool(float value)
-{
- return value > MCore::Math::epsilon;
-}
-
-bool LegacyAnimGraphNodeParser::TryGetFloatFromAttribute(MCore::File* stream
- , MCore::Endian::EEndianType endianType
- , const LegacyAttributeHeader& attributeHeader
- , float& outputValue)
-{
- bool result = true;
- switch (attributeHeader.GetAttributeType())
- {
- case EMotionFX::LegacyAttributeTypeId::ATTRIBUTE_BOOL_TYPE_ID:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- result = false;
- }
- else
- {
- outputValue = legacyAttribute.GetValue() ? 1.0f : 0.0f;
- }
- }
- break;
- case EMotionFX::LegacyAttributeTypeId::ATTRIBUTE_INT32_TYPE_ID:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- result = false;
- }
- else
- {
- outputValue = static_cast(legacyAttribute.GetValue());
- }
- }
- break;
- case EMotionFX::LegacyAttributeTypeId::ATTRIBUTE_FLOAT_TYPE_ID:
- {
- LegacyAttribute legacyAttribute;
- if (!legacyAttribute.Parse(stream, endianType))
- {
- result = false;
- }
- outputValue = legacyAttribute.GetValue();
- }
- break;
- default:
- {
- AZ_Error("EMotionFX", false, "Unexpected attribute type");
- result = false;
- }
- break;
- }
- if (!result)
- {
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser::TryGetFloatFromAttribute Unable to parse attribute value");
- }
- return result;
-}
-
-bool LegacyAttributeHeader::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType, LegacyAttributeHeader& attributeHeader)
-{
- AZStd::string name;
- name.resize(32);
-
- // Read the attribute size
- uint32 attribType;
- if (stream->Read(&attribType, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&attribType, endianType);
-
- // Read the attribute size
- uint32 attributeSize;
- if (stream->Read(&attributeSize, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&attributeSize, endianType);
-
- // First read the number of characters
- uint32 numCharacters;
- if (stream->Read(&numCharacters, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numCharacters, endianType);
-
- // Read the string
- if (numCharacters > 0)
- {
- name.resize(numCharacters);
- if (stream->Read(name.data(), numCharacters) != numCharacters)
- {
- AZ_Error("EMotionFX", false, "Unable to read data in stream");
- return false;
- }
- }
-
- attributeHeader.m_attribType = attribType;
- attributeHeader.m_attributeSize = attributeSize;
- attributeHeader.m_name = name;
- return true;
-}
-
-template class LegacyAttribute>
-bool LegacyAttributeArray::PopulateAttributeDynamicArray(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Read the number of values
- uint32 numValues;
- if (stream->Read(&numValues, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numValues, endianType);
-
- for (uint32 i = 0; i < numValues; ++i)
- {
- LegacyAttribute legacyAttribute;
- legacyAttribute.Parse(stream, endianType);
- m_attributes.push_back(legacyAttribute);
- }
- return true;
-}
-
-template class LegacyAttribute>
-bool LegacyAttributeArray::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Write the version of the attribute settings format
- uint8 version;
- if (stream->Read(&version, sizeof(uint8)) != sizeof(uint8))
- {
- AZ_Error("EMotionFX", false, "LegacyAttributeArray::Parse - Failed to read the attribute version.");
- return false;
- }
- if (version == 2)
- {
- // Read the attribute type id
- uint32 attribType;
- if (stream->Read(&attribType, sizeof(uint32)) != sizeof(uint32))
- {
- AZ_Error("EMotionFX", false, "AttributeArray::ReadData() - Failed to read the attribute type ID.");
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&attribType, endianType);
- m_elementTypeId = attribType;
-
- if (!LegacyAttributeSettingsParser::Parse(stream, endianType))
- {
- return false;
- }
- }
- return PopulateAttributeDynamicArray(stream, endianType);
-}
-
-template class LegacyAttribute>
-const AZStd::vector< LegacyAttribute > & LegacyAttributeArray::GetValue() const
-{
- return m_attributes;
-}
-
-bool LegacyAttributeSettingsParser::Parse(MCore::File* stream, MCore::Endian::EEndianType endianType)
-{
- // Write the version of the attribute settings format
- uint8 version;
- if (stream->Read(&version, sizeof(uint8)) != sizeof(uint8))
- {
- AZ_Error("EMotionFX", false, "LegacyAttributeSettingsParser::Parse - Failed to read the attribute version.");
- return false;
- }
-
- if (version == 2)
- {
- // Read the flags (new in version 2)
- uint16 flags = 0;
- if (stream->Read(&flags, sizeof(uint16)) != sizeof(uint16))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt16(&flags, endianType);
- }
-
- // Read the internal name
- uint32 numChars;
- if (stream->Read(&numChars, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numChars, endianType);
-
- AZStd::string tempString;
- if (numChars > 0)
- {
- tempString.resize(numChars);
- if (stream->Read(tempString.data(), numChars) != numChars)
- {
- return false;
- }
- }
-
- // Read the name
- if (stream->Read(&numChars, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numChars, endianType);
- tempString.clear();
- if (numChars > 0)
- {
- tempString.resize(numChars);
- if (stream->Read(tempString.data(), numChars) != numChars)
- {
- return false;
- }
- }
-
- // Read the description
- if (stream->Read(&numChars, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numChars, endianType);
- tempString.clear();
- if (numChars > 0)
- {
- tempString.resize(numChars);
- if (stream->Read(tempString.data(), numChars) != numChars)
- {
- return false;
- }
- }
-
- // Read the interface type
- uint32 interfaceType;
- if (stream->Read(&interfaceType, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&interfaceType, endianType);
-
- // Read the number of combobox values
- uint32 numComboValues;
- if (stream->Read(&numComboValues, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numComboValues, endianType);
-
- // Read the combo strings
- for (uint32 i = 0; i < numComboValues; ++i)
- {
- tempString.clear();
- if (stream->Read(&numChars, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&numChars, endianType);
- if (numChars > 0)
- {
- tempString.resize(numChars);
- if (stream->Read(tempString.data(), numChars) != numChars)
- {
- return false;
- }
- }
- }
-
- for (int skipCounter = 0; skipCounter < 3; ++skipCounter)
- {
- // Skipping attribute type (default value of settings)
- if (!LegacyAnimGraphNodeParser::Forward(stream, sizeof(uint32)))
- {
- return false;
- }
-
- // Read the attribute size
- uint32 attributeSize;
- if (stream->Read(&attributeSize, sizeof(uint32)) != sizeof(uint32))
- {
- return false;
- }
- MCore::Endian::ConvertUnsignedInt32(&attributeSize, endianType);
- // Skipping attribute content (default value of settings)
- if (!LegacyAnimGraphNodeParser::Forward(stream, attributeSize))
- {
- return false;
- }
- }
-
- return true;
-}
-
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute>;
-template class LegacyAttribute>;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttribute;
-template class LegacyAttributeArray;
-template class LegacyAttributeArray;
-
-
-bool LegacyAnimGraphNodeParser::ParseTransitionConditionChunk(MCore::File* file,
- Importer::ImportParameters& importParams,
- const FileFormat::AnimGraph_NodeHeader& nodeHeader,
- AnimGraphTransitionCondition*& transitionCondition)
-{
- const AZ::TypeId conditionType = GetNewTypeIdByOldNodeTypeId(nodeHeader.mTypeID);
- if (conditionType.IsNull())
- {
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser: Cannot convert legacy transition condition id '0x%x' to uuid.", nodeHeader.mTypeID);
- return false;
- }
-
- if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphMotionCondition");
- return false;
- }
- }
- else if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphParameterCondition");
- return false;
- }
- transitionCondition->SetAnimGraph(importParams.mAnimGraph);
- }
- else if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphPlayTimeCondition");
- return false;
- }
- }
- else if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphStateCondition");
- return false;
- }
- }
- else if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphTagCondition");
- return false;
- }
- }
- else if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphTimeCondition");
- return false;
- }
- }
- else if (conditionType == azrtti_typeid())
- {
- if (!ParseAnimGraphTransitionCondition(file, importParams, nodeHeader, transitionCondition))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphVector2Condition");
- return false;
- }
- }
- else
- {
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser: Cannot parse transition condition with uuid %s. No node parser available", conditionType.ToString().c_str());
- return false;
- }
-
- return true;
-}
-
-
-bool LegacyAnimGraphNodeParser::ParseAnimGraphNodeChunk(MCore::File* file,
- Importer::ImportParameters& importParams,
- const char* nodeName,
- FileFormat::AnimGraph_NodeHeader& nodeHeader,
- AnimGraphNode*& node)
-{
- const AZ::TypeId nodeType = GetNewTypeIdByOldNodeTypeId(nodeHeader.mTypeID);
- if (nodeType.IsNull())
- {
- AZ_Error("EMotionFX", false, "LegacyAnimGraphNodeParser: Cannot convert legacy node id '0x%x' to uuid.", nodeHeader.mTypeID);
- return false;
- }
-
- if (nodeType == azrtti_typeid())
- {
- if (!LegacyAnimGraphNodeParser::ParseAnimGraphNode(file, importParams, nodeName, nodeHeader, node))
- {
- AZ_Error("EMotionFX", false, "Unable to parse AnimGraphBindPoseNode");
- return false;
- }
- }
- else if (nodeType == azrtti_typeid())
- {
- if (!LegacyAnimGraphNodeParser::ParseAnimGraphNode(file, importParams, nodeName, nodeHeader, node))
- {
- AZ_Error("EMotionFX", false, "Unable to parse BlendTree");
- return false;
- }
- }
- else if (nodeType == azrtti_typeid())
- {
- if (!LegacyAnimGraphNodeParser::ParseAnimGraphNode(file, importParams, nodeName, nodeHeader, node))
- {
- AZ_Error("EMotionFX", false, "Unable to parse BlendTreeFinalNode");
- return false;
- }
- }
- else if (nodeType == azrtti_typeid())
- {
- if (!LegacyAnimGraphNodeParser::ParseAnimGraphNode(file, importParams, nodeName, nodeHeader, node))
- {
- AZ_Error("EMotionFX", false, "Unable to parse BlendTreeMotionFrameNode");
- return false;
- }
- }
- else if (nodeType == azrtti_typeid())
- {
- if (!LegacyAnimGraphNodeParser::ParseAnimGraphNode(file, importParams, nodeName, nodeHeader, node))
- {
- AZ_Error("EMotionFX", false, "Unable to parse BlendTreeBlendNNode");
- return false;
- }
- }
- else if (nodeType == azrtti_typeid())
- {
- if (!LegacyAnimGraphNodeParser::ParseAnimGraphNode(file, importParams, nodeName, nodeHeader, node))
- {
- AZ_Error("EMotionFX", false, "Unable to parse BlendTreeFloatConditionNode");
- return false;
- }
- }
- else if (nodeType == azrtti_typeid