2
0
Эх сурвалжийг харах

ScriptCanvas cmake target cleanup and adjustment to support custom data autogen (#11935)

* ScriptCanvas cmake target cleanup and adjustment to support custom data autogen

Signed-off-by: onecent1101 <[email protected]>

* refactor constants header file

Signed-off-by: onecent1101 <[email protected]>

* Refactor more by putting general function into extension target

Signed-off-by: onecent1101 <[email protected]>

* Add missing files

Signed-off-by: onecent1101 <[email protected]>

* solve unknown enum type

Signed-off-by: onecent1101 <[email protected]>

* add missing include

Signed-off-by: onecent1101 <[email protected]>

* add missing include and updated based on feedback

Signed-off-by: onecent1101 <[email protected]>

Signed-off-by: onecent1101 <[email protected]>
Vincent Liu 2 жил өмнө
parent
commit
38b198f9aa
25 өөрчлөгдсөн 1141 нэмэгдсэн , 1115 устгасан
  1. 0 16
      Gems/ScriptCanvas/Code/CMakeLists.txt
  2. 1 0
      Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariablePaletteTableView.h
  3. 3 3
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasAutoGenRegistry.h
  4. 0 2
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasDataRegistry_Header.jinja
  5. 0 2
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasFunctionRegistry_Header.jinja
  6. 1 13
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h
  7. 1 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SlotMetadata.h
  8. 1 1
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObject.h
  9. 1 1
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObjectPtr.cpp
  10. 28 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/Constants.h
  11. 6 227
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/Data.cpp
  12. 12 777
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/Data.h
  13. 2 1
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataRegistry.h
  14. 5 36
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTrait.h
  15. 50 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTraitBase.h
  16. 269 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataType.cpp
  17. 140 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataType.h
  18. 494 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTypeUtils.cpp
  19. 90 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTypeUtils.h
  20. 4 6
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ContainerTypeReflection.h
  21. 1 0
      Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h
  22. 9 9
      Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake
  23. 7 0
      Gems/ScriptCanvas/Code/scriptcanvasgem_extensions_files.cmake
  24. 15 21
      Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake
  25. 1 0
      Gems/ScriptCanvasDeveloper/Code/Editor/Source/NodeListDumpAction.cpp

+ 0 - 16
Gems/ScriptCanvas/Code/CMakeLists.txt

@@ -114,22 +114,6 @@ ly_add_target(
         Gem::ScriptCanvasDebugger
 )
 
-ly_add_target(
-    NAME ScriptCanvas.API HEADERONLY
-    NAMESPACE Gem
-    FILES_CMAKE
-        scriptcanvasgem_headers.cmake
-    COMPILE_DEFINITIONS
-        INTERFACE
-            SCRIPTCANVAS_ERRORS_ENABLED
-            ${SCRIPT_CANVAS_COMMON_DEFINES}
-    INCLUDE_DIRECTORIES
-        INTERFACE
-            .
-            Include
-            ${SCRIPT_CANVAS_AUTOGEN_BUILD_DIR}
-)
-
 ly_add_target(
     NAME ScriptCanvas ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
     NAMESPACE Gem

+ 1 - 0
Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariablePaletteTableView.h

@@ -20,6 +20,7 @@ AZ_POP_DISABLE_WARNING
 #include <AzCore/Component/EntityId.h>
 #include <AzCore/Memory/SystemAllocator.h>
 
+#include <ScriptCanvas/Core/Core.h>
 #include <ScriptCanvas/Data/Data.h>
 
 #include <GraphCanvas/Widgets/StyledItemDelegates/IconDecoratedNameDelegate.h>

+ 3 - 3
Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasAutoGenRegistry.h

@@ -43,9 +43,9 @@ namespace ScriptCanvas
     {
     public:
         virtual ~ScriptCanvasRegistry() = default;
-        virtual void Init(NodeRegistry* nodeRegistry) = 0;
-        virtual void Reflect(AZ::ReflectContext* context) = 0;
-        virtual AZStd::vector<AZ::ComponentDescriptor*> GetComponentDescriptors() = 0;
+        virtual void Init([[maybe_unused]] NodeRegistry* nodeRegistry) {}
+        virtual void Reflect([[maybe_unused]] AZ::ReflectContext* context) {}
+        virtual AZStd::vector<AZ::ComponentDescriptor*> GetComponentDescriptors() { return {}; }
         void ReleaseDescriptors();
     protected:
         AZStd::vector<AZ::ComponentDescriptor*> m_cachedDescriptors;

+ 0 - 2
Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasDataRegistry_Header.jinja

@@ -33,8 +33,6 @@ namespace ScriptCanvas
  
         //! ScriptCanvasRegistry
         void Reflect(AZ::ReflectContext* context) override;
-        void Init([[maybe_unused]] NodeRegistry* nodeRegistry) override {}
-        AZStd::vector<AZ::ComponentDescriptor*> GetComponentDescriptors() override { return {}; }
 
         //! Get AutoGen registry name
         static const char* GetRegistryName();

+ 0 - 2
Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasFunctionRegistry_Header.jinja

@@ -33,8 +33,6 @@ namespace ScriptCanvas
  
         //! ScriptCanvasRegistry
         void Reflect(AZ::ReflectContext* context) override;
-        void Init([[maybe_unused]] NodeRegistry* nodeRegistry) override {}
-        AZStd::vector<AZ::ComponentDescriptor*> GetComponentDescriptors() override { return {}; }
 
         //! Get AutoGen registry name
         static const char* GetRegistryName();

+ 1 - 13
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h

@@ -25,6 +25,7 @@
 #include <Core/NamedId.h>
 #include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
 #include <AzCore/Console/IConsole.h>
+#include <ScriptCanvas/Data/Constants.h>
 
 #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED
 
@@ -46,19 +47,6 @@ namespace ScriptCanvas
     AZ_CVAR_EXTERNED(bool, g_saveRuntimeAssetsAsPlainTextForDebug);
     AZ_CVAR_EXTERNED(bool, g_saveEditorAssetsAsPlainTextForDebug);
 
-    // #scriptcanvas_component_extension
-    // A place holder identifier for the AZ::Entity that owns the graph.
-    // The actual value in each location initialized to GraphOwnerId is populated with the owning entity at editor-time, Asset Processor-time, or runtime, as soon as the owning entity is known.
-    using GraphOwnerIdType = AZ::EntityId;
-    static const GraphOwnerIdType GraphOwnerId = AZ::EntityId(0xacedc0de);
-
-    // \note Deprecated
-    // A place holder identifier for unique runtime graph on Entity that is running more than one instance of the same graph.
-    // This allows multiple instances of the same graph to be addressed individually on the same entity.
-    // The actual value in each location initialized to UniqueId is populated at run-time.
-    using RuntimeIdType = AZ::EntityId;
-    static const RuntimeIdType UniqueId = AZ::EntityId(0xfee1baad);
-
     constexpr const char* k_EventOutPrefix = "ExecutionSlot:";
     constexpr const char* k_OnVariableWriteEventName = "OnVariableValueChanged";
     constexpr const char* k_OnVariableWriteEbusName = "VariableNotification";

+ 1 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SlotMetadata.h

@@ -8,6 +8,7 @@
 
 #pragma once
 
+#include <ScriptCanvas/Core/Core.h>
 #include <ScriptCanvas/Data/Data.h>
 
 namespace ScriptCanvas

+ 1 - 1
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObject.h

@@ -17,7 +17,7 @@
 #include <AzCore/std/parallel/atomic.h>
 #include <ScriptCanvas/Data/Data.h>
 
-#include "BehaviorContextObjectPtr.h"
+#include <ScriptCanvas/Data/BehaviorContextObjectPtr.h>
 
 namespace AZ
 {

+ 1 - 1
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/BehaviorContextObjectPtr.cpp

@@ -9,7 +9,7 @@
 #include "BehaviorContextObjectPtr.h"
 
 #include <AzCore/RTTI/ReflectContext.h>
-#include "BehaviorContextObject.h"
+#include <ScriptCanvas/Data/BehaviorContextObject.h>
 
 namespace ScriptCanvas
 {

+ 28 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/Constants.h

@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <AzCore/Component/EntityId.h>
+
+namespace ScriptCanvas
+{
+    // #scriptcanvas_component_extension
+    // A place holder identifier for the AZ::Entity that owns the graph.
+    // The actual value in each location initialized to GraphOwnerId is populated with the owning entity at editor-time, Asset
+    // Processor-time, or runtime, as soon as the owning entity is known.
+    using GraphOwnerIdType = AZ::EntityId;
+    static const GraphOwnerIdType GraphOwnerId = AZ::EntityId(0xacedc0de);
+
+    // \note Deprecated
+    // A place holder identifier for unique runtime graph on Entity that is running more than one instance of the same graph.
+    // This allows multiple instances of the same graph to be addressed individually on the same entity.
+    // The actual value in each location initialized to UniqueId is populated at run-time.
+    using RuntimeIdType = AZ::EntityId;
+    static const RuntimeIdType UniqueId = AZ::EntityId(0xfee1baad);
+} // namespace ScriptCanvas

+ 6 - 227
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/Data.cpp

@@ -18,130 +18,6 @@
 
 namespace DataCpp
 {
-    using namespace ScriptCanvas;
-    using namespace ScriptCanvas::Data;
-
-    AZ_INLINE AZStd::pair<bool, Type> FromAZTypeHelper(const AZ::Uuid& type)
-    {
-        if (type.IsNull())
-        {
-            return { true, Type::Invalid() };
-        }
-        else if (IsAABB(type))
-        {
-            return { true, Type::AABB() };
-        }
-        else if (IsAssetId(type))
-        {
-            return { true, Type::AssetId() };
-        }
-        else if (IsBoolean(type))
-        {
-            return { true, Type::Boolean() };
-        }
-        else if (IsColor(type))
-        {
-            return { true, Type::Color() };
-        }
-        else if (IsCRC(type))
-        {
-            return { true, Type::CRC() };
-        }
-        else if (IsEntityID(type))
-        {
-            return { true, Type::EntityID() };
-        }
-        else if (IsNamedEntityID(type))
-        {
-            return{ true, Type::NamedEntityID() };
-        }
-        else if (IsMatrix3x3(type))
-        {
-            return { true, Type::Matrix3x3() };
-        }
-        else if (IsMatrix4x4(type))
-        {
-            return { true, Type::Matrix4x4() };
-        }
-        else if (IsNumber(type))
-        {
-            return { true, Type::Number() };
-        }
-        else if (IsOBB(type))
-        {
-            return { true, Type::OBB() };
-        }
-        else if (IsPlane(type))
-        {
-            return { true, Type::Plane() };
-        }
-        else if (IsQuaternion(type))
-        {
-            return { true, Type::Quaternion() };
-        }
-        else if (IsString(type))
-        {
-            return { true, Type::String() };
-        }
-        else if (IsTransform(type))
-        {
-            return { true, Type::Transform() };
-        }
-        else if (IsVector2(type))
-        {
-            return { true, Type::Vector2() };
-        }
-        else if (IsVector3(type))
-        {
-            return { true, Type::Vector3() };
-        }
-        else if (IsVector4(type))
-        {
-            return { true, Type::Vector4() };
-        }
-        else
-        {
-            return { false, Type::Invalid() };
-        }
-    }
-
-    AZ_INLINE AZStd::pair<bool, Type> FromBehaviorContextTypeHelper(const AZ::Uuid& type)
-    {
-        if (type.IsNull())
-        {
-            return { true, Type::Invalid() };
-        }
-        else if (IsBoolean(type))
-        {
-            return { true, Type::Boolean() };
-        }
-        else if (IsEntityID(type))
-        {
-            return { true, Type::EntityID() };
-        }
-        else if (IsNamedEntityID(type))
-        {
-            return{ true, Type::NamedEntityID() };
-        }
-        else if (IsNumber(type))
-        {
-            return { true, Type::Number() };
-        }
-        else if (IsString(type))
-        {
-            return { true, Type::String() };
-        }
-        else
-        {
-            return { false, Type::Invalid() };
-        }
-    }
-    
-    AZ_INLINE bool IsSupportedBehaviorContextObject(const AZ::Uuid& typeID)
-    {
-        return AZ::BehaviorContextHelper::GetClass(typeID) != nullptr;
-    }
-
     AZ_INLINE const char* GetRawBehaviorContextName(const AZ::Uuid& typeID)
     {
         AZ::BehaviorContext* behaviorContext(nullptr);
@@ -164,23 +40,7 @@ namespace DataCpp
 namespace ScriptCanvas
 {
     namespace Data
-    {
-        Type FromAZType(const AZ::Uuid& type)
-        {
-            AZStd::pair<bool, Type> help = DataCpp::FromAZTypeHelper(type);
-            return help.first ? help.second : Type::BehaviorContextObject(type);
-        }
-        
-        Type FromAZTypeChecked(const AZ::Uuid& type)
-        {
-            AZStd::pair<bool, Type> help = DataCpp::FromAZTypeHelper(type);
-            return help.first 
-                ? help.second 
-                : DataCpp::IsSupportedBehaviorContextObject(type)
-                    ? Type::BehaviorContextObject(type)
-                    : Type::Invalid();
-        }
-        
+    {        
         AZStd::string GetBehaviorClassName(const AZ::Uuid& typeID)
         {
             AZ::BehaviorContext* behaviorContext(nullptr);
@@ -203,15 +63,14 @@ namespace ScriptCanvas
                 }
                 // Special casing out the fixed size vectors/arrays.
                 // Will need a more in depth way of generating these names long term I think.
-                else if (typeID == AZ::GetGenericClassInfoArrayTypeId()
-                    || typeID == AZ::GetGenericClassInfoFixedVectorTypeId())
+                else if (typeID == AZ::GetGenericClassInfoArrayTypeId() || typeID == AZ::GetGenericClassInfoFixedVectorTypeId())
                 {
                     return "Fixed Size Array";
                 }
                 else if (AZ::Utils::IsVectorContainerType(typeID))
                 {
                     return "Array";
-                }                
+                }
                 else
                 {
                     return "Unknown Container";
@@ -221,7 +80,8 @@ namespace ScriptCanvas
             {
                 if (const AZ::BehaviorClass* behaviorClass = AZ::BehaviorContextHelper::GetClass(typeID))
                 {
-                    if (AZ::Attribute* prettyNameAttribute = AZ::FindAttribute(AZ::ScriptCanvasAttributes::PrettyName, behaviorClass->m_attributes))
+                    if (AZ::Attribute* prettyNameAttribute =
+                            AZ::FindAttribute(AZ::ScriptCanvasAttributes::PrettyName, behaviorClass->m_attributes))
                     {
                         AZ::AttributeReader operatorAttrReader(nullptr, prettyNameAttribute);
                         AZStd::string prettyName;
@@ -238,7 +98,7 @@ namespace ScriptCanvas
 
             return "Invalid BehaviorContext::Class name";
         }
-        
+
         AZStd::string GetName(const Type& type)
         {
             switch (type.GetType())
@@ -357,64 +217,6 @@ namespace ScriptCanvas
             }
         }
 
-        bool IsAZRttiTypeOf(const AZ::Uuid& candidate, const AZ::Uuid& reference)
-        {
-            auto bcClass = AZ::BehaviorContextHelper::GetClass(candidate);
-            return bcClass
-                && bcClass->m_azRtti
-                && bcClass->m_azRtti->IsTypeOf(reference);
-        }
-
-        bool IsOutcomeType(const AZ::Uuid& type)
-        {
-            return AZ::Utils::IsOutcomeType(type);
-        }
-
-        bool IsOutcomeType(const Type& type)
-        {
-            return AZ::Utils::IsOutcomeType(ToAZType(type));
-        }
-
-        bool IsVectorContainerType(const AZ::Uuid& type)
-        {
-            return AZ::Utils::IsVectorContainerType(type);
-        }
-
-        bool IsVectorContainerType(const Type& type)
-        {
-            return AZ::Utils::IsVectorContainerType(ToAZType(type));
-        }
-
-        bool IsSetContainerType(const AZ::Uuid& type)
-        {
-            return AZ::Utils::IsSetContainerType(type);
-        }
-
-        bool IsSetContainerType(const Type& type)
-        {
-            return AZ::Utils::IsSetContainerType(ToAZType(type));
-        }
-
-        bool IsMapContainerType(const AZ::Uuid& type)
-        {
-            return AZ::Utils::IsMapContainerType(type);
-        }
-
-        bool IsMapContainerType(const Type& type)
-        {
-            return AZ::Utils::IsMapContainerType(ToAZType(type));
-        }
-
-        bool IsContainerType(const AZ::Uuid& type)
-        {
-            return AZ::Utils::IsContainerType(type);
-        }
-
-        bool IsContainerType(const Type& type)
-        {
-            return AZ::Utils::IsContainerType(ToAZType(type));
-        }
-
         AZStd::vector<AZ::Uuid> GetContainedTypes(const AZ::Uuid& type)
         {
             return AZ::Utils::GetContainedTypes(type);
@@ -453,28 +255,5 @@ namespace ScriptCanvas
             AZStd::pair<AZ::Uuid, AZ::Uuid> azOutcomeTypes(GetOutcomeTypes(ToAZType(type)));
             return AZStd::make_pair(FromAZType(azOutcomeTypes.first), FromAZType(azOutcomeTypes.second));
         }
-
-        void Type::Reflect(AZ::ReflectContext* reflection)
-        {
-            if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection))
-            {
-                serializeContext->Class<Type>()
-                    ->Version(2)
-                    ->Field("m_type", &Type::m_type)
-                    ->Field("m_azType", &Type::m_azType)
-                    ;
-            }
-        }
-
-        bool Type::operator==(const Type& other) const
-        {
-            return IS_EXACTLY_A(other);
-        }
-
-        bool Type::operator!=(const Type& other) const
-        {
-            return !((*this) == other);
-        }
-
     }
 }

+ 12 - 777
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/Data.h

@@ -7,810 +7,45 @@
  */
 #pragma once
 
-#include <AzCore/Asset/AssetCommon.h>
-#include <AzCore/Component/EntityId.h>
-#include <AzCore/Math/Aabb.h>
-#include <AzCore/Math/Color.h>
-#include <AzCore/Math/Crc.h>
-#include <AzCore/Math/Matrix3x3.h>
-#include <AzCore/Math/Matrix4x4.h>
-#include <AzCore/Math/Obb.h>
-#include <AzCore/Math/Plane.h>
-#include <AzCore/Math/Quaternion.h>
-#include <AzCore/Math/Transform.h>
-#include <AzCore/Math/Uuid.h>
-#include <AzCore/Math/Vector2.h>
-#include <AzCore/Math/Vector3.h>
-#include <AzCore/Math/Vector4.h>
-#include <AzCore/RTTI/TypeInfo.h>
-#include <AzCore/std/string/string.h>
-#include <ScriptCanvas/Core/Core.h>
+#include <AzCore/Debug/Budget.h>
+
+#include <ScriptCanvas/Data/DataTraitBase.h>
+#include <ScriptCanvas/Data/DataTypeUtils.h>
 
 AZ_DECLARE_BUDGET(ScriptCanvas);
 
 namespace AZ
 {
     class ReflectContext;
+    struct BehaviorParameter;
 }
 
 namespace ScriptCanvas
 {
     namespace Data
     {
-        //////////////////////////////////////////////////////////////////////////
-        // type interface
-        //////////////////////////////////////////////////////////////////////////
-
-        /// \note CHANGING THE ORDER OR NUMBER OF VALUES IN THIS LIST ALMOST CERTAINLY INVALIDATES PREVIOUS DATA
-        enum class eType : AZ::u32
-        {
-            Boolean,
-            EntityID,
-            Invalid,
-            Number,
-            BehaviorContextObject,
-            String,
-            Quaternion,
-            Transform,
-            Vector3,
-            Vector2,
-            Vector4,
-            AABB,
-            Color,
-            CRC,
-            Matrix3x3,
-            Matrix4x4,
-            OBB,
-            Plane,
-            NamedEntityID,
-            // Function, 
-            // List,
-            AssetId,
-        };
-
-        using AABBType = AZ::Aabb;
-        using AssetIdType = AZ::Data::AssetId;
-        using BooleanType = bool;
-        using CRCType = AZ::Crc32;
-        using ColorType = AZ::Color;
-        using EntityIDType = AZ::EntityId;
-        using NamedEntityIDType = AZ::NamedEntityId;
-        using Matrix3x3Type = AZ::Matrix3x3;
-        using Matrix4x4Type = AZ::Matrix4x4;
-        using NumberType = double;
-        using OBBType = AZ::Obb;
-        using PlaneType = AZ::Plane;
-        using QuaternionType = AZ::Quaternion;
-        using StringType = AZStd::string;
-        using TransformType = AZ::Transform;
-        using Vector2Type = AZ::Vector2;
-        using Vector3Type = AZ::Vector3;
-        using Vector4Type = AZ::Vector4;
-
-        class Type final
-        {
-        public:
-            AZ_TYPE_INFO(Type, "{0EADF8F5-8AB8-42E9-9C50-F5C78255C817}");
-
-            static void Reflect(AZ::ReflectContext* reflection);
-
-            static Type AABB();
-            static Type AssetId();
-            static Type BehaviorContextObject(const AZ::Uuid& aztype);
-            static Type Boolean();
-            static Type Color();
-            static Type CRC();
-            static Type EntityID();
-            static Type NamedEntityID();
-            static Type Invalid();
-            static Type Matrix3x3();
-            static Type Matrix4x4();
-            static Type Number();
-            static Type OBB();
-            static Type Plane();
-            static Type Quaternion();
-            static Type String();
-            static Type Transform();
-            static Type Vector2();
-            static Type Vector3();
-            static Type Vector4();
-
-            // the default ctr produces the invalid type, and is only here to help the compiler
-            Type();
-
-            AZ::Uuid GetAZType() const;
-            eType GetType() const;
-            bool IsValid() const;
-            explicit operator bool() const;
-            bool operator!() const;
-
-            bool operator==(const Type& other) const;
-            bool operator!=(const Type& other) const;
-
-            // returns true if this type is, or is derived from the other type
-            AZ_FORCE_INLINE bool IS_A(const Type& other) const;
-            AZ_FORCE_INLINE bool IS_EXACTLY_A(const Type& other) const;
-
-            AZ_FORCE_INLINE bool IsConvertibleFrom(const AZ::Uuid& target) const;
-            AZ_FORCE_INLINE bool IsConvertibleFrom(const Type& target) const;
-
-            AZ_FORCE_INLINE bool IsConvertibleTo(const AZ::Uuid& target) const;
-            AZ_FORCE_INLINE bool IsConvertibleTo(const Type& target) const;
-
-            Type& operator=(const Type& source) = default;
-
-        private:
-            eType m_type;
-            AZ::Uuid m_azType;
-
-            explicit Type(eType type);
-            // for BehaviorContextObjects specifically
-            explicit Type(const AZ::Uuid& aztype);
-        };
-
-        /**
-         * assumes that azType is a valid script canvas type of some kind, asserts if not
-         * favors native ScriptCanvas types over BehaviorContext class types with the corresponding AZ type id
-         */
-        Type FromAZType(const AZ::Uuid& aztype);
-
-        // if azType is not a valid script canvas type of some kind, returns invalid, NOT for use at run-time
-        Type FromAZTypeChecked(const AZ::Uuid& aztype);
-
         template<typename T>
-        Type FromAZType();
+        AZ_INLINE Type FromAZType()
+        {
+            return FromAZType(azrtti_typeid<T>());
+        }
 
         // returns the most raw name for the type
         const char* GetBehaviorContextName(const AZ::Uuid& azType);
         const char* GetBehaviorContextName(const Type& type);
+
         // returns a possibly prettier name for the type
         AZStd::string GetBehaviorClassName(const AZ::Uuid& typeID);
+
         // returns a possibly prettier name for the type
         AZStd::string GetName(const Type& type);
         const Type GetBehaviorParameterDataType(const AZ::BehaviorParameter& parameter);
 
-        bool IsAZRttiTypeOf(const AZ::Uuid& candidate, const AZ::Uuid& reference);
-
-        // returns true if candidate is, or is derived from reference
-        bool IS_A(const Type& candidate, const Type& reference);
-        bool IS_EXACTLY_A(const Type& candidate, const Type& reference);
-
-        bool IsConvertible(const Type& source, const AZ::Uuid& target);
-        bool IsConvertible(const Type& source, const Type& target);
-
-        bool IsAutoBoxedType(const Type& type);
-        bool IsValueType(const Type& type);
-        bool IsVectorType(const AZ::Uuid& type);
-        bool IsVectorType(const Type& type);
-        AZ::Uuid ToAZType(const Type& type);
-
-        bool IsContainerType(const AZ::Uuid& type);
-        bool IsContainerType(const Type& type);
-        bool IsMapContainerType(const AZ::Uuid& type);
-        bool IsMapContainerType(const Type& type);
-        bool IsOutcomeType(const AZ::Uuid& type);
-        bool IsOutcomeType(const Type& type);
-        bool IsSetContainerType(const AZ::Uuid& type);
-        bool IsSetContainerType(const Type& type);
-        bool IsVectorContainerType(const AZ::Uuid& type);
-        bool IsVectorContainerType(const Type& type);
-
         AZStd::vector<AZ::Uuid> GetContainedTypes(const AZ::Uuid& type);
         AZStd::vector<Type> GetContainedTypes(const Type& type);
         AZStd::pair<AZ::Uuid, AZ::Uuid> GetOutcomeTypes(const AZ::Uuid& type);
         AZStd::pair<Type, Type> GetOutcomeTypes(const Type& type);
-
-        bool IsAABB(const AZ::Uuid& type);
-        bool IsAABB(const Type& type);
-        bool IsAssetId(const AZ::Uuid& type);
-        bool IsAssetId(const Type& type);
-        bool IsBoolean(const AZ::Uuid& type);
-        bool IsBoolean(const Type& type);
-        bool IsColor(const AZ::Uuid& type);
-        bool IsColor(const Type& type);
-        bool IsCRC(const AZ::Uuid& type);
-        bool IsCRC(const Type& type);
-        bool IsEntityID(const AZ::Uuid& type);
-        bool IsEntityID(const Type& type);
-        bool IsNamedEntityID(const AZ::Uuid& type);
-        bool IsNamedEntityID(const Type& type);
-        bool IsNumber(const AZ::Uuid& type);
-        bool IsNumber(const Type& type);
-        bool IsMatrix3x3(const AZ::Uuid& type);
-        bool IsMatrix3x3(const Type& type);
-        bool IsMatrix4x4(const AZ::Uuid& type);
-        bool IsMatrix4x4(const Type& type);
-        bool IsOBB(const AZ::Uuid& type);
-        bool IsOBB(const Type& type);
-        bool IsPlane(const AZ::Uuid& type);
-        bool IsPlane(const Type& type);
-        bool IsQuaternion(const AZ::Uuid& type);
-        bool IsQuaternion(const Type& type);
-        bool IsString(const AZ::Uuid& type);
-        bool IsString(const Type& type);
-        bool IsTransform(const AZ::Uuid& type);
-        bool IsTransform(const Type& type);
-        bool IsVector2(const AZ::Uuid& type);
-        bool IsVector2(const Type& type);
-        bool IsVector3(const AZ::Uuid& type);
-        bool IsVector3(const Type& type);
-        bool IsVector4(const AZ::Uuid& type);
-        bool IsVector4(const Type& type);
-
-        //////////////////////////////////////////////////////////////////////////
-        // type implementation
-        //////////////////////////////////////////////////////////////////////////
-        template<typename T>
-        AZ_INLINE Type FromAZType()
-        {
-            return FromAZType(azrtti_typeid<T>());
-        }
-
-        AZ_INLINE bool IsAABB(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AABBType>();
-        }
-
-        AZ_INLINE bool IsAABB(const Type& type)
-        {
-            return type.GetType() == eType::AABB;
-        }
-
-        AZ_INLINE bool IsAssetId(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AssetIdType>();
-        }
-
-        AZ_INLINE bool IsAssetId(const Type& type)
-        {
-            return type.GetType() == eType::AssetId;
-        }
-
-        AZ_INLINE bool IsBoolean(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<bool>();
-        }
-
-        AZ_INLINE bool IsBoolean(const Type& type)
-        {
-            return type.GetType() == eType::Boolean;
-        }
-
-        AZ_INLINE bool IsColor(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<ColorType>();
-        }
-
-        AZ_INLINE bool IsColor(const Type& type)
-        {
-            return type.GetType() == eType::Color;
-        }
-
-        AZ_INLINE bool IsCRC(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<CRCType>();
-        }
-
-        AZ_INLINE bool IsCRC(const Type& type)
-        {
-            return type.GetType() == eType::CRC;
-        }
-
-        AZ_INLINE bool IsEntityID(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::EntityId>();
-        }
-
-        AZ_INLINE bool IsEntityID(const Type& type)
-        {
-            return type.GetType() == eType::EntityID;
-        }
-
-        AZ_INLINE bool IsNamedEntityID(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::NamedEntityId>();
-        }
-
-        AZ_INLINE bool IsNamedEntityID(const Type& type)
-        {
-            return type.GetType() == eType::NamedEntityID;
-        }
-
-        AZ_INLINE bool IsMatrix3x3(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::Matrix3x3>();
-        }
-
-        AZ_INLINE bool IsMatrix3x3(const Type& type)
-        {
-            return type.GetType() == eType::Matrix3x3;
-        }
-
-        AZ_INLINE bool IsMatrix4x4(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::Matrix4x4>();
-        }
-
-        AZ_INLINE bool IsMatrix4x4(const Type& type)
-        {
-            return type.GetType() == eType::Matrix4x4;
-        }
-
-        AZ_INLINE bool IsNumber(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::s8>()
-                || type == azrtti_typeid<AZ::s16>()
-                || type == azrtti_typeid<AZ::s32>()
-                || type == azrtti_typeid<AZ::s64>()
-                || type == azrtti_typeid<AZ::u8>()
-                || type == azrtti_typeid<AZ::u16>()
-                || type == azrtti_typeid<AZ::u32>()
-                || type == azrtti_typeid<AZ::u64>()
-                || type == azrtti_typeid<unsigned long>()
-                || type == azrtti_typeid<float>()
-                || type == azrtti_typeid<double>();
-        }
-
-        AZ_INLINE bool IsNumber(const Type& type)
-        {
-            return type.GetType() == eType::Number;
-        }
-
-        AZ_INLINE bool IsOBB(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<OBBType>();
-        }
-
-        AZ_INLINE bool IsOBB(const Type& type)
-        {
-            return type.GetType() == eType::OBB;
-        }
-
-        AZ_INLINE bool IsPlane(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<PlaneType>();
-        }
-
-        AZ_INLINE bool IsPlane(const Type& type)
-        {
-            return type.GetType() == eType::Plane;
-        }
-
-        AZ_INLINE bool IsQuaternion(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<QuaternionType>();
-        }
-
-        AZ_INLINE bool IsQuaternion(const Type& type)
-        {
-            return type.GetType() == eType::Quaternion;
-        }
-
-        AZ_INLINE bool IsString(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<StringType>();
-        }
-
-        AZ_INLINE bool IsString(const Type& type)
-        {
-            return type.GetType() == eType::String;
-        }
-
-        AZ_INLINE bool IsTransform(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<TransformType>();
-        }
-
-        AZ_INLINE bool IsTransform(const Type& type)
-        {
-            return type.GetType() == eType::Transform;
-        }
-
-        AZ_INLINE bool IsVector3(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::Vector3>();
-        }
-
-        AZ_INLINE bool IsVector2(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::Vector2>();
-        }
-
-        AZ_INLINE bool IsVector4(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::Vector4>();
-        }
-
-        AZ_INLINE bool IsVector3(const Type& type)
-        {
-            return type.GetType() == eType::Vector3;
-        }
-
-        AZ_INLINE bool IsVector2(const Type& type)
-        {
-            return type.GetType() == eType::Vector2;
-        }
-
-        AZ_INLINE bool IsVector4(const Type& type)
-        {
-            return type.GetType() == eType::Vector4;
-        }
-
-        AZ_INLINE AZ::Uuid ToAZType(eType type)
-        {
-            switch (type)
-            {
-            case eType::AABB:
-                return azrtti_typeid<AABBType>();
-
-            case eType::AssetId:
-                return azrtti_typeid<AssetIdType>();
-
-            case eType::Boolean:
-                return azrtti_typeid<bool>();
-
-            case eType::Color:
-                return azrtti_typeid<ColorType>();
-
-            case eType::CRC:
-                return azrtti_typeid<CRCType>();
-
-            case eType::EntityID:
-                return azrtti_typeid<AZ::EntityId>();
-
-            case eType::NamedEntityID:
-                return azrtti_typeid<AZ::NamedEntityId>();
-
-            case eType::Invalid:
-                return AZ::Uuid::CreateNull();
-
-            case eType::Matrix3x3:
-                return azrtti_typeid<AZ::Matrix3x3>();
-
-            case eType::Matrix4x4:
-                return azrtti_typeid<AZ::Matrix4x4>();
-
-            case eType::Number:
-                return azrtti_typeid<NumberType>();
-
-            case eType::OBB:
-                return azrtti_typeid<OBBType>();
-
-            case eType::Plane:
-                return azrtti_typeid<PlaneType>();
-
-            case eType::Quaternion:
-                return azrtti_typeid<QuaternionType>();
-
-            case eType::String:
-                return azrtti_typeid<StringType>();
-
-            case eType::Transform:
-                return azrtti_typeid<TransformType>();
-
-            case eType::Vector2:
-                return azrtti_typeid<AZ::Vector2>();
-
-            case eType::Vector3:
-                return azrtti_typeid<AZ::Vector3>();
-
-            case eType::Vector4:
-                return azrtti_typeid<AZ::Vector4>();
-
-            default:
-                AZ_Assert(false, "Invalid type!");
-                // check for behavior context support
-                return AZ::Uuid::CreateNull();
-            }
-        }
-
-        AZ_INLINE AZ::Uuid ToAZType(const Type& type)
-        {
-            eType typeEnum = type.GetType();
-            if (typeEnum == eType::BehaviorContextObject)
-            {
-                return type.GetAZType();
-            }
-
-            return ToAZType(typeEnum);
-        }
-
-        AZ_INLINE bool IsVectorType(const AZ::Uuid& type)
-        {
-            return type == azrtti_typeid<AZ::Vector3>()
-                || type == azrtti_typeid<AZ::Vector2>()
-                || type == azrtti_typeid<AZ::Vector4>();
-        }
-
-        AZ_INLINE bool IsVectorType(const Type& type)
-        {
-            static const AZ::u32 s_vectorTypes =
-            {
-                1 << static_cast<AZ::u32>(eType::Vector3)
-                | 1 << static_cast<AZ::u32>(eType::Vector2)
-                | 1 << static_cast<AZ::u32>(eType::Vector4)
-            };
-
-            return ((1 << static_cast<AZ::u32>(type.GetType())) & s_vectorTypes) != 0;
-        }
-
-        AZ_INLINE bool IsAutoBoxedType(const Type& type)
-        {
-            static const AZ::u32 s_autoBoxedTypes =
-            {
-                1 << static_cast<AZ::u32>(eType::AABB)
-                | 1 << static_cast<AZ::u32>(eType::Color)
-                | 1 << static_cast<AZ::u32>(eType::CRC)
-                | 1 << static_cast<AZ::u32>(eType::Matrix3x3)
-                | 1 << static_cast<AZ::u32>(eType::Matrix4x4)
-                | 1 << static_cast<AZ::u32>(eType::OBB)
-                | 1 << static_cast<AZ::u32>(eType::Quaternion)
-                | 1 << static_cast<AZ::u32>(eType::Transform)
-                | 1 << static_cast<AZ::u32>(eType::Vector3)
-                | 1 << static_cast<AZ::u32>(eType::Vector2)
-                | 1 << static_cast<AZ::u32>(eType::Vector4)
-            };
-
-            return ((1 << static_cast<AZ::u32>(type.GetType())) & s_autoBoxedTypes) != 0;
-        }
-
-        AZ_INLINE bool IsValueType(const Type& type)
-        {
-            return type.GetType() != eType::BehaviorContextObject;
-        }
-
-        AZ_FORCE_INLINE Type::Type()
-            : m_type(eType::Invalid)
-            , m_azType(AZ::Uuid::CreateNull())
-        {}
-
-        AZ_FORCE_INLINE Type::Type(eType type)
-            : m_type(type)
-            , m_azType(AZ::Uuid::CreateNull())
-        {}
-
-        AZ_FORCE_INLINE Type::Type(const AZ::Uuid& aztype)
-            : m_type(eType::BehaviorContextObject)
-            , m_azType(aztype)
-        {
-            AZ_Error("ScriptCanvas", !aztype.IsNull(), "no invalid aztypes allowed");
-        }
-
-        AZ_FORCE_INLINE Type Type::AABB()
-        {
-            return Type(eType::AABB);
-        }
-
-        AZ_FORCE_INLINE Type Type::AssetId()
-        {
-            return Type(eType::AssetId);
-        }
-
-        AZ_FORCE_INLINE Type Type::BehaviorContextObject(const AZ::Uuid& aztype)
-        {
-            return Type(aztype);
-        }
-
-        AZ_FORCE_INLINE Type Type::Boolean()
-        {
-            return Type(eType::Boolean);
-        }
-
-        AZ_FORCE_INLINE Type Type::Color()
-        {
-            return Type(eType::Color);
-        }
-
-        AZ_FORCE_INLINE Type Type::CRC()
-        {
-            return Type(eType::CRC);
-        }
-
-        AZ_FORCE_INLINE Type Type::EntityID()
-        {
-            return Type(eType::EntityID);
-        }
-
-        AZ_FORCE_INLINE Type Type::NamedEntityID()
-        {
-            return Type(eType::NamedEntityID);
-        }
-
-        AZ_FORCE_INLINE AZ::Uuid Type::GetAZType() const
-        {
-            if (m_type == eType::BehaviorContextObject)
-            {
-                return m_azType;
-            }
-            else
-            {
-                return ScriptCanvas::Data::ToAZType((*this));
-            }
-        }
-
-        AZ_FORCE_INLINE eType Type::GetType() const
-        {
-            return m_type;
-        }
-
-        AZ_FORCE_INLINE Type Type::Invalid()
-        {
-            return Type();
-        }
-
-        AZ_FORCE_INLINE bool IS_A(const Type& candidate, const Type& reference)
-        {
-            return candidate.IS_A(reference);
-        }
-
-        AZ_FORCE_INLINE bool IS_EXACTLY_A(const Type& candidate, const Type& reference)
-        {
-            return candidate.IS_EXACTLY_A(reference);
-        }
-
-        AZ_FORCE_INLINE bool IsConvertible(const Type& source, const AZ::Uuid& target)
-        {
-            return source.IsConvertibleTo(target);
-        }
-
-        AZ_FORCE_INLINE bool IsConvertible(const Type& source, const Type& target)
-        {
-            return source.IsConvertibleTo(target);
-        }
-
-        AZ_FORCE_INLINE bool Type::IsConvertibleFrom(const AZ::Uuid& target) const
-        {
-            return FromAZType(target).IsConvertibleTo(*this);
-        }
-
-        AZ_FORCE_INLINE bool Type::IsConvertibleFrom(const Type& target) const
-        {
-            return target.IsConvertibleTo(*this);
-        }
-
-        AZ_FORCE_INLINE bool Type::IsConvertibleTo(const AZ::Uuid& target) const
-        {
-            return IsConvertibleTo(FromAZType(target));
-        }
-
-        AZ_FORCE_INLINE bool Type::IsConvertibleTo(const Type& target) const
-        {
-            auto isVector2Vector = [&]()->bool 
-            {
-                return IsVectorType(target) || (target.GetType() == eType::BehaviorContextObject && IsVectorType(target.GetAZType()));
-            };
-
-            AZ_Assert(!IS_A(target)
-                , "Don't mix concepts, it is too dangerous. "
-                  "Check IS-A separately from conversion at all times. "
-                  "Use IS_A || IsConvertibleTo in an expression");
-
-            const auto targetEType = target.GetType();
-            if (targetEType == eType::String)
-            {
-                // everything is implicitly convertible to strings, including strings
-                return true;
-            }
-
-            switch (GetType())
-            {
-            case eType::Boolean:
-                return targetEType == eType::Number;
-
-            case eType::Color:
-                return targetEType == eType::Vector3
-                    || targetEType == eType::Vector4;
-
-            case eType::Matrix3x3:
-                return targetEType == eType::Quaternion;
-
-            case eType::Matrix4x4:
-                return targetEType == eType::Transform
-                    || targetEType == eType::Quaternion;
-
-            case eType::Number:
-                return targetEType == eType::Boolean;
-
-            case eType::Transform:
-                return targetEType == eType::Matrix4x4;
-
-            case eType::Quaternion:
-                return targetEType == eType::Matrix3x3
-                    || targetEType == eType::Matrix4x4
-                    || targetEType == eType::Transform;
-
-            case eType::Vector2:
-                return isVector2Vector();
-            case eType::Vector3:
-            case eType::Vector4:
-                return isVector2Vector() || targetEType == eType::Color;
-            default:
-                return false;
-            }
-        }
-
-        AZ_FORCE_INLINE bool Type::IS_A(const Type& other) const
-        {
-            return m_type == other.m_type && (m_type != eType::BehaviorContextObject || m_azType == other.m_azType || IsAZRttiTypeOf(m_azType, other.m_azType));
-        }
-
-        AZ_FORCE_INLINE bool Type::IS_EXACTLY_A(const Type& other) const
-        {
-            return m_type == other.m_type && m_azType == other.m_azType;
-        }
-
-        AZ_FORCE_INLINE bool Type::IsValid() const
-        {
-            return m_type != eType::Invalid;
-        }
-
-        AZ_FORCE_INLINE Type Type::Matrix3x3()
-        {
-            return Type(eType::Matrix3x3);
-        }
-
-        AZ_FORCE_INLINE Type Type::Matrix4x4()
-        {
-            return Type(eType::Matrix4x4);
-        }
-
-        AZ_FORCE_INLINE Type Type::Number()
-        {
-            return Type(eType::Number);
-        }
-
-        AZ_FORCE_INLINE Type Type::OBB()
-        {
-            return Type(eType::OBB);
-        }
-
-        AZ_FORCE_INLINE Type::operator bool() const
-        {
-            return m_type != eType::Invalid;
-        }
-
-        AZ_FORCE_INLINE bool Type::operator!() const
-        {
-            return m_type == eType::Invalid;
-        }
-
-        AZ_FORCE_INLINE Type Type::Plane()
-        {
-            return Type(eType::Plane);
-        }
-
-        AZ_FORCE_INLINE Type Type::Quaternion()
-        {
-            return Type(eType::Quaternion);
-        }
-
-        AZ_FORCE_INLINE Type Type::String()
-        {
-            return Type(eType::String);
-        }
-
-        AZ_FORCE_INLINE Type Type::Transform()
-        {
-            return Type(eType::Transform);
-        }
-
-        AZ_FORCE_INLINE Type Type::Vector3()
-        {
-            return Type(eType::Vector3);
-        }
-
-        AZ_FORCE_INLINE Type Type::Vector2()
-        {
-            return Type(eType::Vector2);
-        }
-
-        AZ_FORCE_INLINE Type Type::Vector4()
-        {
-            return Type(eType::Vector4);
-        }
-
-    } 
-
+    }
 } 
 
 namespace AZStd

+ 2 - 1
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataRegistry.h

@@ -9,10 +9,11 @@
 #pragma once
 
 #include <AzCore/Module/Environment.h>
-#include <ScriptCanvas/Data/Traits.h>
 #include <AzCore/std/utils.h>
 #include <AzCore/RTTI/ReflectContext.h>
 
+#include <ScriptCanvas/Data/Traits.h>
+
 namespace ScriptCanvas
 {
     struct TypeProperties

+ 5 - 36
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTrait.h

@@ -8,46 +8,15 @@
 
 #pragma once
 
-#include <Data/BehaviorContextObjectPtr.h>
-#include <Data/Data.h>
-
-//#include <AzFramework/Entity/EntityContextBus.h>
-//#include <AzFramework/Slice/SliceInstantiationTicket.h>
+#include <ScriptCanvas/Data/BehaviorContextObjectPtr.h>
+#include <ScriptCanvas/Data/Constants.h>
+#include <ScriptCanvas/Data/Data.h>
+#include <ScriptCanvas/Data/DataTraitBase.h>
 
 namespace ScriptCanvas
 {
     namespace Data
-    {   
-        template<typename t_Type>
-        struct TraitsBase
-        {
-            using ThisType = TraitsBase<t_Type>;
-            using Type = AZStd::decay_t<t_Type>;
-            static const bool s_isAutoBoxed = false;
-            static const bool s_isKey = false;
-            static const bool s_isNative = false;
-            static const eType s_type = eType::Invalid;
-
-            static AZ::Uuid GetAZType(const Data::Type& = {}) { return azrtti_typeid<t_Type>(); }
-            static Data::Type GetSCType(const AZ::TypeId& = AZ::TypeId::CreateNull()) { return Data::FromAZType(GetAZType()); }
-            static AZStd::string GetName(const Data::Type& = {}) { return Data::GetName(Data::FromAZType(GetAZType())); }
-            // The static_assert needs to rely on the template parameter in order to avoid the clang frontend from asserting when parsing the template declaration
-            static Type GetDefault(const Data::Type& = {}) { static_assert((!AZStd::is_same<t_Type, t_Type>::value), "implement in the typed function"); return {}; }
-            static bool IsDefault(const AZStd::any&, const Data::Type& = {}) { static_assert((!AZStd::is_same<t_Type, t_Type>::value), "implement in the typed function"); return {}; }
-        };
-
-        
-        template<typename t_Type>
-        struct Traits : public TraitsBase<t_Type>
-        {
-        };
-                
-        // a compile time map of eType back to underlying AZ type and traits
-        template<eType>
-        struct eTraits
-        {
-        };
-
+    {                   
         struct TypeErasedDataTraits
         {
             AZ_CLASS_ALLOCATOR(TypeErasedDataTraits, AZ::SystemAllocator, 0);

+ 50 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTraitBase.h

@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <AzCore/std/any.h>
+#include <ScriptCanvas/Data/DataType.h>
+
+namespace ScriptCanvas
+{
+    namespace Data
+    {
+        template<typename t_Type>
+        struct TraitsBase
+        {
+            using ThisType = TraitsBase<t_Type>;
+            using Type = AZStd::decay_t<t_Type>;
+            static const bool s_isAutoBoxed = false;
+            static const bool s_isKey = false;
+            static const bool s_isNative = false;
+            static const eType s_type = eType::Invalid;
+
+            static AZ::Uuid GetAZType(const Data::Type& = {})
+            {
+                return azrtti_typeid<t_Type>();
+            }
+            // Force a compiler error if Traits class doesn't have explicit specialization
+            static Data::Type GetSCType(const AZ::TypeId& = AZ::TypeId::CreateNull()) = delete;
+            static AZStd::string GetName(const Data::Type& = {}) = delete;
+            static Type GetDefault(const Data::Type& = {}) = delete;
+            static bool IsDefault(const AZStd::any&, const Data::Type& = {}) = delete;
+        };
+
+        template<typename t_Type>
+        struct Traits : public TraitsBase<t_Type>
+        {
+        };
+
+        // A compile time map of eType back to underlying AZ type and traits
+        template<eType>
+        struct eTraits
+        {
+        };
+    } // namespace Data
+} // namespace ScriptCanvas

+ 269 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataType.cpp

@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#include "DataType.h"
+
+#include <AzCore/Serialization/SerializeContext.h>
+#include <ScriptCanvas/Data/DataTypeUtils.h>
+
+namespace ScriptCanvas
+{
+    namespace Data
+    {
+        void Type::Reflect(AZ::ReflectContext* reflection)
+        {
+            if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection))
+            {
+                serializeContext->Class<Type>()
+                    ->Version(2)
+                    ->Field("m_type", &Type::m_type)
+                    ->Field("m_azType", &Type::m_azType);
+            }
+        }
+
+        Type::Type()
+            : m_type(eType::Invalid)
+            , m_azType(AZ::Uuid::CreateNull())
+        {
+        }
+
+        Type::Type(eType type)
+            : m_type(type)
+            , m_azType(AZ::Uuid::CreateNull())
+        {
+        }
+
+        Type::Type(const AZ::Uuid& aztype)
+            : m_type(eType::BehaviorContextObject)
+            , m_azType(aztype)
+        {
+            AZ_Error("ScriptCanvas", !aztype.IsNull(), "no invalid aztypes allowed");
+        }
+
+        Type Type::AABB()
+        {
+            return Type(eType::AABB);
+        }
+
+        Type Type::AssetId()
+        {
+            return Type(eType::AssetId);
+        }
+
+        Type Type::BehaviorContextObject(const AZ::Uuid& aztype)
+        {
+            return Type(aztype);
+        }
+
+        Type Type::Boolean()
+        {
+            return Type(eType::Boolean);
+        }
+
+        Type Type::Color()
+        {
+            return Type(eType::Color);
+        }
+
+        Type Type::CRC()
+        {
+            return Type(eType::CRC);
+        }
+
+        Type Type::EntityID()
+        {
+            return Type(eType::EntityID);
+        }
+
+        Type Type::NamedEntityID()
+        {
+            return Type(eType::NamedEntityID);
+        }
+
+        Type Type::Invalid()
+        {
+            return Type();
+        }
+
+        Type Type::Matrix3x3()
+        {
+            return Type(eType::Matrix3x3);
+        }
+
+        Type Type::Matrix4x4()
+        {
+            return Type(eType::Matrix4x4);
+        }
+
+        Type Type::Number()
+        {
+            return Type(eType::Number);
+        }
+
+        Type Type::OBB()
+        {
+            return Type(eType::OBB);
+        }
+
+        Type Type::Plane()
+        {
+            return Type(eType::Plane);
+        }
+
+        Type Type::Quaternion()
+        {
+            return Type(eType::Quaternion);
+        }
+
+        Type Type::String()
+        {
+            return Type(eType::String);
+        }
+
+        Type Type::Transform()
+        {
+            return Type(eType::Transform);
+        }
+
+        Type Type::Vector3()
+        {
+            return Type(eType::Vector3);
+        }
+
+        Type Type::Vector2()
+        {
+            return Type(eType::Vector2);
+        }
+
+        Type Type::Vector4()
+        {
+            return Type(eType::Vector4);
+        }
+
+        AZ::Uuid Type::GetAZType() const
+        {
+            if (m_type == eType::BehaviorContextObject)
+            {
+                return m_azType;
+            }
+            else
+            {
+                return ScriptCanvas::Data::ToAZType((*this));
+            }
+        }
+
+        eType Type::GetType() const
+        {
+            return m_type;
+        }
+
+        bool Type::IsValid() const
+        {
+            return m_type != eType::Invalid;
+        }
+
+        bool Type::IsConvertibleFrom(const AZ::Uuid& target) const
+        {
+            return FromAZType(target).IsConvertibleTo(*this);
+        }
+
+        bool Type::IsConvertibleFrom(const Type& target) const
+        {
+            return target.IsConvertibleTo(*this);
+        }
+
+        bool Type::IsConvertibleTo(const AZ::Uuid& target) const
+        {
+            return IsConvertibleTo(FromAZType(target));
+        }
+
+        bool Type::IsConvertibleTo(const Type& target) const
+        {
+            auto isVector2Vector = [&]() -> bool
+            {
+                return IsVectorType(target) || (target.GetType() == eType::BehaviorContextObject && IsVectorType(target.GetAZType()));
+            };
+
+            AZ_Assert(
+                !IS_A(target),
+                "Don't mix concepts, it is too dangerous. "
+                "Check IS-A separately from conversion at all times. "
+                "Use IS_A || IsConvertibleTo in an expression");
+
+            const auto targetEType = target.GetType();
+            if (targetEType == eType::String)
+            {
+                // everything is implicitly convertible to strings, including strings
+                return true;
+            }
+
+            switch (GetType())
+            {
+            case eType::Boolean:
+                return targetEType == eType::Number;
+
+            case eType::Color:
+                return targetEType == eType::Vector3 || targetEType == eType::Vector4;
+
+            case eType::Matrix3x3:
+                return targetEType == eType::Quaternion;
+
+            case eType::Matrix4x4:
+                return targetEType == eType::Transform || targetEType == eType::Quaternion;
+
+            case eType::Number:
+                return targetEType == eType::Boolean;
+
+            case eType::Transform:
+                return targetEType == eType::Matrix4x4;
+
+            case eType::Quaternion:
+                return targetEType == eType::Matrix3x3 || targetEType == eType::Matrix4x4 || targetEType == eType::Transform;
+
+            case eType::Vector2:
+                return isVector2Vector();
+            case eType::Vector3:
+            case eType::Vector4:
+                return isVector2Vector() || targetEType == eType::Color;
+            default:
+                return false;
+            }
+        }
+
+        bool Type::IS_A(const Type& other) const
+        {
+            return m_type == other.m_type &&
+                (m_type != eType::BehaviorContextObject || m_azType == other.m_azType || IsAZRttiTypeOf(m_azType, other.m_azType));
+        }
+
+        bool Type::IS_EXACTLY_A(const Type& other) const
+        {
+            return m_type == other.m_type && m_azType == other.m_azType;
+        }
+
+        Type::operator bool() const
+        {
+            return m_type != eType::Invalid;
+        }
+
+        bool Type::operator!() const
+        {
+            return m_type == eType::Invalid;
+        }
+
+        bool Type::operator==(const Type& other) const
+        {
+            return IS_EXACTLY_A(other);
+        }
+
+        bool Type::operator!=(const Type& other) const
+        {
+            return !((*this) == other);
+        }
+    } // namespace Data
+} // namespace ScriptCanvas

+ 140 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataType.h

@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <AzCore/Asset/AssetCommon.h>
+#include <AzCore/Component/EntityId.h>
+#include <AzCore/Component/NamedEntityId.h>
+#include <AzCore/Math/Aabb.h>
+#include <AzCore/Math/Color.h>
+#include <AzCore/Math/Crc.h>
+#include <AzCore/Math/Matrix3x3.h>
+#include <AzCore/Math/Matrix4x4.h>
+#include <AzCore/Math/Obb.h>
+#include <AzCore/Math/Plane.h>
+#include <AzCore/Math/Quaternion.h>
+#include <AzCore/Math/Transform.h>
+#include <AzCore/Math/Uuid.h>
+#include <AzCore/Math/Vector2.h>
+#include <AzCore/Math/Vector3.h>
+#include <AzCore/Math/Vector4.h>
+#include <AzCore/RTTI/TypeInfo.h>
+#include <AzCore/std/string/string.h>
+
+namespace ScriptCanvas
+{
+    namespace Data
+    {
+        // Note: Changing the order of number of values in this list almost certainly invalidates previous data
+        enum class eType : AZ::u32
+        {
+            Boolean,
+            EntityID,
+            Invalid,
+            Number,
+            BehaviorContextObject,
+            String,
+            Quaternion,
+            Transform,
+            Vector3,
+            Vector2,
+            Vector4,
+            AABB,
+            Color,
+            CRC,
+            Matrix3x3,
+            Matrix4x4,
+            OBB,
+            Plane,
+            NamedEntityID,
+            // Function,
+            // List,
+            AssetId,
+        };
+
+        using AABBType = AZ::Aabb;
+        using AssetIdType = AZ::Data::AssetId;
+        using BooleanType = bool;
+        using CRCType = AZ::Crc32;
+        using ColorType = AZ::Color;
+        using EntityIDType = AZ::EntityId;
+        using NamedEntityIDType = AZ::NamedEntityId;
+        using Matrix3x3Type = AZ::Matrix3x3;
+        using Matrix4x4Type = AZ::Matrix4x4;
+        using NumberType = double;
+        using OBBType = AZ::Obb;
+        using PlaneType = AZ::Plane;
+        using QuaternionType = AZ::Quaternion;
+        using StringType = AZStd::string;
+        using TransformType = AZ::Transform;
+        using Vector2Type = AZ::Vector2;
+        using Vector3Type = AZ::Vector3;
+        using Vector4Type = AZ::Vector4;
+
+        class Type final
+        {
+        public:
+            AZ_TYPE_INFO(Type, "{0EADF8F5-8AB8-42E9-9C50-F5C78255C817}");
+
+            static void Reflect(AZ::ReflectContext* reflection);
+
+            static Type AABB();
+            static Type AssetId();
+            static Type BehaviorContextObject(const AZ::Uuid& aztype);
+            static Type Boolean();
+            static Type Color();
+            static Type CRC();
+            static Type EntityID();
+            static Type NamedEntityID();
+            static Type Invalid();
+            static Type Matrix3x3();
+            static Type Matrix4x4();
+            static Type Number();
+            static Type OBB();
+            static Type Plane();
+            static Type Quaternion();
+            static Type String();
+            static Type Transform();
+            static Type Vector2();
+            static Type Vector3();
+            static Type Vector4();
+
+            // the default ctr produces the invalid type, and is only here to help the compiler
+            Type();
+
+            AZ::Uuid GetAZType() const;
+            eType GetType() const;
+            bool IsValid() const;
+
+            // returns true if this type is, or is derived from the other type
+            bool IS_A(const Type& other) const;
+            bool IS_EXACTLY_A(const Type& other) const;
+
+            bool IsConvertibleFrom(const AZ::Uuid& target) const;
+            bool IsConvertibleFrom(const Type& target) const;
+
+            bool IsConvertibleTo(const AZ::Uuid& target) const;
+            bool IsConvertibleTo(const Type& target) const;
+
+            explicit operator bool() const;
+            bool operator!() const;
+            bool operator==(const Type& other) const;
+            bool operator!=(const Type& other) const;
+            Type& operator=(const Type& source) = default;
+
+        private:
+            eType m_type;
+            AZ::Uuid m_azType;
+
+            explicit Type(eType type);
+            // for BehaviorContextObjects specifically
+            explicit Type(const AZ::Uuid& aztype);
+        };
+    } // namespace Data
+} // namespace ScriptCanvas

+ 494 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTypeUtils.cpp

@@ -0,0 +1,494 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#include "DataTypeUtils.h"
+
+#include <AzCore/RTTI/BehaviorContext.h>
+#include <AzCore/Serialization/Utils.h>
+#include <ScriptCanvas/Data/DataType.h>
+
+namespace ScriptCanvas
+{
+    namespace Data
+    {
+        Type FromAZType(const AZ::Uuid& type)
+        {
+            AZStd::pair<bool, Type> help = FromAZTypeHelper(type);
+            return help.first ? help.second : Type::BehaviorContextObject(type);
+        }
+
+        Type FromAZTypeChecked(const AZ::Uuid& type)
+        {
+            AZStd::pair<bool, Type> help = FromAZTypeHelper(type);
+            return help.first ?
+                help.second : IsSupportedBehaviorContextObject(type) ?
+                    Type::BehaviorContextObject(type) : Type::Invalid();
+        }
+
+        AZStd::pair<bool, Type> FromAZTypeHelper(const AZ::Uuid& type)
+        {
+            if (type.IsNull())
+            {
+                return { true, Type::Invalid() };
+            }
+            else if (IsAABB(type))
+            {
+                return { true, Type::AABB() };
+            }
+            else if (IsAssetId(type))
+            {
+                return { true, Type::AssetId() };
+            }
+            else if (IsBoolean(type))
+            {
+                return { true, Type::Boolean() };
+            }
+            else if (IsColor(type))
+            {
+                return { true, Type::Color() };
+            }
+            else if (IsCRC(type))
+            {
+                return { true, Type::CRC() };
+            }
+            else if (IsEntityID(type))
+            {
+                return { true, Type::EntityID() };
+            }
+            else if (IsNamedEntityID(type))
+            {
+                return { true, Type::NamedEntityID() };
+            }
+            else if (IsMatrix3x3(type))
+            {
+                return { true, Type::Matrix3x3() };
+            }
+            else if (IsMatrix4x4(type))
+            {
+                return { true, Type::Matrix4x4() };
+            }
+            else if (IsNumber(type))
+            {
+                return { true, Type::Number() };
+            }
+            else if (IsOBB(type))
+            {
+                return { true, Type::OBB() };
+            }
+            else if (IsPlane(type))
+            {
+                return { true, Type::Plane() };
+            }
+            else if (IsQuaternion(type))
+            {
+                return { true, Type::Quaternion() };
+            }
+            else if (IsString(type))
+            {
+                return { true, Type::String() };
+            }
+            else if (IsTransform(type))
+            {
+                return { true, Type::Transform() };
+            }
+            else if (IsVector2(type))
+            {
+                return { true, Type::Vector2() };
+            }
+            else if (IsVector3(type))
+            {
+                return { true, Type::Vector3() };
+            }
+            else if (IsVector4(type))
+            {
+                return { true, Type::Vector4() };
+            }
+            else
+            {
+                return { false, Type::Invalid() };
+            }
+        }
+
+        AZ::Uuid ToAZType(eType type)
+        {
+            switch (type)
+            {
+            case eType::AABB:
+                return azrtti_typeid<AABBType>();
+
+            case eType::AssetId:
+                return azrtti_typeid<AssetIdType>();
+
+            case eType::Boolean:
+                return azrtti_typeid<bool>();
+
+            case eType::Color:
+                return azrtti_typeid<ColorType>();
+
+            case eType::CRC:
+                return azrtti_typeid<CRCType>();
+
+            case eType::EntityID:
+                return azrtti_typeid<AZ::EntityId>();
+
+            case eType::NamedEntityID:
+                return azrtti_typeid<AZ::NamedEntityId>();
+
+            case eType::Invalid:
+                return AZ::Uuid::CreateNull();
+
+            case eType::Matrix3x3:
+                return azrtti_typeid<AZ::Matrix3x3>();
+
+            case eType::Matrix4x4:
+                return azrtti_typeid<AZ::Matrix4x4>();
+
+            case eType::Number:
+                return azrtti_typeid<NumberType>();
+
+            case eType::OBB:
+                return azrtti_typeid<OBBType>();
+
+            case eType::Plane:
+                return azrtti_typeid<PlaneType>();
+
+            case eType::Quaternion:
+                return azrtti_typeid<QuaternionType>();
+
+            case eType::String:
+                return azrtti_typeid<StringType>();
+
+            case eType::Transform:
+                return azrtti_typeid<TransformType>();
+
+            case eType::Vector2:
+                return azrtti_typeid<AZ::Vector2>();
+
+            case eType::Vector3:
+                return azrtti_typeid<AZ::Vector3>();
+
+            case eType::Vector4:
+                return azrtti_typeid<AZ::Vector4>();
+
+            default:
+                AZ_Assert(false, "Invalid type!");
+                // check for behavior context support
+                return AZ::Uuid::CreateNull();
+            }
+        }
+
+        AZ::Uuid ToAZType(const Type& type)
+        {
+            eType typeEnum = type.GetType();
+            if (typeEnum == eType::BehaviorContextObject)
+            {
+                return type.GetAZType();
+            }
+
+            return ToAZType(typeEnum);
+        }
+
+        bool IsAZRttiTypeOf(const AZ::Uuid& candidate, const AZ::Uuid& reference)
+        {
+            auto bcClass = AZ::BehaviorContextHelper::GetClass(candidate);
+            return bcClass && bcClass->m_azRtti && bcClass->m_azRtti->IsTypeOf(reference);
+        }
+
+        bool IS_A(const Type& candidate, const Type& reference)
+        {
+            return candidate.IS_A(reference);
+        }
+
+        bool IS_EXACTLY_A(const Type& candidate, const Type& reference)
+        {
+            return candidate.IS_EXACTLY_A(reference);
+        }
+
+        bool IsConvertible(const Type& source, const AZ::Uuid& target)
+        {
+            return source.IsConvertibleTo(target);
+        }
+
+        bool IsConvertible(const Type& source, const Type& target)
+        {
+            return source.IsConvertibleTo(target);
+        }
+
+        bool IsAABB(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AABBType>();
+        }
+
+        bool IsAABB(const Type& type)
+        {
+            return type.GetType() == eType::AABB;
+        }
+
+        bool IsAssetId(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AssetIdType>();
+        }
+
+        bool IsAssetId(const Type& type)
+        {
+            return type.GetType() == eType::AssetId;
+        }
+
+        bool IsBoolean(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<bool>();
+        }
+
+        bool IsBoolean(const Type& type)
+        {
+            return type.GetType() == eType::Boolean;
+        }
+
+        bool IsColor(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<ColorType>();
+        }
+
+        bool IsColor(const Type& type)
+        {
+            return type.GetType() == eType::Color;
+        }
+
+        bool IsCRC(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<CRCType>();
+        }
+
+        bool IsCRC(const Type& type)
+        {
+            return type.GetType() == eType::CRC;
+        }
+
+        bool IsEntityID(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::EntityId>();
+        }
+
+        bool IsEntityID(const Type& type)
+        {
+            return type.GetType() == eType::EntityID;
+        }
+
+        bool IsNamedEntityID(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::NamedEntityId>();
+        }
+
+        bool IsNamedEntityID(const Type& type)
+        {
+            return type.GetType() == eType::NamedEntityID;
+        }
+
+        bool IsMatrix3x3(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::Matrix3x3>();
+        }
+
+        bool IsMatrix3x3(const Type& type)
+        {
+            return type.GetType() == eType::Matrix3x3;
+        }
+
+        bool IsMatrix4x4(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::Matrix4x4>();
+        }
+
+        bool IsMatrix4x4(const Type& type)
+        {
+            return type.GetType() == eType::Matrix4x4;
+        }
+
+        bool IsNumber(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::s8>() || type == azrtti_typeid<AZ::s16>() || type == azrtti_typeid<AZ::s32>() ||
+                type == azrtti_typeid<AZ::s64>() || type == azrtti_typeid<AZ::u8>() || type == azrtti_typeid<AZ::u16>() ||
+                type == azrtti_typeid<AZ::u32>() || type == azrtti_typeid<AZ::u64>() || type == azrtti_typeid<unsigned long>() ||
+                type == azrtti_typeid<float>() || type == azrtti_typeid<double>();
+        }
+
+        bool IsNumber(const Type& type)
+        {
+            return type.GetType() == eType::Number;
+        }
+
+        bool IsOBB(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<OBBType>();
+        }
+
+        bool IsOBB(const Type& type)
+        {
+            return type.GetType() == eType::OBB;
+        }
+
+        bool IsPlane(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<PlaneType>();
+        }
+
+        bool IsPlane(const Type& type)
+        {
+            return type.GetType() == eType::Plane;
+        }
+
+        bool IsQuaternion(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<QuaternionType>();
+        }
+
+        bool IsQuaternion(const Type& type)
+        {
+            return type.GetType() == eType::Quaternion;
+        }
+
+        bool IsString(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<StringType>();
+        }
+
+        bool IsString(const Type& type)
+        {
+            return type.GetType() == eType::String;
+        }
+
+        bool IsTransform(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<TransformType>();
+        }
+
+        bool IsTransform(const Type& type)
+        {
+            return type.GetType() == eType::Transform;
+        }
+
+        bool IsVector2(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::Vector2>();
+        }
+
+        bool IsVector2(const Type& type)
+        {
+            return type.GetType() == eType::Vector2;
+        }
+
+        bool IsVector3(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::Vector3>();
+        }
+
+        bool IsVector3(const Type& type)
+        {
+            return type.GetType() == eType::Vector3;
+        }
+
+        bool IsVector4(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::Vector4>();
+        }
+
+        bool IsVector4(const Type& type)
+        {
+            return type.GetType() == eType::Vector4;
+        }
+
+        bool IsVectorType(const AZ::Uuid& type)
+        {
+            return type == azrtti_typeid<AZ::Vector3>() || type == azrtti_typeid<AZ::Vector2>() || type == azrtti_typeid<AZ::Vector4>();
+        }
+
+        bool IsVectorType(const Type& type)
+        {
+            static const AZ::u32 s_vectorTypes = {
+                1 << static_cast<AZ::u32>(eType::Vector3) |
+                1 << static_cast<AZ::u32>(eType::Vector2) |
+                1 << static_cast<AZ::u32>(eType::Vector4)
+            };
+
+            return ((1 << static_cast<AZ::u32>(type.GetType())) & s_vectorTypes) != 0;
+        }
+
+        bool IsAutoBoxedType(const Type& type)
+        {
+            static const AZ::u32 s_autoBoxedTypes = {
+                1 << static_cast<AZ::u32>(eType::AABB) | 1 << static_cast<AZ::u32>(eType::Color) |
+                1 << static_cast<AZ::u32>(eType::CRC) | 1 << static_cast<AZ::u32>(eType::Matrix3x3) |
+                1 << static_cast<AZ::u32>(eType::Matrix4x4) | 1 << static_cast<AZ::u32>(eType::OBB) |
+                1 << static_cast<AZ::u32>(eType::Quaternion) | 1 << static_cast<AZ::u32>(eType::Transform) |
+                1 << static_cast<AZ::u32>(eType::Vector2) | 1 << static_cast<AZ::u32>(eType::Vector3) | 1 << static_cast<AZ::u32>(eType::Vector4)
+            };
+
+            return ((1 << static_cast<AZ::u32>(type.GetType())) & s_autoBoxedTypes) != 0;
+        }
+
+        bool IsValueType(const Type& type)
+        {
+            return type.GetType() != eType::BehaviorContextObject;
+        }
+
+        bool IsContainerType(const AZ::Uuid& type)
+        {
+            return AZ::Utils::IsContainerType(type);
+        }
+
+        bool IsContainerType(const Type& type)
+        {
+            return AZ::Utils::IsContainerType(ToAZType(type));
+        }
+
+        bool IsMapContainerType(const AZ::Uuid& type)
+        {
+            return AZ::Utils::IsMapContainerType(type);
+        }
+
+        bool IsMapContainerType(const Type& type)
+        {
+            return AZ::Utils::IsMapContainerType(ToAZType(type));
+        }
+
+        bool IsOutcomeType(const AZ::Uuid& type)
+        {
+            return AZ::Utils::IsOutcomeType(type);
+        }
+
+        bool IsOutcomeType(const Type& type)
+        {
+            return AZ::Utils::IsOutcomeType(ToAZType(type));
+        }
+
+        bool IsVectorContainerType(const AZ::Uuid& type)
+        {
+            return AZ::Utils::IsVectorContainerType(type);
+        }
+
+        bool IsVectorContainerType(const Type& type)
+        {
+            return AZ::Utils::IsVectorContainerType(ToAZType(type));
+        }
+
+        bool IsSetContainerType(const AZ::Uuid& type)
+        {
+            return AZ::Utils::IsSetContainerType(type);
+        }
+
+        bool IsSetContainerType(const Type& type)
+        {
+            return AZ::Utils::IsSetContainerType(ToAZType(type));
+        }
+
+        bool IsSupportedBehaviorContextObject(const AZ::Uuid& type)
+        {
+            return AZ::BehaviorContextHelper::GetClass(type) != nullptr;
+        }
+    } // namespace Data
+} // namespace ScriptCanvas

+ 90 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Data/DataTypeUtils.h

@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <AzCore/Math/Uuid.h>
+#include <AzCore/std/utils.h>
+
+namespace ScriptCanvas
+{
+    namespace Data
+    {
+        class Type;
+        enum class eType : AZ::u32;
+
+        Type FromAZType(const AZ::Uuid& aztype);
+        Type FromAZTypeChecked(const AZ::Uuid& aztype);
+        AZStd::pair<bool, Type> FromAZTypeHelper(const AZ::Uuid& type);
+
+        AZ::Uuid ToAZType(eType type);
+        AZ::Uuid ToAZType(const Type& type);
+
+        bool IsAZRttiTypeOf(const AZ::Uuid& candidate, const AZ::Uuid& reference);
+        bool IS_A(const Type& candidate, const Type& reference);
+        bool IS_EXACTLY_A(const Type& candidate, const Type& reference);
+        bool IsConvertible(const Type& source, const AZ::Uuid& target);
+        bool IsConvertible(const Type& source, const Type& target);
+
+        bool IsAABB(const AZ::Uuid& type);
+        bool IsAABB(const Type& type);
+        bool IsAssetId(const AZ::Uuid& type);
+        bool IsAssetId(const Type& type);
+        bool IsBoolean(const AZ::Uuid& type);
+        bool IsBoolean(const Type& type);
+        bool IsColor(const AZ::Uuid& type);
+        bool IsColor(const Type& type);
+        bool IsCRC(const AZ::Uuid& type);
+        bool IsCRC(const Type& type);
+        bool IsEntityID(const AZ::Uuid& type);
+        bool IsEntityID(const Type& type);
+        bool IsNamedEntityID(const AZ::Uuid& type);
+        bool IsNamedEntityID(const Type& type);
+        bool IsNumber(const AZ::Uuid& type);
+        bool IsNumber(const Type& type);
+        bool IsMatrix3x3(const AZ::Uuid& type);
+        bool IsMatrix3x3(const Type& type);
+        bool IsMatrix4x4(const AZ::Uuid& type);
+        bool IsMatrix4x4(const Type& type);
+        bool IsOBB(const AZ::Uuid& type);
+        bool IsOBB(const Type& type);
+        bool IsPlane(const AZ::Uuid& type);
+        bool IsPlane(const Type& type);
+        bool IsQuaternion(const AZ::Uuid& type);
+        bool IsQuaternion(const Type& type);
+        bool IsString(const AZ::Uuid& type);
+        bool IsString(const Type& type);
+        bool IsTransform(const AZ::Uuid& type);
+        bool IsTransform(const Type& type);
+        bool IsVector2(const AZ::Uuid& type);
+        bool IsVector2(const Type& type);
+        bool IsVector3(const AZ::Uuid& type);
+        bool IsVector3(const Type& type);
+        bool IsVector4(const AZ::Uuid& type);
+        bool IsVector4(const Type& type);
+
+        bool IsVectorType(const AZ::Uuid& type);
+        bool IsVectorType(const Type& type);
+
+        bool IsAutoBoxedType(const Type& type);
+        bool IsValueType(const Type& type);
+
+        bool IsContainerType(const AZ::Uuid& type);
+        bool IsContainerType(const Type& type);
+        bool IsMapContainerType(const AZ::Uuid& type);
+        bool IsMapContainerType(const Type& type);
+        bool IsOutcomeType(const AZ::Uuid& type);
+        bool IsOutcomeType(const Type& type);
+        bool IsSetContainerType(const AZ::Uuid& type);
+        bool IsSetContainerType(const Type& type);
+        bool IsVectorContainerType(const AZ::Uuid& type);
+        bool IsVectorContainerType(const Type& type);
+
+        bool IsSupportedBehaviorContextObject(const AZ::Uuid& type);
+    } // namespace Data
+} // namespace ScriptCanvas

+ 4 - 6
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ContainerTypeReflection.h

@@ -5,15 +5,13 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#include <ScriptCanvas/Libraries/Libraries.h>
-#include <Data/DataMacros.h>
-#include <Data/DataTrait.h>
-#include <ScriptCanvas/Core/Attributes.h>
-
-#include <AzFramework/Entity/EntityContextBus.h>
 
 #pragma once
 
+#include <AzCore/Script/ScriptContextAttributes.h>
+#include <ScriptCanvas/Data/DataMacros.h>
+#include <ScriptCanvas/Data/DataTraitBase.h>
+
 namespace ContainerTypeReflection
 {
     template<typename t_Type>

+ 1 - 0
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h

@@ -9,6 +9,7 @@
 #pragma once
 
 #include <AzCore/Outcome/Outcome.h>
+#include <AzCore/RTTI/BehaviorContext.h>
 #include <ScriptCanvas/Data/Data.h>
 
 namespace AZ

+ 9 - 9
Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake

@@ -40,13 +40,6 @@ set(FILES
     Include/ScriptCanvas/Core/SlotMetadata.cpp
     Include/ScriptCanvas/Core/SubgraphInterface.cpp
     Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp
-    Include/ScriptCanvas/Translation/GraphToLua.cpp
-    Include/ScriptCanvas/Translation/GraphToLuaUtility.cpp
-    Include/ScriptCanvas/Translation/GraphToX.cpp
-    Include/ScriptCanvas/Translation/Translation.cpp
-    Include/ScriptCanvas/Translation/TranslationContext.cpp
-    Include/ScriptCanvas/Translation/TranslationResult.cpp
-    Include/ScriptCanvas/Translation/TranslationUtilities.cpp
     Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp
     Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp
     Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp
@@ -61,6 +54,8 @@ set(FILES
     Include/ScriptCanvas/Data/BehaviorContextObjectPtr.cpp
     Include/ScriptCanvas/Data/Data.cpp
     Include/ScriptCanvas/Data/DataRegistry.cpp
+    Include/ScriptCanvas/Data/DataTrait.cpp
+    Include/ScriptCanvas/Data/PropertyTraits.cpp
     Include/ScriptCanvas/Deprecated/VariableDatumBase.cpp
     Include/ScriptCanvas/Deprecated/VariableDatum.cpp
     Include/ScriptCanvas/Deprecated/VariableHelpers.cpp
@@ -204,8 +199,13 @@ set(FILES
     Include/ScriptCanvas/Serialization/BehaviorContextObjectSerializer.cpp
     Include/ScriptCanvas/Serialization/DatumSerializer.cpp
     Include/ScriptCanvas/Serialization/RuntimeVariableSerializer.cpp
-    Include/ScriptCanvas/Data/DataTrait.cpp
-    Include/ScriptCanvas/Data/PropertyTraits.cpp
+    Include/ScriptCanvas/Translation/GraphToLua.cpp
+    Include/ScriptCanvas/Translation/GraphToLuaUtility.cpp
+    Include/ScriptCanvas/Translation/GraphToX.cpp
+    Include/ScriptCanvas/Translation/Translation.cpp
+    Include/ScriptCanvas/Translation/TranslationContext.cpp
+    Include/ScriptCanvas/Translation/TranslationResult.cpp
+    Include/ScriptCanvas/Translation/TranslationUtilities.cpp
     Include/ScriptCanvas/Variable/GraphVariable.cpp
     Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp
     Include/ScriptCanvas/Variable/VariableCore.cpp

+ 7 - 0
Gems/ScriptCanvas/Code/scriptcanvasgem_extensions_files.cmake

@@ -10,6 +10,13 @@ set(FILES
     Include/ScriptCanvas/AutoGen/ScriptCanvasFunction.xsd
     Include/ScriptCanvas/AutoGen/ScriptCanvasAutoGenRegistry.cpp
     Include/ScriptCanvas/AutoGen/ScriptCanvasAutoGenRegistry.h
+    Include/ScriptCanvas/Data/DataMacros.h
+    Include/ScriptCanvas/Data/DataTraitBase.h
+    Include/ScriptCanvas/Data/DataType.cpp
+    Include/ScriptCanvas/Data/DataType.h
+    Include/ScriptCanvas/Data/DataTypeUtils.cpp
+    Include/ScriptCanvas/Data/DataTypeUtils.h
+    Include/ScriptCanvas/Libraries/Core/ContainerTypeReflection.h
     Include/ScriptCanvas/Libraries/ScriptCanvasNodeRegistry.cpp
     Include/ScriptCanvas/Libraries/ScriptCanvasNodeRegistry.h
 )

+ 15 - 21
Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake

@@ -57,17 +57,6 @@ set(FILES
     Include/ScriptCanvas/Core/SlotNames.h
     Include/ScriptCanvas/Core/SubgraphInterface.h
     Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h
-    Include/ScriptCanvas/Translation/Configuration.h
-    Include/ScriptCanvas/Translation/GraphToLua.h
-    Include/ScriptCanvas/Translation/GraphToLuaUtility.h
-    Include/ScriptCanvas/Translation/GraphToX.h
-    Include/ScriptCanvas/Translation/Translation.h
-    Include/ScriptCanvas/Translation/TranslationContext.h
-    Include/ScriptCanvas/Translation/TranslationResult.h
-    Include/ScriptCanvas/Translation/TranslationUtilities.h
-    Include/ScriptCanvas/PerformanceStatistician.h
-    Include/ScriptCanvas/PerformanceStatisticsBus.h
-    Include/ScriptCanvas/PerformanceTracker.h
     Include/ScriptCanvas/CodeGen/NodeableCodegen.h
     Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.h
     Include/ScriptCanvas/Core/Contracts/ContractRTTI.h
@@ -81,10 +70,13 @@ set(FILES
     Include/ScriptCanvas/Core/Contracts/TypeContract.h
     Include/ScriptCanvas/Data/BehaviorContextObject.h
     Include/ScriptCanvas/Data/BehaviorContextObjectPtr.h
+    Include/ScriptCanvas/Data/Constants.h
     Include/ScriptCanvas/Data/Data.h
-    Include/ScriptCanvas/Data/DataMacros.h
     Include/ScriptCanvas/Data/DataRegistry.h
+    Include/ScriptCanvas/Data/DataTrait.h
     Include/ScriptCanvas/Data/NumericData.h
+    Include/ScriptCanvas/Data/PropertyTraits.h
+    Include/ScriptCanvas/Data/Traits.h
     Include/ScriptCanvas/Deprecated/VariableDatumBase.h
     Include/ScriptCanvas/Deprecated/VariableDatum.h
     Include/ScriptCanvas/Deprecated/VariableHelpers.h
@@ -123,10 +115,6 @@ set(FILES
     Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h
     Include/ScriptCanvas/Grammar/PrimitivesExecution.h
     Include/ScriptCanvas/Grammar/SymbolNames.h
-    Include/ScriptCanvas/Execution/ErrorBus.h
-    Include/ScriptCanvas/Execution/ExecutionContext.h
-    Include/ScriptCanvas/Execution/ExecutionBus.h
-    Include/ScriptCanvas/Execution/RuntimeComponent.h
     Include/ScriptCanvas/Internal/Nodeables/BaseTimer.h
     Include/ScriptCanvas/Internal/Nodeables/BaseTimer.ScriptCanvasNodeable.xml
     Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.h
@@ -135,13 +123,11 @@ set(FILES
     Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.ScriptCanvasGrammar.xml
     Include/ScriptCanvas/Internal/Nodes/StringFormatted.h
     Include/ScriptCanvas/Internal/Nodes/StringFormatted.ScriptCanvasGrammar.xml
-    Include/ScriptCanvas/Grammar/AbstractCodeModel.h
     Include/ScriptCanvas/Libraries/Libraries.h
     Include/ScriptCanvas/Libraries/Core/AzEventHandler.h
     Include/ScriptCanvas/Libraries/Core/AzEventHandler.ScriptCanvasGrammar.xml
     Include/ScriptCanvas/Libraries/Core/BinaryOperator.h
     Include/ScriptCanvas/Libraries/Core/CoreLibrary.h
-    Include/ScriptCanvas/Libraries/Core/ContainerTypeReflection.h
     Include/ScriptCanvas/Libraries/Core/EBusEventHandler.h
     Include/ScriptCanvas/Libraries/Core/EBusEventHandler.ScriptCanvasGrammar.xml
     Include/ScriptCanvas/Libraries/Core/ExtractProperty.h
@@ -373,13 +359,21 @@ set(FILES
     Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.ScriptCanvasGrammar.xml
     Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeable.h
     Include/ScriptCanvas/Libraries/Operators/Math/OperatorLerpNodeableNode.h
+    Include/ScriptCanvas/PerformanceStatistician.h
+    Include/ScriptCanvas/PerformanceStatisticsBus.h
+    Include/ScriptCanvas/PerformanceTracker.h
     Include/ScriptCanvas/Results/ErrorText.h
     Include/ScriptCanvas/Serialization/BehaviorContextObjectSerializer.h
     Include/ScriptCanvas/Serialization/DatumSerializer.h
     Include/ScriptCanvas/Serialization/RuntimeVariableSerializer.h
-    Include/ScriptCanvas/Data/DataTrait.h
-    Include/ScriptCanvas/Data/PropertyTraits.h
-    Include/ScriptCanvas/Data/Traits.h
+    Include/ScriptCanvas/Translation/Configuration.h
+    Include/ScriptCanvas/Translation/GraphToLua.h
+    Include/ScriptCanvas/Translation/GraphToLuaUtility.h
+    Include/ScriptCanvas/Translation/GraphToX.h
+    Include/ScriptCanvas/Translation/Translation.h
+    Include/ScriptCanvas/Translation/TranslationContext.h
+    Include/ScriptCanvas/Translation/TranslationResult.h
+    Include/ScriptCanvas/Translation/TranslationUtilities.h
     Include/ScriptCanvas/Variable/VariableBus.h
     Include/ScriptCanvas/Variable/GraphVariable.h
     Include/ScriptCanvas/Variable/GraphVariableManagerComponent.h

+ 1 - 0
Gems/ScriptCanvasDeveloper/Code/Editor/Source/NodeListDumpAction.cpp

@@ -9,6 +9,7 @@
 
 #include <AzCore/Component/ComponentApplicationBus.h>
 #include <AzCore/RTTI/BehaviorContext.h>
+#include <AzCore/Serialization/EditContext.h>
 #include <AzCore/Serialization/SerializeContext.h>
 #include <AzCore/std/string/string_view.h>