LeaderFollowerVersionTests.cpp 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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 <Tests/SystemComponentFixture.h>
  9. #include <EMotionFX/Source/AnimGraph.h>
  10. #include <EMotionFX/Source/BlendSpace1DNode.h>
  11. #include <EMotionFX/Source/BlendSpace2DNode.h>
  12. #include <AzCore/Serialization/SerializeContext.h>
  13. #include <AzCore/Serialization/Utils.h>
  14. namespace EMotionFX
  15. {
  16. // Developer code and APIs with exclusionary terms will be deprecated as we introduce replacements across this project's related
  17. // codebases and APIs. Please note, some instances have been retained in the current version to provide backward compatibility
  18. // for assets/materials created prior to the change. These will be deprecated in the future.
  19. // Those tests validate the conversion of blendspace1d and blendspace2d node.
  20. TEST_F(SystemComponentFixture, TestLeaderFollowerConversionBlendSpace1D)
  21. {
  22. const AZStd::string buffer =
  23. R"(<ObjectStream version="3">
  24. <Class name="AnimGraph" version="1" type="{BD543125-CFEE-426C-B0AC-129F2A4C6BC8}">
  25. <Class name="GroupParameter" field="rootGroupParameter" version="1" type="{6B42666E-82D7-431E-807E-DA789C53AF05}">
  26. <Class name="Parameter" field="BaseClass1" version="1" type="{4AF0BAFC-98F8-4EA3-8946-4AD87D7F2A6C}">
  27. <Class name="AZStd::string" field="name" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  28. <Class name="AZStd::string" field="description" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  29. </Class>
  30. <Class name="AZStd::vector" field="childParameters" type="{496E6454-2F91-5CDC-9771-3B589F3F8FEB}"/>
  31. </Class>
  32. <Class name="AnimGraphStateMachine" field="rootStateMachine" version="1" type="{272E90D2-8A18-46AF-AD82-6A8B7EC508ED}">
  33. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  34. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  35. <Class name="AZ::u64" field="id" value="5624789762880256302" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  36. <Class name="AZStd::string" field="name" value="Root" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  37. <Class name="int" field="posX" value="0" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  38. <Class name="int" field="posY" value="0" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  39. <Class name="Color" field="visualizeColor" value="0.1254902 0.6470588 0.8549020 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  40. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  41. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  42. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  43. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}">
  44. <Class name="BlendTree" field="element" version="1" type="{A8B5BB1E-5BA9-4B0A-88E9-21BB7A199ED2}">
  45. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  46. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  47. <Class name="AZ::u64" field="id" value="12099635065983060864" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  48. <Class name="AZStd::string" field="name" value="BlendTree0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  49. <Class name="int" field="posX" value="530" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  50. <Class name="int" field="posY" value="360" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  51. <Class name="Color" field="visualizeColor" value="0.6784314 0.8705883 1.0000000 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  52. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  53. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  54. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  55. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}">
  56. <Class name="BlendTreeFinalNode" field="element" version="1" type="{1A755218-AD9D-48EA-86FC-D571C11ECA4D}">
  57. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  58. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  59. <Class name="AZ::u64" field="id" value="6320198947116385307" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  60. <Class name="AZStd::string" field="name" value="FinalNode0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  61. <Class name="int" field="posX" value="-39" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  62. <Class name="int" field="posY" value="10" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  63. <Class name="Color" field="visualizeColor" value="0.8235295 0.9803922 0.9803922 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  64. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  65. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  66. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  67. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}"/>
  68. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}">
  69. <Class name="BlendTreeConnection" field="element" version="2" type="{B48FFEDB-87FB-4085-AE54-0302AC49373A}">
  70. <Class name="AZ::u64" field="id" value="7087270156229006524" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  71. <Class name="AZ::u64" field="sourceNodeId" value="4148000174371361859" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  72. <Class name="unsigned short" field="sourcePortNr" value="0" type="{ECA0B403-C4F8-4B86-95FC-81688D046E40}"/>
  73. <Class name="unsigned short" field="targetPortNr" value="0" type="{ECA0B403-C4F8-4B86-95FC-81688D046E40}"/>
  74. </Class>
  75. </Class>
  76. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  77. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  78. </Class>
  79. </Class>
  80. </Class>)"
  81. R"( <Class name="BlendSpace1DNode" field="element" version="1" type="{E41B443C-8423-4764-97F0-6C57997C2E5B}">
  82. <Class name="BlendSpaceNode" field="BaseClass1" version="2" type="{11EC99C4-6A25-4610-86FD-B01F2E53007E}">
  83. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  84. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  85. <Class name="AZ::u64" field="id" value="4148000174371361859" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  86. <Class name="AZStd::string" field="name" value="BlendSpace1D0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  87. <Class name="int" field="posX" value="-250" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  88. <Class name="int" field="posY" value="10" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  89. <Class name="Color" field="visualizeColor" value="1.0000000 0.0000000 1.0000000 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  90. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  91. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  92. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  93. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}"/>
  94. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}"/>
  95. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  96. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  97. </Class>
  98. </Class>
  99. <Class name="bool" field="retarget" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  100. <Class name="bool" field="inPlace" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  101. </Class>
  102. <Class name="unsigned char" field="calculationMethod" value="0" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  103. <Class name="AZ::Uuid" field="evaluatorType" value="{17D8679E-5760-481C-9411-5A97D22BC745}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
  104. <Class name="unsigned char" field="syncMode" value="1" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  105. <Class name="AZStd::string" field="syncMasterMotionId" value="rin_walk_kick_04" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  106. <Class name="unsigned char" field="eventFilterMode" value="0" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  107. <Class name="AZStd::vector" field="motions" type="{2C5B7168-99DB-5908-8EDB-029D3793CA0A}">
  108. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  109. <Class name="AZStd::string" field="motionId" value="rin_run" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  110. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  111. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  112. </Class>
  113. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  114. <Class name="AZStd::string" field="motionId" value="rin_walk_kick_04" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  115. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  116. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  117. </Class>
  118. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  119. <Class name="AZStd::string" field="motionId" value="rin_turn_180_clockwise" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  120. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  121. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  122. </Class>
  123. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  124. <Class name="AZStd::string" field="motionId" value="rin_stand_kick_punch_02" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  125. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  126. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  127. </Class>
  128. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  129. <Class name="AZStd::string" field="motionId" value="rin_stand_kick_punch_05" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  130. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  131. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  132. </Class>
  133. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  134. <Class name="AZStd::string" field="motionId" value="rin_shuffle_turn_right" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  135. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  136. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  137. </Class>)"
  138. R"( <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  139. <Class name="AZStd::string" field="motionId" value="rin_idle" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  140. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  141. <Class name="unsigned char" field="typeFlags" value="2" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  142. </Class>
  143. </Class>
  144. </Class>
  145. </Class>
  146. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}"/>
  147. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  148. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  149. </Class>
  150. </Class>
  151. <Class name="AZ::u64" field="finalNodeId" value="6320198947116385307" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  152. </Class>
  153. </Class>
  154. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}"/>
  155. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  156. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  157. </Class>
  158. </Class>
  159. <Class name="AZ::u64" field="entryStateId" value="12099635065983060864" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  160. <Class name="AZStd::vector" field="transitions" type="{7BE4AF47-DDD5-5B41-9BE0-6739C8A2694E}"/>
  161. <Class name="bool" field="alwaysStartInEntryState" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  162. </Class>
  163. <Class name="AZStd::vector" field="nodeGroups" type="{9A7148E6-1DCA-5BDA-80D7-5FF35D43170E}"/>
  164. <Class name="bool" field="retarget" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  165. </Class>
  166. </ObjectStream>
  167. )";
  168. // Verify if the property got converted correctly.
  169. AnimGraph* graph = AZ::Utils::LoadObjectFromBuffer<AnimGraph>(buffer.c_str(), buffer.size(), GetSerializeContext());
  170. ASSERT_TRUE(graph != nullptr);
  171. AnimGraphNode* node = graph->RecursiveFindNodeByName("BlendSpace1D0");
  172. ASSERT_TRUE(node != nullptr);
  173. BlendSpace1DNode* blendSpaceNode = azrtti_cast<BlendSpace1DNode*>(node);
  174. ASSERT_TRUE(blendSpaceNode != nullptr);
  175. EXPECT_STREQ(blendSpaceNode->GetSyncLeaderMotionId().c_str(), "rin_walk_kick_04");
  176. delete graph;
  177. }
  178. TEST_F(SystemComponentFixture, TestLeaderFollowerConversionBlendSpace2D)
  179. {
  180. const AZStd::string buffer =
  181. R"(<ObjectStream version="3">
  182. <Class name="AnimGraph" version="1" type="{BD543125-CFEE-426C-B0AC-129F2A4C6BC8}">
  183. <Class name="GroupParameter" field="rootGroupParameter" version="1" type="{6B42666E-82D7-431E-807E-DA789C53AF05}">
  184. <Class name="Parameter" field="BaseClass1" version="1" type="{4AF0BAFC-98F8-4EA3-8946-4AD87D7F2A6C}">
  185. <Class name="AZStd::string" field="name" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  186. <Class name="AZStd::string" field="description" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  187. </Class>
  188. <Class name="AZStd::vector" field="childParameters" type="{496E6454-2F91-5CDC-9771-3B589F3F8FEB}"/>
  189. </Class>
  190. <Class name="AnimGraphStateMachine" field="rootStateMachine" version="1" type="{272E90D2-8A18-46AF-AD82-6A8B7EC508ED}">
  191. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  192. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  193. <Class name="AZ::u64" field="id" value="5624789762880256302" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  194. <Class name="AZStd::string" field="name" value="Root" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  195. <Class name="int" field="posX" value="0" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  196. <Class name="int" field="posY" value="0" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  197. <Class name="Color" field="visualizeColor" value="0.1254902 0.6470588 0.8549020 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  198. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  199. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  200. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  201. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}">
  202. <Class name="BlendTree" field="element" version="1" type="{A8B5BB1E-5BA9-4B0A-88E9-21BB7A199ED2}">
  203. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  204. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  205. <Class name="AZ::u64" field="id" value="12099635065983060864" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  206. <Class name="AZStd::string" field="name" value="BlendTree0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  207. <Class name="int" field="posX" value="530" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  208. <Class name="int" field="posY" value="360" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  209. <Class name="Color" field="visualizeColor" value="0.6784314 0.8705883 1.0000000 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  210. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  211. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  212. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  213. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}">
  214. <Class name="BlendTreeFinalNode" field="element" version="1" type="{1A755218-AD9D-48EA-86FC-D571C11ECA4D}">
  215. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  216. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  217. <Class name="AZ::u64" field="id" value="6320198947116385307" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  218. <Class name="AZStd::string" field="name" value="FinalNode0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  219. <Class name="int" field="posX" value="-39" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  220. <Class name="int" field="posY" value="10" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  221. <Class name="Color" field="visualizeColor" value="0.8235295 0.9803922 0.9803922 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  222. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  223. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  224. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  225. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}"/>
  226. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}">
  227. <Class name="BlendTreeConnection" field="element" version="2" type="{B48FFEDB-87FB-4085-AE54-0302AC49373A}">
  228. <Class name="AZ::u64" field="id" value="15639148820508181089" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  229. <Class name="AZ::u64" field="sourceNodeId" value="5538230721523229091" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  230. <Class name="unsigned short" field="sourcePortNr" value="0" type="{ECA0B403-C4F8-4B86-95FC-81688D046E40}"/>
  231. <Class name="unsigned short" field="targetPortNr" value="0" type="{ECA0B403-C4F8-4B86-95FC-81688D046E40}"/>
  232. </Class>
  233. </Class>
  234. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  235. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  236. </Class>
  237. </Class>
  238. </Class>
  239. <Class name="BlendSpace2DNode" field="element" version="1" type="{5C0DADA2-FE74-468F-A755-55AEBE579C45}">
  240. <Class name="BlendSpaceNode" field="BaseClass1" version="2" type="{11EC99C4-6A25-4610-86FD-B01F2E53007E}">
  241. <Class name="AnimGraphNode" field="BaseClass1" version="2" type="{7F1C0E1D-4D32-4A6D-963C-20193EA28F95}">
  242. <Class name="AnimGraphObject" field="BaseClass1" version="1" type="{532F5328-9AE3-4793-A7AA-8DEB0BAC9A9E}"/>
  243. <Class name="AZ::u64" field="id" value="5538230721523229091" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  244. <Class name="AZStd::string" field="name" value="BlendSpace2D0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  245. <Class name="int" field="posX" value="-380" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  246. <Class name="int" field="posY" value="0" type="{72039442-EB38-4D42-A1AD-CB68F7E0EEF6}"/>
  247. <Class name="Color" field="visualizeColor" value="0.9803922 1.0000000 0.9607844 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
  248. <Class name="bool" field="isDisabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  249. <Class name="bool" field="isCollapsed" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  250. <Class name="bool" field="isVisEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  251. <Class name="AZStd::vector" field="childNodes" type="{E952D946-FF2C-5624-B72A-E02718B8CB09}"/>
  252. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}"/>
  253. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  254. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  255. </Class>
  256. </Class>
  257. <Class name="bool" field="retarget" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  258. <Class name="bool" field="inPlace" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  259. </Class>
  260. <Class name="unsigned char" field="calculationMethodX" value="0" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  261. <Class name="AZ::Uuid" field="evaluatorTypeX" value="{17D8679E-5760-481C-9411-5A97D22BC745}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
  262. <Class name="unsigned char" field="calculationMethodY" value="0" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  263. <Class name="AZ::Uuid" field="evaluatorTypeY" value="{17D8679E-5760-481C-9411-5A97D22BC745}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
  264. <Class name="unsigned char" field="syncMode" value="1" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  265. <Class name="AZStd::string" field="syncMasterMotionId" value="rin_walk_kick_03" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  266. <Class name="unsigned char" field="eventFilterMode" value="0" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  267. <Class name="AZStd::vector" field="motions" type="{2C5B7168-99DB-5908-8EDB-029D3793CA0A}">
  268. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  269. <Class name="AZStd::string" field="motionId" value="rin_readyattack_idle" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  270. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  271. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  272. </Class>
  273. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  274. <Class name="AZStd::string" field="motionId" value="rin_run" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  275. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  276. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  277. </Class>
  278. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  279. <Class name="AZStd::string" field="motionId" value="rin_walk_kick_03" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  280. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  281. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  282. </Class>
  283. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  284. <Class name="AZStd::string" field="motionId" value="rin_stand_kick_punch_04" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  285. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  286. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  287. </Class>
  288. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  289. <Class name="AZStd::string" field="motionId" value="rin_shuffle_turn_left" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  290. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  291. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  292. </Class>)"
  293. R"( <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  294. <Class name="AZStd::string" field="motionId" value="rin_stand_kick_punch_03" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  295. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  296. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  297. </Class>
  298. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  299. <Class name="AZStd::string" field="motionId" value="rin_walk_kick_04" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  300. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  301. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  302. </Class>
  303. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  304. <Class name="AZStd::string" field="motionId" value="rin_turn_180_clockwise" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  305. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  306. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  307. </Class>
  308. <Class name="BlendSpaceMotion" field="element" version="1" type="{4D624F75-2179-47E4-80EE-6E5E8B9B2CA0}">
  309. <Class name="AZStd::string" field="motionId" value="rin_stand_kick_punch_02" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
  310. <Class name="Vector2" field="coordinates" value="0.0000000 0.0000000" type="{3D80F623-C85C-4741-90D0-E4E66164E6BF}"/>
  311. <Class name="unsigned char" field="typeFlags" value="4" type="{72B9409A-7D1A-4831-9CFE-FCB3FADD3426}"/>
  312. </Class>
  313. </Class>
  314. </Class>
  315. </Class>
  316. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}"/>
  317. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  318. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  319. </Class>
  320. </Class>
  321. <Class name="AZ::u64" field="finalNodeId" value="6320198947116385307" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  322. </Class>
  323. </Class>
  324. <Class name="AZStd::vector" field="connections" type="{79810215-6320-5ED4-BA2C-CD3D5F2BFFE4}"/>
  325. <Class name="TriggerActionSetup" field="actionSetup" version="1" type="{7B4E270C-2C7F-41C4-BFA5-FE6104B789BF}">
  326. <Class name="AZStd::vector" field="actions" type="{51C7563D-C7C7-5975-9359-21A4869DE695}"/>
  327. </Class>
  328. </Class>
  329. <Class name="AZ::u64" field="entryStateId" value="12099635065983060864" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
  330. <Class name="AZStd::vector" field="transitions" type="{7BE4AF47-DDD5-5B41-9BE0-6739C8A2694E}"/>
  331. <Class name="bool" field="alwaysStartInEntryState" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  332. </Class>
  333. <Class name="AZStd::vector" field="nodeGroups" type="{9A7148E6-1DCA-5BDA-80D7-5FF35D43170E}"/>
  334. <Class name="bool" field="retarget" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
  335. </Class>
  336. </ObjectStream>
  337. )";
  338. // Verify if the property got converted correctly.
  339. AnimGraph* graph = AZ::Utils::LoadObjectFromBuffer<AnimGraph>(buffer.c_str(), buffer.size(), GetSerializeContext());
  340. ASSERT_TRUE(graph != nullptr);
  341. AnimGraphNode* node = graph->RecursiveFindNodeByName("BlendSpace2D0");
  342. ASSERT_TRUE(node != nullptr);
  343. BlendSpace2DNode* blendSpaceNode = azrtti_cast<BlendSpace2DNode*>(node);
  344. ASSERT_TRUE(blendSpaceNode != nullptr);
  345. EXPECT_STREQ(blendSpaceNode->GetSyncLeaderMotionId().c_str(), "rin_walk_kick_03");
  346. delete graph;
  347. }
  348. } // end namespace EMotionFX