Removed legacy anim graph node parsers and legacy file format chunks
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
This commit is contained in:
@@ -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 <MCore/Source/Attribute.h>
|
||||
#include <EMotionFX/Source/Parameter/BoolParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/ColorParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/FloatSliderParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/FloatSpinnerParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/IntSliderParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/IntSpinnerParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/TagParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/RotationParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/StringParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/Vector2Parameter.h>
|
||||
#include <EMotionFX/Source/Parameter/Vector3GizmoParameter.h>
|
||||
#include <EMotionFX/Source/Parameter/Vector3Parameter.h>
|
||||
#include <EMotionFX/Source/Parameter/Vector4Parameter.h>
|
||||
|
||||
namespace EMotionFX
|
||||
{
|
||||
namespace FileFormat
|
||||
{
|
||||
AZ::TypeId GetParameterTypeIdForInterfaceType(uint32 interfaceType)
|
||||
{
|
||||
switch (interfaceType)
|
||||
{
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_FLOATSPINNER:
|
||||
return azrtti_typeid<EMotionFX::FloatSpinnerParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_FLOATSLIDER:
|
||||
return azrtti_typeid<EMotionFX::FloatSliderParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_INTSPINNER:
|
||||
return azrtti_typeid<EMotionFX::IntSpinnerParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_INTSLIDER:
|
||||
return azrtti_typeid<EMotionFX::IntSliderParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_CHECKBOX:
|
||||
return azrtti_typeid<EMotionFX::BoolParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR2:
|
||||
return azrtti_typeid<EMotionFX::Vector2Parameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3GIZMO:
|
||||
return azrtti_typeid<EMotionFX::Vector3GizmoParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR4:
|
||||
return azrtti_typeid<EMotionFX::Vector4Parameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_COLOR:
|
||||
return azrtti_typeid<EMotionFX::ColorParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_STRING:
|
||||
return azrtti_typeid<EMotionFX::StringParameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3:
|
||||
return azrtti_typeid<EMotionFX::Vector3Parameter>();
|
||||
case MCore::ATTRIBUTE_INTERFACETYPE_TAG:
|
||||
return azrtti_typeid<EMotionFX::TagParameter>();
|
||||
|
||||
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<EMotionFX::FloatSpinnerParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_FLOATSPINNER;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::FloatSliderParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_FLOATSLIDER;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::IntSpinnerParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_INTSPINNER;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::IntSliderParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_INTSLIDER;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::BoolParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_CHECKBOX;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::Vector2Parameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR2;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::Vector3GizmoParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3GIZMO;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::Vector4Parameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR4;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::ColorParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_COLOR;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::StringParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_STRING;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::Vector3Parameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_VECTOR3;
|
||||
}
|
||||
else if (parameterTypeId == azrtti_typeid<EMotionFX::TagParameter>())
|
||||
{
|
||||
return MCore::ATTRIBUTE_INTERFACETYPE_TAG;
|
||||
}
|
||||
return MCORE_INVALIDINDEX32;
|
||||
}
|
||||
}
|
||||
} // namespace EMotionFX
|
||||
@@ -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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,259 +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 <AzCore/std/string/string.h>
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <MCore/Source/Endian.h>
|
||||
#include <MCore/Source/LogManager.h>
|
||||
#include "Importer.h"
|
||||
#include "AnimGraphFileFormat.h"
|
||||
#include "../AnimGraphObject.h"
|
||||
#include <MCore/Source/File.h>
|
||||
#include <EMotionFX/Source/AnimGraphObjectIds.h>
|
||||
#include "../AnimGraphNode.h"
|
||||
|
||||
|
||||
namespace EMotionFX
|
||||
{
|
||||
class AnimGraphNode;
|
||||
class AnimGraphStateMachine;
|
||||
class AnimGraphStateTransition;
|
||||
class AnimGraphTransitionCondition;
|
||||
class BlendTreeVector4ComposeNode;
|
||||
class BlendTreeVector3ComposeNode;
|
||||
class BlendTreeVector2ComposeNode;
|
||||
class BlendTreeMorphTargetNode;
|
||||
class BlendTreeFloatConstantNode;
|
||||
class BlendTreeLookAtNode;
|
||||
class BlendTreeTwoLinkIKNode;
|
||||
class BlendTreeFloatMath1Node;
|
||||
class AnimGraphStateTransition;
|
||||
class AnimGraphStateMachine;
|
||||
class BlendTreeRangeRemapperNode;
|
||||
class BlendTreeSmoothingNode;
|
||||
class BlendTreeVector3Math2Node;
|
||||
class BlendTreeVector3Math1Node;
|
||||
class BlendTreeFloatMath2Node;
|
||||
class BlendTreeBlend2LegacyNode;
|
||||
class AnimGraphVector2Condition;
|
||||
class AnimGraphTimeCondition;
|
||||
class AnimGraphTagCondition;
|
||||
class AnimGraphStateCondition;
|
||||
class AnimGraphPlayTimeCondition;
|
||||
class AnimGraphParameterCondition;
|
||||
class AnimGraphMotionCondition;
|
||||
class BlendTreeBlendNNode;
|
||||
class BlendTreeMaskLegacyNode;
|
||||
class BlendTreeTransformNode;
|
||||
class BlendTreeAccumTransformNode;
|
||||
class AnimGraphMotionNode;
|
||||
class BlendTreeVector4DecomposeNode;
|
||||
class BlendTreeVector3DecomposeNode;
|
||||
class BlendTreeVector2DecomposeNode;
|
||||
class BlendTree;
|
||||
class BlendTreePoseSwitchNode;
|
||||
class BlendSpace2DNode;
|
||||
class BlendSpace1DNode;
|
||||
class BlendTreeParameterNode;
|
||||
class AnimGraphExitNode;
|
||||
class AnimGraphEntryNode;
|
||||
class BlendTreeMirrorPoseNode;
|
||||
class BlendTreeDirectionToWeightNode;
|
||||
class AnimGraphBindPoseNode;
|
||||
class BlendTreeFinalNode;
|
||||
class AnimGraphNode;
|
||||
class BlendTreeMotionFrameNode;
|
||||
class BlendTreeFloatConditionNode;
|
||||
class BlendTreeFloatSwitchNode;
|
||||
class BlendTreeBoolLogicNode;
|
||||
|
||||
const AZ::TypeId GetNewTypeIdByOldNodeTypeId(uint32 oldNodeTypeId);
|
||||
|
||||
enum LegacyAttributeTypeId
|
||||
{
|
||||
ATTRIBUTE_FLOAT_TYPE_ID = 0x00000001,
|
||||
ATTRIBUTE_INT32_TYPE_ID = 0x00000002,
|
||||
ATTRIBUTE_BOOL_TYPE_ID = 0x00000004
|
||||
};
|
||||
|
||||
enum LegacyERotationOrder
|
||||
{
|
||||
ROTATIONORDER_ZYX = 0,
|
||||
ROTATIONORDER_ZXY = 1,
|
||||
ROTATIONORDER_YZX = 2,
|
||||
ROTATIONORDER_YXZ = 3,
|
||||
ROTATIONORDER_XYZ = 4,
|
||||
ROTATIONORDER_XZY = 5
|
||||
};
|
||||
|
||||
|
||||
class LegacyAttributeHeader
|
||||
{
|
||||
public:
|
||||
LegacyAttributeHeader() { }
|
||||
|
||||
AZ::u32 GetAttributeType() const
|
||||
{
|
||||
return m_attribType;
|
||||
}
|
||||
|
||||
AZ::u32 GetAttributeSize() const
|
||||
{
|
||||
return m_attributeSize;
|
||||
}
|
||||
|
||||
static bool Parse(MCore::File* stream, MCore::Endian::EEndianType endianType, LegacyAttributeHeader& attributeHeader);
|
||||
private:
|
||||
LegacyAttributeHeader(const LegacyAttributeHeader& src) :
|
||||
m_attribType(src.m_attribType)
|
||||
, m_attributeSize(src.m_attributeSize)
|
||||
, m_name(src.m_name)
|
||||
{ }
|
||||
|
||||
AZ::u32 m_attribType;
|
||||
AZ::u32 m_attributeSize;
|
||||
AZStd::string m_name;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class LegacyAttribute
|
||||
{
|
||||
public:
|
||||
bool Parse(MCore::File* stream, MCore::Endian::EEndianType endianType);
|
||||
const T& GetValue() const;
|
||||
private:
|
||||
T m_value;
|
||||
};
|
||||
|
||||
class LegacyAnimGraphNodeParser
|
||||
{
|
||||
public:
|
||||
static bool ParseAnimGraphNodeChunk(MCore::File* file,
|
||||
Importer::ImportParameters& importParams,
|
||||
const char* nodeName,
|
||||
FileFormat::AnimGraph_NodeHeader& nodeHeader,
|
||||
AnimGraphNode*& node);
|
||||
|
||||
static bool ParseTransitionConditionChunk(MCore::File* file,
|
||||
Importer::ImportParameters& importParams,
|
||||
const FileFormat::AnimGraph_NodeHeader& nodeHeader,
|
||||
AnimGraphTransitionCondition*& transitionCondition);
|
||||
|
||||
template <class T>
|
||||
static bool ParseLegacyAttributes(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
|
||||
static bool Forward(MCore::File* stream, size_t numBytes);
|
||||
|
||||
private:
|
||||
static bool InitializeNodeGeneralData(const char* nodeName, Importer::ImportParameters& importParams, FileFormat::AnimGraph_NodeHeader& nodeHeader, AnimGraphNode* node);
|
||||
static bool GetBlendSpaceNodeEvaluatorTypeId(uint32 legacyIndex, AZ::TypeId& value);
|
||||
static bool ConvertFloatAttributeValueToBool(float value);
|
||||
static bool TryGetFloatFromAttribute(MCore::File* stream, MCore::Endian::EEndianType endianType, const LegacyAttributeHeader& attributeHeader, float& outputValue);
|
||||
|
||||
template <class T>
|
||||
static bool ParseAnimGraphNode(MCore::File* file,
|
||||
Importer::ImportParameters& importParams,
|
||||
const char* nodeName,
|
||||
FileFormat::AnimGraph_NodeHeader& nodeHeader,
|
||||
AnimGraphNode*& node)
|
||||
{
|
||||
node = aznew T();
|
||||
node->SetAnimGraph(importParams.mAnimGraph);
|
||||
if (!InitializeNodeGeneralData(nodeName, importParams, nodeHeader, node))
|
||||
{
|
||||
MCore::LogError("Error on initializing node general data");
|
||||
return false;
|
||||
}
|
||||
if (!ParseLegacyAttributes<T>(file, nodeHeader.mNumAttributes, importParams.mEndianType, importParams, *node))
|
||||
{
|
||||
MCore::LogError("Unable to parse node legacy attributes");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static bool ParseAnimGraphTransitionCondition(MCore::File* file,
|
||||
Importer::ImportParameters& importParams,
|
||||
const FileFormat::AnimGraph_NodeHeader& header,
|
||||
AnimGraphTransitionCondition*& transitionCondition)
|
||||
{
|
||||
transitionCondition = aznew T();
|
||||
return ParseLegacyAttributes<T>(file, header.mNumAttributes, importParams.mEndianType, importParams, *transitionCondition);
|
||||
}
|
||||
};
|
||||
|
||||
template<class T, template<class> class LegacyAttribute>
|
||||
class LegacyAttributeArray
|
||||
{
|
||||
public:
|
||||
bool Parse(MCore::File* stream, MCore::Endian::EEndianType endianType);
|
||||
const AZStd::vector< LegacyAttribute<T> >& GetValue() const;
|
||||
private:
|
||||
bool PopulateAttributeDynamicArray(MCore::File* stream, MCore::Endian::EEndianType endianType);
|
||||
|
||||
AZStd::vector< LegacyAttribute<T> > m_attributes;
|
||||
// Used when reading version 2 attribute array
|
||||
uint32 m_elementTypeId;
|
||||
};
|
||||
|
||||
class LegacyAttributeSettingsParser
|
||||
{
|
||||
public:
|
||||
static bool Parse(MCore::File* stream, MCore::Endian::EEndianType endianType);
|
||||
};
|
||||
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector4ComposeNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector3ComposeNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector2ComposeNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeMorphTargetNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeFloatConstantNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeLookAtNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeTwoLinkIKNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeFloatMath1Node>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphStateTransition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphStateMachine>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeRangeRemapperNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeSmoothingNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector3Math2Node>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector3Math1Node>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeFloatMath2Node>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeBlend2LegacyNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphVector2Condition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphTimeCondition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphTagCondition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphStateCondition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphPlayTimeCondition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphParameterCondition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphMotionCondition>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeBlendNNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeMaskLegacyNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeTransformNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeAccumTransformNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphMotionNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector4DecomposeNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector3DecomposeNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeVector2DecomposeNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTree>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreePoseSwitchNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendSpace2DNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendSpace1DNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeParameterNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphExitNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphEntryNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeMirrorPoseNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeDirectionToWeightNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphBindPoseNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeFinalNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<AnimGraphNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeMotionFrameNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeFloatConditionNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeFloatSwitchNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
template<> bool LegacyAnimGraphNodeParser::ParseLegacyAttributes<BlendTreeBoolLogicNode>(MCore::File* stream, uint32 numAttributes, MCore::Endian::EEndianType endianType, Importer::ImportParameters& importParams, AnimGraphObject& animGraphObject);
|
||||
} // Namespace EMotionFX
|
||||
@@ -1,60 +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 the shared structs
|
||||
#include "SharedFileFormatStructs.h"
|
||||
|
||||
|
||||
namespace EMotionFX
|
||||
{
|
||||
namespace FileFormat
|
||||
{
|
||||
// the chunks
|
||||
enum
|
||||
{
|
||||
CHUNK_MOTIONSET = 500
|
||||
};
|
||||
|
||||
|
||||
struct MotionSet_Header
|
||||
{
|
||||
uint8 mFourCC[4]; // must be "MOS "
|
||||
uint8 mHiVersion; // high version (2 in case of v2.34)
|
||||
uint8 mLoVersion; // low version (34 in case of v2.34)
|
||||
uint8 mEndianType; // the endian in which the data is saved [0=little, 1=big]
|
||||
};
|
||||
|
||||
|
||||
struct MotionSetsChunk
|
||||
{
|
||||
uint32 mNumSets; // the number of motion sets
|
||||
|
||||
// followed by:
|
||||
// motionSets[mNumSets]
|
||||
};
|
||||
|
||||
|
||||
struct MotionSetChunk
|
||||
{
|
||||
uint32 mNumChildSets; // the number of child motion sets
|
||||
uint32 mNumMotionEntries; // the number of motion entries
|
||||
|
||||
// followed by:
|
||||
// string : the name of the parent set
|
||||
// string : the name of the motion set
|
||||
// string : the filename and path information (e.g. "Root/Motions/Human_Male/" // obsolete, this got removed and is now just an empty string
|
||||
// motionEntries[mNumMotionEntries]: motion entries
|
||||
// MotionEntry:
|
||||
// string : motion filename without path (e.g. "Walk.motion")
|
||||
// string : motion set string id (e.g. "WALK")
|
||||
};
|
||||
} // namespace FileFormat
|
||||
} // namespace EMotionFX
|
||||
|
||||
Reference in New Issue
Block a user