AnimSerializer.cpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <IMovieSystem.h>
  9. #include <Range.h>
  10. #include <AnimKey.h>
  11. #include <Maestro/Types/AssetBlendKey.h>
  12. #include "AnimSerializer.h"
  13. #include <AzCore/Serialization/SerializeContext.h>
  14. void AnimSerializer::ReflectAnimTypes(AZ::ReflectContext* context)
  15. {
  16. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context); serializeContext != nullptr)
  17. {
  18. // Reflection for Maestro's AZ_TYPE_INFO'ed classes
  19. serializeContext->Class<CAnimParamType>()
  20. ->Version(1)
  21. ->Field("Type", &CAnimParamType::m_type)
  22. ->Field("Name", &CAnimParamType::m_name);
  23. serializeContext->Class<Range>()
  24. ->Field("Start", &Range::start)
  25. ->Field("End", &Range::end);
  26. // Curve Key classes
  27. serializeContext->Class<IKey>()
  28. ->Field("Time", &IKey::time)
  29. ->Field("Flags", &IKey::flags);
  30. serializeContext->Class<AZ::IAssetBlendKey, ITimeRangeKey>()
  31. ->Field("AssetId", &AZ::IAssetBlendKey::m_assetId)
  32. ->Field("Description", &AZ::IAssetBlendKey::m_description)
  33. ->Field("BlendInTime", &AZ::IAssetBlendKey::m_blendInTime)
  34. ->Field("BlendOutTime", &AZ::IAssetBlendKey::m_blendOutTime);
  35. serializeContext->Class<IBoolKey, IKey>();
  36. serializeContext->Class<ICaptureKey, IKey>()
  37. ->Field("Duration", &ICaptureKey::duration)
  38. ->Field("TimeStep", &ICaptureKey::timeStep)
  39. ->Field("Folder", &ICaptureKey::folder)
  40. ->Field("Once", &ICaptureKey::once)
  41. ->Field("FilePrefix", &ICaptureKey::prefix);
  42. serializeContext->Class<ICharacterKey, ITimeRangeKey>()
  43. ->Field("Animation", &ICharacterKey::m_animation)
  44. ->Field("BlendGap", &ICharacterKey::m_bBlendGap)
  45. ->Field("PlayInPlace", &ICharacterKey::m_bInPlace);
  46. serializeContext->Class<ICommentKey, IKey>()
  47. ->Field("Comment", &ICommentKey::m_strComment)
  48. ->Field("Duration", &ICommentKey::m_duration)
  49. ->Field("Font", &ICommentKey::m_strFont)
  50. ->Field("Color", &ICommentKey::m_color)
  51. ->Field("Size", &ICommentKey::m_size)
  52. ->Field("Align", &ICommentKey::m_align);
  53. serializeContext->Class<IConsoleKey, IKey>()
  54. ->Field("Command", &IConsoleKey::command);
  55. serializeContext->Class<IDiscreteFloatKey, IKey>()
  56. ->Field("Value", &IDiscreteFloatKey::m_fValue);
  57. serializeContext->Class<IEventKey, IKey>()
  58. ->Field("Event", &IEventKey::event)
  59. ->Field("EventValue", &IEventKey::eventValue)
  60. ->Field("Anim", &IEventKey::animation)
  61. ->Field("Target", &IEventKey::target)
  62. ->Field("Length", &IEventKey::duration);
  63. serializeContext->Class<ILookAtKey, IKey>()
  64. ->Field("LookAtNodeName", &ILookAtKey::szSelection)
  65. ->Field("LookPose", &ILookAtKey::lookPose)
  66. ->Field("Duration", &ILookAtKey::fDuration)
  67. ->Field("SmoothTime", &ILookAtKey::smoothTime);
  68. serializeContext->Class<IScreenFaderKey, IKey>()
  69. ->Field("FadeTime", &IScreenFaderKey::m_fadeTime)
  70. ->Field("FadeColor", &IScreenFaderKey::m_fadeColor)
  71. ->Field("FadeType", &IScreenFaderKey::m_fadeType)
  72. ->Field("FadeChangeType", &IScreenFaderKey::m_fadeChangeType)
  73. ->Field("Texture", &IScreenFaderKey::m_strTexture)
  74. ->Field("useCurColor", &IScreenFaderKey::m_bUseCurColor);
  75. serializeContext->Class<ISelectKey, IKey>()
  76. ->Field("SelectedName", &ISelectKey::szSelection)
  77. ->Field("SelectedEntityId", &ISelectKey::cameraAzEntityId)
  78. ->Field("Duration", &ISelectKey::fDuration)
  79. ->Field("BlendTime", &ISelectKey::fBlendTime);
  80. serializeContext->Class<ISequenceKey, IKey>()
  81. ->Field("Node", &ISequenceKey::szSelection)
  82. ->Field("SequenceEntityId", &ISequenceKey::sequenceEntityId)
  83. ->Field("OverrideTimes", &ISequenceKey::bOverrideTimes)
  84. ->Field("StartTime", &ISequenceKey::fStartTime)
  85. ->Field("EndTime", &ISequenceKey::fEndTime);
  86. serializeContext->Class<ISoundKey, IKey>()
  87. ->Field("StartTrigger", &ISoundKey::sStartTrigger)
  88. ->Field("StopTrigger", &ISoundKey::sStopTrigger)
  89. ->Field("Duration", &ISoundKey::fDuration)
  90. ->Field("Color", &ISoundKey::customColor);
  91. serializeContext->Class<ITimeRangeKey, IKey>()
  92. ->Field("Duration", &ITimeRangeKey::m_duration)
  93. ->Field("Start", &ITimeRangeKey::m_startTime)
  94. ->Field("End", &ITimeRangeKey::m_endTime)
  95. ->Field("Speed", &ITimeRangeKey::m_speed)
  96. ->Field("Loop", &ITimeRangeKey::m_bLoop);
  97. }
  98. }