AnimGraphComponentBusTests.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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 <AzFramework/Components/TransformComponent.h>
  9. #include <EMotionFX/Source/AnimGraphBindPoseNode.h>
  10. #include <EMotionFX/Source/AnimGraphMotionNode.h>
  11. #include <EMotionFX/Source/AnimGraphObject.h>
  12. #include <EMotionFX/Source/AnimGraphStateMachine.h>
  13. #include <EMotionFX/Source/AnimGraphStateTransition.h>
  14. #include <EMotionFX/Source/BlendTree.h>
  15. #include <EMotionFX/Source/BlendTreeBlend2Node.h>
  16. #include <EMotionFX/Source/BlendTreeBlendNNode.h>
  17. #include <EMotionFX/Source/BlendTreeParameterNode.h>
  18. #include <EMotionFX/Source/Parameter/BoolParameter.h>
  19. #include <EMotionFX/Source/Parameter/FloatSliderParameter.h>
  20. #include <EMotionFX/Source/Parameter/Vector2Parameter.h>
  21. #include <EMotionFX/Source/Parameter/Vector3Parameter.h>
  22. #include <EMotionFX/Source/Parameter/RotationParameter.h>
  23. #include <EMotionFX/Source/Parameter/StringParameter.h>
  24. #include <EMotionFX/Source/Parameter/ParameterFactory.h>
  25. #include <Include/Integration/AnimGraphComponentBus.h>
  26. #include <Integration/Components/ActorComponent.h>
  27. #include <Integration/Components/AnimGraphComponent.h>
  28. #include <MCore/Source/AttributeFloat.h>
  29. #include <MCore/Source/AzCoreConversions.h>
  30. #include <Tests/Integration/EntityComponentFixture.h>
  31. #include <Tests/TestAssetCode/AnimGraphFactory.h>
  32. #include <Tests/TestAssetCode/ActorFactory.h>
  33. #include <Tests/TestAssetCode/JackActor.h>
  34. #include <Tests/TestAssetCode/TestActorAssets.h>
  35. namespace EMotionFX
  36. {
  37. class AnimGraphComponentNotificationTestBus
  38. : Integration::AnimGraphComponentNotificationBus::Handler
  39. {
  40. public:
  41. AnimGraphComponentNotificationTestBus(AZ::EntityId entityId)
  42. {
  43. Integration::AnimGraphComponentNotificationBus::Handler::BusConnect(entityId);
  44. }
  45. ~AnimGraphComponentNotificationTestBus()
  46. {
  47. Integration::AnimGraphComponentNotificationBus::Handler::BusDisconnect();
  48. }
  49. MOCK_METHOD1(OnAnimGraphInstanceCreated, void(EMotionFX::AnimGraphInstance*));
  50. MOCK_METHOD1(OnAnimGraphInstanceDestroyed, void(EMotionFX::AnimGraphInstance*));
  51. MOCK_METHOD4(OnAnimGraphFloatParameterChanged, void(EMotionFX::AnimGraphInstance*, size_t, float, float));
  52. MOCK_METHOD4(OnAnimGraphBoolParameterChanged, void(EMotionFX::AnimGraphInstance*, size_t, bool, bool));
  53. MOCK_METHOD4(OnAnimGraphStringParameterChanged, void(EMotionFX::AnimGraphInstance*, size_t, const char*, const char*));
  54. MOCK_METHOD4(OnAnimGraphVector2ParameterChanged, void(EMotionFX::AnimGraphInstance*, size_t, const AZ::Vector2&, const AZ::Vector2&));
  55. MOCK_METHOD4(OnAnimGraphVector3ParameterChanged, void(EMotionFX::AnimGraphInstance*, size_t, const AZ::Vector3&, const AZ::Vector3&));
  56. MOCK_METHOD4(OnAnimGraphRotationParameterChanged, void(EMotionFX::AnimGraphInstance*, size_t, const AZ::Quaternion&, const AZ::Quaternion&));
  57. };
  58. class AnimGraphComponentBusTests
  59. : public EntityComponentFixture
  60. {
  61. public:
  62. void SetUp() override
  63. {
  64. EntityComponentFixture::SetUp();
  65. m_entity = AZStd::make_unique<AZ::Entity>();
  66. m_entityId = AZ::EntityId(740216387);
  67. m_entity->SetId(m_entityId);
  68. AZ::Data::AssetId actorAssetId("{5060227D-B6F4-422E-BF82-41AAC5F228A5}");
  69. AZStd::unique_ptr<Actor> actor = ActorFactory::CreateAndInit<JackNoMeshesActor>();
  70. AZ::Data::Asset<Integration::ActorAsset> actorAsset = TestActorAssets::GetAssetFromActor(actorAssetId, AZStd::move(actor));
  71. Integration::ActorComponent::Configuration actorConf;
  72. actorConf.m_actorAsset = actorAsset;
  73. m_entity->CreateComponent<AzFramework::TransformComponent>();
  74. m_actorComponent = m_entity->CreateComponent<Integration::ActorComponent>(&actorConf);
  75. m_animGraphComponent = m_entity->CreateComponent<Integration::AnimGraphComponent>();
  76. m_entity->Init();
  77. // Anim graph asset.
  78. AZ::Data::AssetId animGraphAssetId("{37629818-5166-4B96-83F5-5818B6A1F449}");
  79. m_animGraphComponent->SetAnimGraphAssetId(animGraphAssetId);
  80. AZ::Data::Asset<Integration::AnimGraphAsset> animGraphAsset = AZ::Data::AssetManager::Instance().CreateAsset<Integration::AnimGraphAsset>(animGraphAssetId);
  81. AZStd::unique_ptr<TwoMotionNodeAnimGraph> motionNodeAnimGraph = AnimGraphFactory::Create<TwoMotionNodeAnimGraph>();
  82. m_animGraph = motionNodeAnimGraph.get();
  83. motionNodeAnimGraph.release();
  84. animGraphAsset.GetAs<Integration::AnimGraphAsset>()->SetData(m_animGraph);
  85. EXPECT_EQ(animGraphAsset.IsReady(), true) << "Anim graph asset is not ready yet.";
  86. m_animGraphComponent->OnAssetReady(animGraphAsset);
  87. // Motion set asset.
  88. AZ::Data::AssetId motionSetAssetId("{224BFF5F-D0AD-4216-9CEF-42F419CC6265}");
  89. m_animGraphComponent->SetMotionSetAssetId(motionSetAssetId);
  90. AZ::Data::Asset<Integration::MotionSetAsset> motionSetAsset = AZ::Data::AssetManager::Instance().CreateAsset<Integration::MotionSetAsset>(motionSetAssetId);
  91. motionSetAsset.GetAs<Integration::MotionSetAsset>()->SetData(new MotionSet());
  92. EXPECT_EQ(motionSetAsset.IsReady(), true) << "Motion set asset is not ready yet.";
  93. m_animGraphComponent->OnAssetReady(motionSetAsset);
  94. }
  95. void TearDown() override
  96. {
  97. m_entity.reset();
  98. EntityComponentFixture::TearDown();
  99. }
  100. void ActivateEntity()
  101. {
  102. // Set the actor asset and create the actor instance.
  103. m_actorComponent->SetActorAsset(m_actorComponent->GetActorAsset());
  104. m_entity->Activate();
  105. // Run one tick so that the actor asset has time to finish activating.
  106. // (Actor initialization is deferred to the next tick after the OnAssetReady call)
  107. AZ::TickBus::Broadcast(&AZ::TickEvents::OnTick, 0.0f, AZ::ScriptTimePoint());
  108. m_animGraphInstance = m_animGraphComponent->GetAnimGraphInstance();
  109. EXPECT_NE(m_animGraphInstance, nullptr) << "Expecting valid anim graph instance.";
  110. }
  111. void PrepareParameterTest(ValueParameter* parameter)
  112. {
  113. ActivateEntity();
  114. m_animGraphInstance = m_animGraphComponent->GetAnimGraphInstance();
  115. EXPECT_NE(m_animGraphInstance, nullptr) << "Expecting valid anim graph instance.";
  116. m_parameterName = "Test Parameter";
  117. parameter->SetName(m_parameterName.c_str());
  118. m_animGraph->AddParameter(parameter);
  119. m_animGraphInstance->AddMissingParameterValues();
  120. // FindParameterIndex() test
  121. Integration::AnimGraphComponentRequestBus::EventResult(m_parameterIndex, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::FindParameterIndex, m_parameterName.c_str());
  122. EXPECT_EQ(m_parameterIndex, 0) << "Expected the index for the first parameter.";
  123. // FindParameterName() test
  124. const char* foundParameterName = nullptr;
  125. Integration::AnimGraphComponentRequestBus::EventResult(foundParameterName, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::FindParameterName, m_parameterIndex);
  126. EXPECT_STREQ(foundParameterName, m_parameterName.c_str()) << "Expected the index for the first parameter.";
  127. }
  128. AZ::EntityId m_entityId;
  129. AZStd::unique_ptr<AZ::Entity> m_entity;
  130. TwoMotionNodeAnimGraph* m_animGraph = nullptr;
  131. Integration::ActorComponent* m_actorComponent = nullptr;
  132. Integration::AnimGraphComponent* m_animGraphComponent = nullptr;
  133. AnimGraphInstance* m_animGraphInstance = nullptr;
  134. size_t m_parameterIndex = InvalidIndex;
  135. std::string m_parameterName;
  136. };
  137. TEST_F(AnimGraphComponentBusTests, GetAnimGraphInstance)
  138. {
  139. ActivateEntity();
  140. AnimGraphInstance* animgrGraphInstance = nullptr;
  141. Integration::AnimGraphComponentRequestBus::EventResult(animgrGraphInstance, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetAnimGraphInstance);
  142. EXPECT_NE(animgrGraphInstance, nullptr) << "Expecting valid anim graph instance.";
  143. EXPECT_EQ(animgrGraphInstance, m_animGraphInstance) << "Expecting the anim graph instance from our anim graph component.";
  144. }
  145. TEST_F(AnimGraphComponentBusTests, FloatParameter)
  146. {
  147. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  148. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  149. PrepareParameterTest(aznew FloatSliderParameter());
  150. {
  151. testing::InSequence parameterChangedCallSequence;
  152. EXPECT_CALL(testBus, OnAnimGraphFloatParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, 3.0f));
  153. EXPECT_CALL(testBus, OnAnimGraphFloatParameterChanged(m_animGraphInstance, m_parameterIndex, 3.0f, 4.0f));
  154. }
  155. // SetParameterFloat/GetParameterFloat() test
  156. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterFloat, m_parameterIndex, 3.0f);
  157. float newValue = 0.0f;
  158. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterFloat, m_parameterIndex);
  159. EXPECT_EQ(newValue, 3.0f) << "Expected a parameter value of 3.0.";
  160. // SetNamedParameterFloat/GetNamedParameterFloat() test
  161. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterFloat, m_parameterName.c_str(), 4.0f);
  162. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterFloat, m_parameterName.c_str());
  163. EXPECT_EQ(newValue, 4.0f) << "Expected a parameter value of 3.0.";
  164. }
  165. TEST_F(AnimGraphComponentBusTests, BoolParameter)
  166. {
  167. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  168. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  169. PrepareParameterTest(aznew BoolParameter());
  170. {
  171. testing::InSequence parameterChangedCallSequence;
  172. EXPECT_CALL(testBus, OnAnimGraphBoolParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, true));
  173. EXPECT_CALL(testBus, OnAnimGraphBoolParameterChanged(m_animGraphInstance, m_parameterIndex, true, false));
  174. }
  175. // SetParameterBool/GetParameterBool() test
  176. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterBool, m_parameterIndex, true);
  177. bool newValue = false;
  178. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterBool, m_parameterIndex);
  179. EXPECT_EQ(newValue, true) << "Expected true as parameter value.";
  180. // SetNamedParameterBool/GetNamedParameterBool() test
  181. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterBool, m_parameterName.c_str(), false);
  182. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterBool, m_parameterName.c_str());
  183. EXPECT_EQ(newValue, false) << "Expected false as parameter value.";
  184. }
  185. TEST_F(AnimGraphComponentBusTests, StringParameter)
  186. {
  187. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  188. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  189. PrepareParameterTest(aznew StringParameter());
  190. EXPECT_CALL(testBus, OnAnimGraphStringParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, testing::_))
  191. .Times(2);
  192. // SetParameterString/GetParameterString() test
  193. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterString, m_parameterIndex, "Test String");
  194. AZStd::string newValue;
  195. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterString, m_parameterIndex);
  196. EXPECT_STREQ(newValue.c_str(), "Test String") << "Expected the test string parameter.";
  197. // SetNamedParameterString/GetNamedParameterString() test
  198. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterString, m_parameterName.c_str(), "Yet Another String");
  199. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterString, m_parameterName.c_str());
  200. EXPECT_STREQ(newValue.c_str(), "Yet Another String") << "Expected yet another string.";
  201. }
  202. TEST_F(AnimGraphComponentBusTests, Vector2Parameter)
  203. {
  204. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  205. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  206. PrepareParameterTest(aznew Vector2Parameter());
  207. {
  208. testing::InSequence parameterChangedCallSequence;
  209. EXPECT_CALL(testBus, OnAnimGraphVector2ParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, AZ::Vector2(1.0f, 2.0f)));
  210. EXPECT_CALL(testBus, OnAnimGraphVector2ParameterChanged(m_animGraphInstance, m_parameterIndex, AZ::Vector2(1.0f, 2.0f), AZ::Vector2(3.0f, 4.0f)));
  211. }
  212. // SetParameterVector2/GetParameterVector2() test
  213. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterVector2, m_parameterIndex, AZ::Vector2(1.0f, 2.0f));
  214. AZ::Vector2 newValue;
  215. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterVector2, m_parameterIndex);
  216. EXPECT_EQ(newValue, AZ::Vector2(1.0f, 2.0f));
  217. // SetNamedParameterVector2/GetNamedParameterVector2() test
  218. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterVector2, m_parameterName.c_str(), AZ::Vector2(3.0f, 4.0f));
  219. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterVector2, m_parameterName.c_str());
  220. EXPECT_EQ(newValue, AZ::Vector2(3.0f, 4.0f));
  221. }
  222. TEST_F(AnimGraphComponentBusTests, Vector3Parameter)
  223. {
  224. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  225. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  226. PrepareParameterTest(aznew Vector3Parameter());
  227. {
  228. testing::InSequence parameterChangedCallSequence;
  229. EXPECT_CALL(testBus, OnAnimGraphVector3ParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, AZ::Vector3(1.0f, 2.0f, 3.0f)));
  230. EXPECT_CALL(testBus, OnAnimGraphVector3ParameterChanged(m_animGraphInstance, m_parameterIndex, AZ::Vector3(1.0f, 2.0f, 3.0f), AZ::Vector3(4.0f, 5.0f, 6.0f)));
  231. }
  232. // SetParameterVector3/GetParameterVector3() test
  233. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterVector3, m_parameterIndex, AZ::Vector3(1.0f, 2.0f, 3.0f));
  234. AZ::Vector3 newValue;
  235. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterVector3, m_parameterIndex);
  236. EXPECT_EQ(newValue, AZ::Vector3(1.0f, 2.0f, 3.0f));
  237. // SetNamedParameterVector3/GetNamedParameterVector3() test
  238. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterVector3, m_parameterName.c_str(), AZ::Vector3(4.0f, 5.0f, 6.0f));
  239. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterVector3, m_parameterName.c_str());
  240. EXPECT_EQ(newValue, AZ::Vector3(4.0f, 5.0f, 6.0f));
  241. }
  242. TEST_F(AnimGraphComponentBusTests, RotationParameterEuler)
  243. {
  244. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  245. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  246. PrepareParameterTest(aznew RotationParameter());
  247. EXPECT_CALL(testBus, OnAnimGraphRotationParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, testing::_))
  248. .Times(2);
  249. // SetParameterRotationEuler/GetParameterRotationEuler() test
  250. AZ::Vector3 expectedEuler(AZ::DegToRad(30.0f), AZ::DegToRad(20.0f), 0.0f);
  251. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterRotationEuler, m_parameterIndex, expectedEuler);
  252. AZ::Vector3 newValue;
  253. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterRotationEuler, m_parameterIndex);
  254. EXPECT_TRUE(newValue.IsClose(expectedEuler, 0.001f));
  255. // SetNamedParameterRotationEuler/GetNamedParameterRotationEuler() test
  256. expectedEuler = AZ::Vector3(AZ::DegToRad(45.0f), 0.0f, AZ::DegToRad(30.0f));
  257. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterRotationEuler, m_parameterName.c_str(), expectedEuler);
  258. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterRotationEuler, m_parameterName.c_str());
  259. EXPECT_TRUE(newValue.IsClose(expectedEuler, 0.001f));
  260. }
  261. TEST_F(AnimGraphComponentBusTests, RotationParameter)
  262. {
  263. const AZ::Vector3 firstExpected(AZ::DegToRad(30.0f), AZ::DegToRad(20.0f), 0.0f);
  264. const AZ::Quaternion firstExpectedQuat = MCore::AzEulerAnglesToAzQuat(firstExpected);
  265. const AZ::Vector3 secondExpected = AZ::Vector3(AZ::DegToRad(45.0f), 0.0f, AZ::DegToRad(30.0f));
  266. const AZ::Quaternion secondExpectedQuat = MCore::AzEulerAnglesToAzQuat(secondExpected);
  267. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  268. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  269. PrepareParameterTest(aznew RotationParameter());
  270. {
  271. testing::InSequence parameterChangedCallSequence;
  272. EXPECT_CALL(testBus, OnAnimGraphRotationParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, firstExpectedQuat));
  273. EXPECT_CALL(testBus, OnAnimGraphRotationParameterChanged(m_animGraphInstance, m_parameterIndex, testing::_, secondExpectedQuat));
  274. }
  275. // SetParameterRotation/GetParameterRotation() test
  276. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetParameterRotation, m_parameterIndex, firstExpectedQuat);
  277. AZ::Quaternion newValue;
  278. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetParameterRotation, m_parameterIndex);
  279. EXPECT_TRUE(newValue.IsClose(firstExpectedQuat, 0.001f));
  280. // SetNamedParameterRotation/GetNamedParameterRotation() test
  281. Integration::AnimGraphComponentRequestBus::Event(m_entityId, &Integration::AnimGraphComponentRequestBus::Events::SetNamedParameterRotation, m_parameterName.c_str(), secondExpectedQuat);
  282. Integration::AnimGraphComponentRequestBus::EventResult(newValue, m_entityId, &Integration::AnimGraphComponentRequestBus::Events::GetNamedParameterRotation, m_parameterName.c_str());
  283. EXPECT_TRUE(newValue.IsClose(secondExpectedQuat, 0.001f));
  284. }
  285. TEST_F(AnimGraphComponentBusTests, OnAnimGraphInstanceDestroyed)
  286. {
  287. AnimGraphComponentNotificationTestBus testBus(m_entityId);
  288. EXPECT_CALL(testBus, OnAnimGraphInstanceCreated(testing::_));
  289. ActivateEntity();
  290. EXPECT_CALL(testBus, OnAnimGraphInstanceDestroyed(m_animGraphInstance));
  291. m_entity->Deactivate();
  292. }
  293. } // end namespace EMotionFX