From ff09b24604a505d316d01a4a56029d96e5db1a88 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:34:24 +0100 Subject: [PATCH] Motion Matching: Fix for nightly build issue (#7392) Signed-off-by: Benjamin Jillich --- Gems/MotionMatching/Code/Source/KdTree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gems/MotionMatching/Code/Source/KdTree.cpp b/Gems/MotionMatching/Code/Source/KdTree.cpp index e2de897946..a85610763c 100644 --- a/Gems/MotionMatching/Code/Source/KdTree.cpp +++ b/Gems/MotionMatching/Code/Source/KdTree.cpp @@ -42,8 +42,10 @@ namespace EMotionFX::MotionMatching size_t maxDepth, size_t minFramesPerLeaf) { +#if !defined(_RELEASE) AZ::Debug::Timer timer; timer.Stamp(); +#endif Clear(); @@ -80,6 +82,7 @@ namespace EMotionFX::MotionMatching ClearFramesForNonEssentialNodes(); RemoveZeroFrameLeafNodes(); +#if !defined(_RELEASE) const float initTime = timer.GetDeltaTimeInSeconds(); AZ_TracePrintf("EMotionFX", "KdTree initialized in %f seconds (numNodes = %d numDims = %d Memory used = %.2f MB).", initTime, m_nodes.size(), @@ -87,6 +90,7 @@ namespace EMotionFX::MotionMatching static_cast(CalcMemoryUsageInBytes()) / 1024.0f / 1024.0f); PrintStats(); +#endif return true; } @@ -342,6 +346,7 @@ namespace EMotionFX::MotionMatching void KdTree::PrintStats() { +#if !defined(_RELEASE) size_t leftNumFrames = 0; size_t rightNumFrames = 0; if (m_nodes[0]->m_leftNode) @@ -393,6 +398,7 @@ namespace EMotionFX::MotionMatching const size_t avgFrames = (leftNumFrames + rightNumFrames) / numLeafNodes; AZ_TracePrintf("EMotionFX", "KdTree Node Info: leafs=%d avgFrames=%d zeroFrames=%d minFrames=%d maxFrames=%d", numLeafNodes, avgFrames, numZeroNodes, minFrames, maxFrames); +#endif } void KdTree::FindNearestNeighbors(const AZStd::vector& frameFloats, AZStd::vector& resultFrameIndices) const