Updated AnimNode registration in LyShine and Maestro to register to a member variable map (#6786)

* Updated the Maestro MovieSystem and LyShine AnimationSystem to register
Anim Nodes and Anim Params into a member variable map

Previously the registration was occuring in a global variable map inside
of Movie.cpp and UiAnimationSystem.cpp

Rolled back the changes to update the CUiAnimNode and CAnimParamType to
use the stateless allocator in their m_name string member.
This was only needed because those types were used in global memory.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the AZStd::hash specializations for basic_string and
basic_fixed_string to be transparent.

This allows hashing of types that aren't basic_string or
basic_fixed_string using the hash specializations for those types
without needing to create an instance of those types.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Adding call to disable saving of the UserSettings.xml in the DisplaySettingsPythonBindingsFixture to avoid race condition running the test in parallel

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
lumberyard-employee-dm
2022-01-14 11:32:29 -06:00
committed by GitHub
parent 4392c8963c
commit b62d130475
13 changed files with 227 additions and 237 deletions
@@ -35,6 +35,11 @@ namespace DisplaySettingsPythonBindingsUnitTests
m_app.Start(appDesc);
m_app.RegisterComponentDescriptor(AzToolsFramework::DisplaySettingsPythonFuncsHandler::CreateDescriptor());
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
// in the unit tests.
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
}
void TearDown() override
@@ -1760,7 +1760,8 @@ namespace AZStd
template<class Element, size_t MaxElementCount, class Traits>
struct hash<basic_fixed_string<Element, MaxElementCount, Traits>>
{
inline constexpr size_t operator()(const basic_fixed_string<Element, MaxElementCount, Traits>& value) const
using is_transparent = void;
inline constexpr size_t operator()(const basic_string_view<Element, Traits>& value) const
{
return hash_string(value.begin(), value.length());
}
@@ -2071,9 +2071,8 @@ namespace AZStd
template<class Element, class Traits, class Allocator>
struct hash< basic_string< Element, Traits, Allocator> >
{
typedef basic_string< Element, Traits, Allocator> argument_type;
typedef AZStd::size_t result_type;
inline result_type operator()(const argument_type& value) const
using is_transparent = void;
inline constexpr size_t operator()(const basic_string_view<Element, Traits>& value) const
{
return hash_string(value.begin(), value.length());
}
+2 -3
View File
@@ -13,7 +13,6 @@
#include <AzCore/Math/Crc.h>
#include <AzCore/Math/Quaternion.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/std/allocator_stateless.h>
#include <Range.h>
#include <AnimKey.h>
@@ -184,7 +183,7 @@ public:
private:
AnimParamType m_type;
AZStd::basic_string<char, AZStd::char_traits<char>, AZStd::stateless_allocator> m_name;
AZStd::string m_name;
};
namespace AZStd
@@ -620,7 +619,7 @@ public:
, valueType(_valueType)
, flags(_flags) {};
AZStd::basic_string<char, AZStd::char_traits<char>, AZStd::stateless_allocator> name; // parameter name.
AZStd::string name; // parameter name.
CAnimParamType paramType; // parameter id.
AnimValueType valueType; // value type, defines type of track to use for animating this parameter.
ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags.