merge latest
Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -8,16 +8,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/smart_ptr/enable_shared_from_this.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h>
|
||||
#include <Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h>
|
||||
|
||||
#include <ScriptCanvas/Asset/AssetDescription.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
class ScriptCanvasAssetBase
|
||||
: public AZ::Data::AssetData
|
||||
, public AZStd::enable_shared_from_this<ScriptCanvasAssetBase>
|
||||
, ScriptCanvas::ScriptCanvasAssetBusRequestBus::Handler
|
||||
{
|
||||
|
||||
|
||||
@@ -6,15 +6,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/RTTI/AttributeReader.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h>
|
||||
|
||||
#include "Core.h"
|
||||
#include "Attributes.h"
|
||||
#include "Core.h"
|
||||
#include <Core/Graph.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
@@ -182,5 +185,156 @@ namespace ScriptCanvas
|
||||
|
||||
serializeContext->RegisterType(typeId, AZStd::move(classData), EventPlaceholderAnyCreator);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace ScriptCanvasEditor
|
||||
{
|
||||
SourceHandle::SourceHandle()
|
||||
: m_id(AZ::Uuid::CreateNull())
|
||||
{}
|
||||
|
||||
SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path)
|
||||
: m_data(data.m_data)
|
||||
, m_id(id)
|
||||
, m_path(path)
|
||||
{
|
||||
m_path.MakePreferred();
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path)
|
||||
: m_data(graph)
|
||||
, m_id(id)
|
||||
, m_path(path)
|
||||
{
|
||||
m_path.MakePreferred();
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
SourceHandle::SourceHandle(const SourceHandle& data, const AZ::IO::Path& path)
|
||||
: m_data(data.m_data)
|
||||
, m_id(AZ::Uuid::CreateNull())
|
||||
, m_path(path)
|
||||
{
|
||||
m_path.MakePreferred();
|
||||
}
|
||||
|
||||
SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::IO::Path& path)
|
||||
: m_data(graph)
|
||||
, m_id(AZ::Uuid::CreateNull())
|
||||
, m_path(path)
|
||||
{
|
||||
m_path.MakePreferred();
|
||||
}
|
||||
|
||||
bool SourceHandle::AnyEquals(const SourceHandle& other) const
|
||||
{
|
||||
return m_data && m_data == other.m_data
|
||||
|| !m_id.IsNull() && m_id == other.m_id
|
||||
|| !m_path.empty() && m_path == other.m_path;
|
||||
}
|
||||
|
||||
void SourceHandle::Clear()
|
||||
{
|
||||
m_data = nullptr;
|
||||
m_id = AZ::Uuid::CreateNull();
|
||||
m_path.clear();
|
||||
}
|
||||
|
||||
// return a SourceHandle with only the Id and Path, but without a pointer to the data
|
||||
SourceHandle SourceHandle::Describe() const
|
||||
{
|
||||
return SourceHandle(nullptr, m_id, m_path);
|
||||
}
|
||||
|
||||
GraphPtrConst SourceHandle::Get() const
|
||||
{
|
||||
return m_data ? m_data->GetEditorGraph() : nullptr;
|
||||
}
|
||||
|
||||
const AZ::Uuid& SourceHandle::Id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
bool SourceHandle::IsDescriptionValid() const
|
||||
{
|
||||
return !m_id.IsNull() && !m_path.empty();
|
||||
}
|
||||
|
||||
bool SourceHandle::IsGraphValid() const
|
||||
{
|
||||
return m_data != nullptr;
|
||||
}
|
||||
|
||||
GraphPtr SourceHandle::Mod() const
|
||||
{
|
||||
return m_data ? m_data->ModEditorGraph() : nullptr;
|
||||
}
|
||||
|
||||
bool SourceHandle::operator==(const SourceHandle& other) const
|
||||
{
|
||||
return m_data.get() == other.m_data.get()
|
||||
&& m_id == other.m_id
|
||||
&& m_path == other.m_path;
|
||||
}
|
||||
|
||||
bool SourceHandle::operator!=(const SourceHandle& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
const AZ::IO::Path& SourceHandle::Path() const
|
||||
{
|
||||
return m_path;
|
||||
}
|
||||
|
||||
bool SourceHandle::PathEquals(const SourceHandle& other) const
|
||||
{
|
||||
return m_path == other.m_path;
|
||||
}
|
||||
|
||||
void SourceHandle::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<SourceHandle>()
|
||||
->Version(0)
|
||||
->Field("id", &SourceHandle::m_id)
|
||||
->Field("path", &SourceHandle::m_path)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string SourceHandle::ToString() const
|
||||
{
|
||||
return AZStd::string::format
|
||||
( "%s, %s, %s"
|
||||
, IsGraphValid() ? "O" : "X"
|
||||
, m_path.empty() ? m_path.c_str() : "<no name>"
|
||||
, m_id.IsNull() ? "<null id>" : m_id.ToString<AZStd::string>().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
const Graph* ScriptCanvasData::GetGraph() const
|
||||
{
|
||||
return AZ::EntityUtils::FindFirstDerivedComponent<ScriptCanvas::Graph>(m_scriptCanvasEntity.get());
|
||||
}
|
||||
|
||||
const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const
|
||||
{
|
||||
return reinterpret_cast<const ScriptCanvasEditor::Graph*>(GetGraph());
|
||||
}
|
||||
|
||||
Graph* ScriptCanvasData::ModGraph()
|
||||
{
|
||||
return AZ::EntityUtils::FindFirstDerivedComponent<ScriptCanvas::Graph>(m_scriptCanvasEntity.get());
|
||||
}
|
||||
|
||||
ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph()
|
||||
{
|
||||
return reinterpret_cast<ScriptCanvasEditor::Graph*>(ModGraph());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/EntityId.h>
|
||||
#include <AzCore/Component/EntityUtils.h>
|
||||
#include <AzCore/Component/NamedEntityId.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/Math/MathUtils.h>
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/std/any.h>
|
||||
#include <AzCore/std/hash.h>
|
||||
#include <AzCore/Component/EntityUtils.h>
|
||||
#include <AzCore/Component/NamedEntityId.h>
|
||||
|
||||
#include <Core/NamedId.h>
|
||||
#include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
|
||||
|
||||
@@ -61,6 +62,10 @@ namespace ScriptCanvas
|
||||
|
||||
class Node;
|
||||
class Edge;
|
||||
class Graph;
|
||||
|
||||
using GraphPtr = Graph*;
|
||||
using GraphPtrConst = const Graph*;
|
||||
|
||||
using ID = AZ::EntityId;
|
||||
|
||||
@@ -297,6 +302,105 @@ namespace ScriptCanvas
|
||||
void ReflectEventTypeOnDemand(const AZ::TypeId& typeId, AZStd::string_view name, AZ::IRttiHelper* rttiHelper = nullptr);
|
||||
}
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
class ScriptCanvasData;
|
||||
|
||||
using DataPtr = AZStd::intrusive_ptr<ScriptCanvasData>;
|
||||
using DataPtrConst = AZStd::intrusive_ptr<const ScriptCanvasData>;
|
||||
}
|
||||
|
||||
namespace ScriptCanvasEditor
|
||||
{
|
||||
class Graph;
|
||||
|
||||
using GraphPtr = Graph*;
|
||||
using GraphPtrConst = const Graph*;
|
||||
|
||||
class SourceHandle
|
||||
{
|
||||
public:
|
||||
AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}");
|
||||
AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
SourceHandle();
|
||||
|
||||
SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path);
|
||||
|
||||
SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path);
|
||||
|
||||
SourceHandle(const SourceHandle& data, const AZ::IO::Path& path);
|
||||
|
||||
SourceHandle(ScriptCanvas::DataPtr graph, const AZ::IO::Path& path);
|
||||
|
||||
bool AnyEquals(const SourceHandle& other) const;
|
||||
|
||||
void Clear();
|
||||
|
||||
// return a SourceHandle with only the Id and Path, but without a pointer to the data
|
||||
SourceHandle Describe() const;
|
||||
|
||||
GraphPtrConst Get() const;
|
||||
|
||||
const AZ::Uuid& Id() const;
|
||||
|
||||
bool IsDescriptionValid() const;
|
||||
|
||||
bool IsGraphValid() const;
|
||||
|
||||
GraphPtr Mod() const;
|
||||
|
||||
bool operator==(const SourceHandle& other) const;
|
||||
|
||||
bool operator!=(const SourceHandle& other) const;
|
||||
|
||||
const AZ::IO::Path& Path() const;
|
||||
|
||||
bool PathEquals(const SourceHandle& other) const;
|
||||
|
||||
AZStd::string ToString() const;
|
||||
|
||||
private:
|
||||
ScriptCanvas::DataPtr m_data;
|
||||
AZ::Uuid m_id = AZ::Uuid::CreateNull();
|
||||
AZ::IO::Path m_path;
|
||||
};
|
||||
}
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
class ScriptCanvasData
|
||||
: public AZStd::intrusive_refcount<AZStd::atomic_uint, AZStd::intrusive_default_delete>
|
||||
{
|
||||
public:
|
||||
|
||||
AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}");
|
||||
AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0);
|
||||
ScriptCanvasData() = default;
|
||||
virtual ~ScriptCanvasData() = default;
|
||||
ScriptCanvasData(ScriptCanvasData&& other);
|
||||
ScriptCanvasData& operator=(ScriptCanvasData&& other);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* reflectContext);
|
||||
|
||||
AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); }
|
||||
|
||||
const Graph* GetGraph() const;
|
||||
|
||||
const ScriptCanvasEditor::Graph* GetEditorGraph() const;
|
||||
|
||||
Graph* ModGraph();
|
||||
|
||||
ScriptCanvasEditor::Graph* ModEditorGraph();
|
||||
|
||||
AZStd::unique_ptr<AZ::Entity> m_scriptCanvasEntity;
|
||||
private:
|
||||
ScriptCanvasData(const ScriptCanvasData&) = delete;
|
||||
};
|
||||
}
|
||||
|
||||
namespace AZStd
|
||||
{
|
||||
template<>
|
||||
@@ -304,11 +408,28 @@ namespace AZStd
|
||||
{
|
||||
using argument_type = ScriptCanvas::SlotId;
|
||||
using result_type = AZStd::size_t;
|
||||
AZ_FORCE_INLINE size_t operator()(const argument_type& ref) const
|
||||
|
||||
inline size_t operator()(const argument_type& ref) const
|
||||
{
|
||||
return AZStd::hash<AZ::Uuid>()(ref.m_id);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct hash<ScriptCanvasEditor::SourceHandle>
|
||||
{
|
||||
using argument_type = ScriptCanvasEditor::SourceHandle;
|
||||
using result_type = AZStd::size_t;
|
||||
|
||||
inline size_t operator()(const argument_type& handle) const
|
||||
{
|
||||
size_t h = 0;
|
||||
hash_combine(h, handle.Id());
|
||||
hash_combine(h, handle.Path());
|
||||
hash_combine(h, handle.Get());
|
||||
return h;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#define SCRIPT_CANVAS_INFINITE_LOOP_DETECTION_COUNT (2000000)
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <ScriptCanvas/Libraries/Core/SendScriptEvent.h>
|
||||
#include <ScriptCanvas/Libraries/Core/Start.h>
|
||||
#include <ScriptCanvas/Libraries/Core/UnaryOperator.h>
|
||||
#include <ScriptCanvas/Profiler/Driller.h>
|
||||
#include <ScriptCanvas/Translation/Translation.h>
|
||||
#include <ScriptCanvas/Variable/VariableBus.h>
|
||||
#include <ScriptCanvas/Variable/VariableData.h>
|
||||
@@ -72,22 +71,19 @@ namespace ScriptCanvas
|
||||
componentElementNode.AddElementWithData(context, "m_assetType", azrtti_typeid<RuntimeAsset>());
|
||||
}
|
||||
|
||||
if (componentElementNode.GetVersion() <= GraphCpp::GraphVersion::RemoveFunctionGraphMarker)
|
||||
if (auto subElement = componentElementNode.FindElement(AZ_CRC_CE("isFunctionGraph")); subElement > 0)
|
||||
{
|
||||
componentElementNode.RemoveElementByName(AZ_CRC_CE("isFunctionGraph"));
|
||||
componentElementNode.RemoveElement(subElement);
|
||||
}
|
||||
|
||||
if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId)
|
||||
if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData")))
|
||||
{
|
||||
if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData")))
|
||||
if (subElement->GetId() == azrtti_typeid<SlotId>())
|
||||
{
|
||||
if (subElement->GetId() == azrtti_typeid<SlotId>())
|
||||
{
|
||||
componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData"));
|
||||
componentElementNode.AddElementWithData(context, "versionData", VersionData());
|
||||
}
|
||||
componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1203,11 +1199,6 @@ namespace ScriptCanvas
|
||||
m_isObserved = isObserved;
|
||||
}
|
||||
|
||||
AZ::Data::AssetType Graph::GetAssetType() const
|
||||
{
|
||||
return m_assetType;
|
||||
}
|
||||
|
||||
void Graph::VersioningRemoveSlot(ScriptCanvas::Node& scriptCanvasNode, const SlotId& slotId)
|
||||
{
|
||||
bool deletedSlot = true;
|
||||
|
||||
@@ -14,14 +14,12 @@
|
||||
#include <AzCore/std/containers/stack.h>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
#include <AzCore/std/parallel/mutex.h>
|
||||
|
||||
#include <ScriptCanvas/Core/GraphBus.h>
|
||||
#include <ScriptCanvas/Core/GraphData.h>
|
||||
#include <ScriptCanvas/Debugger/Bus.h>
|
||||
#include <ScriptCanvas/Execution/ErrorBus.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionContext.h>
|
||||
#include <ScriptCanvas/Debugger/StatusBus.h>
|
||||
|
||||
#include <ScriptCanvas/Debugger/ValidationEvents/ValidationEvent.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
@@ -189,8 +187,6 @@ namespace ScriptCanvas
|
||||
|
||||
bool IsGraphObserved() const override;
|
||||
void SetIsGraphObserved(bool isObserved) override;
|
||||
|
||||
AZ::Data::AssetType GetAssetType() const override;
|
||||
////
|
||||
|
||||
const AZStd::unordered_map<AZ::EntityId, Node* >& GetNodeMapping() const { return m_nodeMapping; }
|
||||
@@ -200,7 +196,7 @@ namespace ScriptCanvas
|
||||
|
||||
GraphData m_graphData;
|
||||
AZ::Data::AssetType m_assetType;
|
||||
|
||||
|
||||
private:
|
||||
ScriptCanvasId m_scriptCanvasId;
|
||||
ExecutionMode m_executionMode = ExecutionMode::Interpreted;
|
||||
@@ -209,7 +205,7 @@ namespace ScriptCanvas
|
||||
GraphVariableManagerRequests* m_variableRequests = nullptr;
|
||||
|
||||
// Keeps a mapping of the Node EntityId -> NodeComponent.
|
||||
// Saves looking up the NodeComponent everytime we need the Node.
|
||||
// Saves looking up the NodeComponent every time we need the Node.
|
||||
AZStd::unordered_map<AZ::EntityId, Node* > m_nodeMapping;
|
||||
|
||||
bool m_isObserved;
|
||||
|
||||
@@ -147,9 +147,6 @@ namespace ScriptCanvas
|
||||
//! returns a pair of <variable datum pointer, variable name> with the supplied id
|
||||
//! The variable datum pointer is non-null if the variable has been found
|
||||
virtual GraphVariable* FindVariableById(const VariableId& variableId) = 0;
|
||||
|
||||
virtual AZ::Data::AssetType GetAssetType() const = 0;
|
||||
|
||||
};
|
||||
using GraphRequestBus = AZ::EBus<GraphRequests>;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <ScriptCanvas/Core/Contracts/MethodOverloadContract.h>
|
||||
#include <ScriptCanvas/Libraries/Core/Method.h>
|
||||
#include "../../GraphCanvas/Code/Source/Translation/TranslationBus.h"
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
@@ -55,13 +56,30 @@ namespace ScriptCanvas
|
||||
{
|
||||
const Data::Type outputType = (unpackedTypes.size() == 1 && AZ::BehaviorContextHelper::IsStringParameter(*result)) ? Data::Type::String() : Data::FromAZType(unpackedTypes[resultIndex]);
|
||||
|
||||
const AZStd::string resultSlotName(AZStd::string::format("Result: %s", Data::GetName(outputType).data()));
|
||||
AZStd::string resultSlotName(Data::GetName(outputType));
|
||||
|
||||
AZStd::string className = outputConfig.config.m_className ? *outputConfig.config.m_className : "";
|
||||
if (className.empty())
|
||||
{
|
||||
className = outputConfig.config.m_prettyClassName;
|
||||
}
|
||||
|
||||
GraphCanvas::TranslationKey key;
|
||||
key << "BehaviorClass" << className << "methods" << *outputConfig.config.m_lookupName << "results" << resultIndex << "details";
|
||||
|
||||
GraphCanvas::TranslationRequests::Details details;
|
||||
GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details);
|
||||
|
||||
if (!details.m_name.empty())
|
||||
{
|
||||
resultSlotName = details.m_name;
|
||||
}
|
||||
|
||||
SlotId addedSlotId;
|
||||
|
||||
if (outputConfig.isReturnValueOverloaded)
|
||||
{
|
||||
DynamicDataSlotConfiguration slotConfiguration;
|
||||
//slotConfiguration.m_name = outputConfig.outputNamePrefix + resultSlotName;
|
||||
|
||||
slotConfiguration.m_dynamicDataType = outputConfig.methodNode->GetOverloadedOutputType(resultIndex);
|
||||
|
||||
|
||||
@@ -1160,8 +1160,8 @@ namespace ScriptCanvas
|
||||
if (!slot->IsDynamicSlot() || slot->HasDisplayType())
|
||||
{
|
||||
InitializeVariableReference((*slot), {});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ModifiableDatumView datumView;
|
||||
@@ -2391,7 +2391,8 @@ namespace ScriptCanvas
|
||||
|
||||
if (variableIds.count(variableId) > 0)
|
||||
{
|
||||
InitializeVariableReference(slot, variableIds);
|
||||
slot.ClearVariableReference();
|
||||
NodeNotificationsBus::Event(GetEntityId(), &NodeNotifications::OnSlotInputChanged, slot.GetId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2962,6 +2963,11 @@ namespace ScriptCanvas
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string Node::GetNodeTypeName() const
|
||||
{
|
||||
return RTTI_GetTypeName();
|
||||
}
|
||||
|
||||
AZStd::string Node::GetDebugName() const
|
||||
{
|
||||
if (GetEntityId().IsValid())
|
||||
|
||||
@@ -525,6 +525,7 @@ namespace ScriptCanvas
|
||||
|
||||
void SignalDeserialized();
|
||||
|
||||
virtual AZStd::string GetNodeTypeName() const;
|
||||
virtual AZStd::string GetDebugName() const;
|
||||
virtual AZStd::string GetNodeName() const;
|
||||
|
||||
@@ -886,6 +887,8 @@ protected:
|
||||
// The SlotIterator& parameter is populated with an iterator to the inserted or found slot within the slot list
|
||||
AZ::Outcome<SlotIdIteratorMap::iterator, AZStd::string> FindOrInsertSlot(AZ::s64 index, const SlotConfiguration& slotConfig, SlotIterator& iterOut);
|
||||
|
||||
public:
|
||||
|
||||
// This function is only called once, when the node is added to a graph, as opposed to Init(), which will be called
|
||||
// soon after construction, or after deserialization. So the functionality in configure does not need to be idempotent.
|
||||
void Configure();
|
||||
@@ -1091,7 +1094,7 @@ protected:
|
||||
{
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = AZStd::string::format("%s: %s", t_Traits::GetResultName(0), Data::GetName(Data::FromAZType<AZStd::decay_t<ResultType>>()).data());
|
||||
slotConfiguration.m_name = t_Traits::GetResultName(0);
|
||||
slotConfiguration.SetType(Data::FromAZType<AZStd::decay_t<ResultType>>());
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Output);
|
||||
|
||||
@@ -1113,7 +1116,7 @@ protected:
|
||||
{
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = AZStd::string::format("%s: %s", t_Traits::GetResultName(Index), Data::GetName(Data::FromAZType<AZStd::decay_t<AZStd::tuple_element_t<Index, ResultType>>>()).data());
|
||||
slotConfiguration.m_name = t_Traits::GetResultName(Index);
|
||||
slotConfiguration.SetType(Data::FromAZType<AZStd::decay_t<AZStd::tuple_element_t<Index, ResultType>>>());
|
||||
|
||||
slotConfiguration.SetConnectionType(connectionType);
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace ScriptCanvas
|
||||
}\
|
||||
\
|
||||
static const char* GetDependency() { return CATEGORY; }\
|
||||
static const char* GetCategory() { if (ISDEPRECATED) return AZ_STRINGIZE(CATEGORY /Deprecated); else return CATEGORY; };\
|
||||
static const char* GetCategory() { if (IsDeprecated()) return "Deprecated"; else return CATEGORY; };\
|
||||
static const char* GetDescription() { return DESCRIPTION; };\
|
||||
static const char* GetNodeName() { return #NODE_NAME; };\
|
||||
static bool IsDeprecated() { return ISDEPRECATED; };\
|
||||
@@ -256,7 +256,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = AZStd::string::format("%s: %s", Data::Traits<ArgType>::GetName().data(), t_Traits::GetArgName(Index));
|
||||
slotConfiguration.m_name = t_Traits::GetArgName(Index);
|
||||
slotConfiguration.ConfigureDatum(AZStd::move(Datum(Data::FromAZType(Data::Traits<ArgType>::GetAZType()), Datum::eOriginality::Copy)));
|
||||
|
||||
slotConfiguration.SetConnectionType(connectionType);
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace ScriptCanvas
|
||||
->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent)
|
||||
->Attribute(AZ::Script::Attributes::UseClassIndexAllowNil, AZ::AttributeIsValid::IfPresent)
|
||||
->Constructor<ExecutionStateWeakPtr>()
|
||||
->Attribute(AZ::Script::Attributes::DefaultConstructorOverrideIndex, 0)
|
||||
->Method("Deactivate", &Nodeable::Deactivate)
|
||||
->Method("InitializeExecutionState", &Nodeable::InitializeExecutionState)
|
||||
->Method("InitializeExecutionOuts", &Nodeable::InitializeExecutionOuts)
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace ScriptCanvas
|
||||
|
||||
static AZ::Uuid GetAZType(const Data::Type& = {}) { return azrtti_typeid<CRCType>(); }
|
||||
static Data::Type GetSCType(const AZ::TypeId& = AZ::TypeId::CreateNull()) { return Data::Type::CRC(); }
|
||||
static AZStd::string GetName(const Data::Type& = {}) { return "CRC"; }
|
||||
static AZStd::string GetName(const Data::Type& = {}) { return "Tag"; }
|
||||
static Type GetDefault(const Data::Type& = {}) { return CRCType(); }
|
||||
static bool IsDefault(const Type& value, const Data::Type& = {}) { return value == GetDefault(); }
|
||||
};
|
||||
@@ -198,7 +198,7 @@ namespace ScriptCanvas
|
||||
|
||||
static AZ::Uuid GetAZType(const Data::Type& = {}) { return azrtti_typeid<EntityIDType>(); }
|
||||
static Data::Type GetSCType(const AZ::TypeId& = AZ::TypeId::CreateNull()) { return Data::Type::EntityID(); }
|
||||
static AZStd::string GetName(const Data::Type& = {}) { return "EntityID"; }
|
||||
static AZStd::string GetName(const Data::Type& = {}) { return "EntityId"; }
|
||||
static Type GetDefault(const Data::Type& = {}) { return GraphOwnerId; }
|
||||
static bool IsDefault(const Type& value, const Data::Type& = {}) { return value == GetDefault(); }
|
||||
};
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace ScriptCanvas
|
||||
GetterFunction m_getterFunction;
|
||||
Data::Type m_propertyType;
|
||||
AZStd::string m_propertyName;
|
||||
AZStd::string m_displayName;
|
||||
};
|
||||
using GetterContainer = AZStd::unordered_map<AZStd::string, GetterWrapper>;
|
||||
|
||||
@@ -35,6 +36,7 @@ namespace ScriptCanvas
|
||||
SetterFunction m_setterFunction;
|
||||
Data::Type m_propertyType;
|
||||
AZStd::string m_propertyName;
|
||||
AZStd::string m_displayName;
|
||||
};
|
||||
using SetterContainer = AZStd::unordered_map<AZStd::string, SetterWrapper>;
|
||||
|
||||
@@ -84,7 +86,7 @@ namespace ScriptCanvas
|
||||
using PropertyType = AZStd::decay_t<AZStd::invoke_result_t<FunctionType, GetterType>>;
|
||||
static_assert(!AZStd::is_void<PropertyType>::value, "Getter function must return a non-void type");
|
||||
|
||||
static GetterWrapper Callback(AZStd::string_view propertyName, const FunctionType& propertyGetter)
|
||||
static GetterWrapper Callback(AZStd::string_view propertyName, const FunctionType& propertyGetter, AZStd::string_view displayName)
|
||||
{
|
||||
GetterFunction getterWrapper = [propertyGetter](const Datum& thisDatum) -> AZ::Outcome<Datum, AZStd::string>
|
||||
{
|
||||
@@ -97,7 +99,7 @@ namespace ScriptCanvas
|
||||
return AZ::Success(Datum(AZStd::invoke(propertyGetter, thisObject)));
|
||||
};
|
||||
|
||||
return { getterWrapper, Data::FromAZType<PropertyType>(), propertyName };
|
||||
return { getterWrapper, Data::FromAZType<PropertyType>(), propertyName, displayName };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -107,7 +109,7 @@ namespace ScriptCanvas
|
||||
static_assert(!AZStd::is_void<SetterType>::value, "Setter function must be either a member function pointer that accepts 1 arguments or an invokable object that accepts 2 argument");
|
||||
static_assert(!AZStd::is_void<PropertyType>::value, "Property being set must be a non-void type");
|
||||
|
||||
static SetterWrapper Callback(AZStd::string_view propertyName, const FunctionType& propertySetter)
|
||||
static SetterWrapper Callback(AZStd::string_view propertyName, const FunctionType& propertySetter, AZStd::string_view displayName)
|
||||
{
|
||||
SetterFunction setterWrapper = [propertySetter](Datum& thisDatum, const Datum& propertyDatum) -> AZ::Outcome<void, AZStd::string>
|
||||
{
|
||||
@@ -128,7 +130,7 @@ namespace ScriptCanvas
|
||||
return AZ::Success();
|
||||
};
|
||||
|
||||
return { setterWrapper, Data::FromAZType<PropertyType>(), propertyName };
|
||||
return { setterWrapper, Data::FromAZType<PropertyType>(), propertyName, displayName };
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -178,20 +180,20 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::QuaternionType::GetX)>::Callback("x", &Data::QuaternionType::GetX));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::QuaternionType::GetY)>::Callback("y", &Data::QuaternionType::GetY));
|
||||
getterFunctions.emplace("z", WrapGetter<decltype(&Data::QuaternionType::GetZ)>::Callback("z", &Data::QuaternionType::GetZ));
|
||||
getterFunctions.emplace("w", WrapGetter<decltype(&Data::QuaternionType::GetW)>::Callback("w", &Data::QuaternionType::GetW));
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::QuaternionType::GetX)>::Callback("x", &Data::QuaternionType::GetX, "X"));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::QuaternionType::GetY)>::Callback("y", &Data::QuaternionType::GetY, "Y"));
|
||||
getterFunctions.emplace("z", WrapGetter<decltype(&Data::QuaternionType::GetZ)>::Callback("z", &Data::QuaternionType::GetZ, "Z"));
|
||||
getterFunctions.emplace("w", WrapGetter<decltype(&Data::QuaternionType::GetW)>::Callback("w", &Data::QuaternionType::GetW, "W"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::QuaternionType::SetX)>::Callback("x", &Data::QuaternionType::SetX));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::QuaternionType::SetY)>::Callback("y", &Data::QuaternionType::SetY));
|
||||
setterFunctions.emplace("z", WrapSetter<decltype(&Data::QuaternionType::SetZ)>::Callback("z", &Data::QuaternionType::SetZ));
|
||||
setterFunctions.emplace("w", WrapSetter<decltype(&Data::QuaternionType::SetW)>::Callback("w", &Data::QuaternionType::SetW));
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::QuaternionType::SetX)>::Callback("x", &Data::QuaternionType::SetX, "X"));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::QuaternionType::SetY)>::Callback("y", &Data::QuaternionType::SetY, "Y"));
|
||||
setterFunctions.emplace("z", WrapSetter<decltype(&Data::QuaternionType::SetZ)>::Callback("z", &Data::QuaternionType::SetZ, "Z"));
|
||||
setterFunctions.emplace("w", WrapSetter<decltype(&Data::QuaternionType::SetW)>::Callback("w", &Data::QuaternionType::SetW, "W"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -202,16 +204,16 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::Vector2Type::GetX)>::Callback("x", &Data::Vector2Type::GetX));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::Vector2Type::GetY)>::Callback("y", &Data::Vector2Type::GetY));
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::Vector2Type::GetX)>::Callback("x", &Data::Vector2Type::GetX, "X"));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::Vector2Type::GetY)>::Callback("y", &Data::Vector2Type::GetY, "Y"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::Vector2Type::SetX)>::Callback("x", &Data::Vector2Type::SetX));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::Vector2Type::SetY)>::Callback("y", &Data::Vector2Type::SetY));
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::Vector2Type::SetX)>::Callback("x", &Data::Vector2Type::SetX, "X"));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::Vector2Type::SetY)>::Callback("y", &Data::Vector2Type::SetY, "Y"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -222,18 +224,18 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::Vector3Type::GetX)>::Callback("x", &Data::Vector3Type::GetX));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::Vector3Type::GetY)>::Callback("y", &Data::Vector3Type::GetY));
|
||||
getterFunctions.emplace("z", WrapGetter<decltype(&Data::Vector3Type::GetZ)>::Callback("z", &Data::Vector3Type::GetZ));
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::Vector3Type::GetX)>::Callback("x", &Data::Vector3Type::GetX, "X"));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::Vector3Type::GetY)>::Callback("y", &Data::Vector3Type::GetY, "Y"));
|
||||
getterFunctions.emplace("z", WrapGetter<decltype(&Data::Vector3Type::GetZ)>::Callback("z", &Data::Vector3Type::GetZ, "Z"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::Vector3Type::SetX)>::Callback("x", &Data::Vector3Type::SetX));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::Vector3Type::SetY)>::Callback("y", &Data::Vector3Type::SetY));
|
||||
setterFunctions.emplace("z", WrapSetter<decltype(&Data::Vector3Type::SetZ)>::Callback("z", &Data::Vector3Type::SetZ));
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::Vector3Type::SetX)>::Callback("x", &Data::Vector3Type::SetX, "X"));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::Vector3Type::SetY)>::Callback("y", &Data::Vector3Type::SetY, "Y"));
|
||||
setterFunctions.emplace("z", WrapSetter<decltype(&Data::Vector3Type::SetZ)>::Callback("z", &Data::Vector3Type::SetZ, "Z"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -244,20 +246,20 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::Vector4Type::GetX)>::Callback("x", &Data::Vector4Type::GetX));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::Vector4Type::GetY)>::Callback("y", &Data::Vector4Type::GetY));
|
||||
getterFunctions.emplace("z", WrapGetter<decltype(&Data::Vector4Type::GetZ)>::Callback("z", &Data::Vector4Type::GetZ));
|
||||
getterFunctions.emplace("w", WrapGetter<decltype(&Data::Vector4Type::GetW)>::Callback("w", &Data::Vector4Type::GetW));
|
||||
getterFunctions.emplace("x", WrapGetter<decltype(&Data::Vector4Type::GetX)>::Callback("x", &Data::Vector4Type::GetX, "X"));
|
||||
getterFunctions.emplace("y", WrapGetter<decltype(&Data::Vector4Type::GetY)>::Callback("y", &Data::Vector4Type::GetY, "Y"));
|
||||
getterFunctions.emplace("z", WrapGetter<decltype(&Data::Vector4Type::GetZ)>::Callback("z", &Data::Vector4Type::GetZ, "Z"));
|
||||
getterFunctions.emplace("w", WrapGetter<decltype(&Data::Vector4Type::GetW)>::Callback("w", &Data::Vector4Type::GetW, "W"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::Vector4Type::SetX)>::Callback("x", &Data::Vector4Type::SetX));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::Vector4Type::SetY)>::Callback("y", &Data::Vector4Type::SetY));
|
||||
setterFunctions.emplace("z", WrapSetter<decltype(&Data::Vector4Type::SetZ)>::Callback("z", &Data::Vector4Type::SetZ));
|
||||
setterFunctions.emplace("w", WrapSetter<decltype(&Data::Vector4Type::SetW)>::Callback("w", &Data::Vector4Type::SetW));
|
||||
setterFunctions.emplace("x", WrapSetter<decltype(&Data::Vector4Type::SetX)>::Callback("x", &Data::Vector4Type::SetX, "X"));
|
||||
setterFunctions.emplace("y", WrapSetter<decltype(&Data::Vector4Type::SetY)>::Callback("y", &Data::Vector4Type::SetY, "Y"));
|
||||
setterFunctions.emplace("z", WrapSetter<decltype(&Data::Vector4Type::SetZ)>::Callback("z", &Data::Vector4Type::SetZ, "Z"));
|
||||
setterFunctions.emplace("w", WrapSetter<decltype(&Data::Vector4Type::SetW)>::Callback("w", &Data::Vector4Type::SetW, "W"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -268,20 +270,20 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("r", WrapGetter<decltype(&Data::ColorType::GetR)>::Callback("r", &Data::ColorType::GetR));
|
||||
getterFunctions.emplace("g", WrapGetter<decltype(&Data::ColorType::GetG)>::Callback("g", &Data::ColorType::GetG));
|
||||
getterFunctions.emplace("b", WrapGetter<decltype(&Data::ColorType::GetB)>::Callback("b", &Data::ColorType::GetB));
|
||||
getterFunctions.emplace("a", WrapGetter<decltype(&Data::ColorType::GetA)>::Callback("a", &Data::ColorType::GetA));
|
||||
getterFunctions.emplace("r", WrapGetter<decltype(&Data::ColorType::GetR)>::Callback("r", &Data::ColorType::GetR, "Red"));
|
||||
getterFunctions.emplace("g", WrapGetter<decltype(&Data::ColorType::GetG)>::Callback("g", &Data::ColorType::GetG, "Green"));
|
||||
getterFunctions.emplace("b", WrapGetter<decltype(&Data::ColorType::GetB)>::Callback("b", &Data::ColorType::GetB, "Blue"));
|
||||
getterFunctions.emplace("a", WrapGetter<decltype(&Data::ColorType::GetA)>::Callback("a", &Data::ColorType::GetA, "Alpha"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("r", WrapSetter<decltype(&Data::ColorType::SetR)>::Callback("r", &Data::ColorType::SetR));
|
||||
setterFunctions.emplace("g", WrapSetter<decltype(&Data::ColorType::SetG)>::Callback("g", &Data::ColorType::SetG));
|
||||
setterFunctions.emplace("b", WrapSetter<decltype(&Data::ColorType::SetB)>::Callback("b", &Data::ColorType::SetB));
|
||||
setterFunctions.emplace("a", WrapSetter<decltype(&Data::ColorType::SetA)>::Callback("a", &Data::ColorType::SetA));
|
||||
setterFunctions.emplace("r", WrapSetter<decltype(&Data::ColorType::SetR)>::Callback("r", &Data::ColorType::SetR, "Red"));
|
||||
setterFunctions.emplace("g", WrapSetter<decltype(&Data::ColorType::SetG)>::Callback("g", &Data::ColorType::SetG, "Green"));
|
||||
setterFunctions.emplace("b", WrapSetter<decltype(&Data::ColorType::SetB)>::Callback("b", &Data::ColorType::SetB, "Blue"));
|
||||
setterFunctions.emplace("a", WrapSetter<decltype(&Data::ColorType::SetA)>::Callback("a", &Data::ColorType::SetA, "Alpha"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -292,16 +294,16 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("normal", WrapGetter<decltype(&Data::PlaneType::GetNormal)>::Callback("normal", &Data::PlaneType::GetNormal));
|
||||
getterFunctions.emplace("distance", WrapGetter<decltype(&Data::PlaneType::GetDistance)>::Callback("distance", &Data::PlaneType::GetDistance));
|
||||
getterFunctions.emplace("mormal", WrapGetter<decltype(&Data::PlaneType::GetNormal)>::Callback("normal", &Data::PlaneType::GetNormal, "Normal"));
|
||||
getterFunctions.emplace("distance", WrapGetter<decltype(&Data::PlaneType::GetDistance)>::Callback("distance", &Data::PlaneType::GetDistance, "Distance"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("normal", WrapSetter<decltype(&Data::PlaneType::SetNormal)>::Callback("normal", &Data::PlaneType::SetNormal));
|
||||
setterFunctions.emplace("distance", WrapSetter<decltype(&Data::PlaneType::SetDistance)>::Callback("distance", &Data::PlaneType::SetDistance));
|
||||
setterFunctions.emplace("normal", WrapSetter<decltype(&Data::PlaneType::SetNormal)>::Callback("normal", &Data::PlaneType::SetNormal, "Normal"));
|
||||
setterFunctions.emplace("distance", WrapSetter<decltype(&Data::PlaneType::SetDistance)>::Callback("distance", &Data::PlaneType::SetDistance, "Distance"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -312,17 +314,17 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("basisX", WrapGetter<decltype(&Data::TransformType::GetBasisX)>::Callback("basisX", &Data::TransformType::GetBasisX));
|
||||
getterFunctions.emplace("basisY", WrapGetter<decltype(&Data::TransformType::GetBasisY)>::Callback("basisY", &Data::TransformType::GetBasisY));
|
||||
getterFunctions.emplace("basisZ", WrapGetter<decltype(&Data::TransformType::GetBasisZ)>::Callback("basisZ", &Data::TransformType::GetBasisZ));
|
||||
getterFunctions.emplace("translation", WrapGetter<decltype(&Data::TransformType::GetTranslation)>::Callback("translation", &Data::TransformType::GetTranslation));
|
||||
getterFunctions.emplace("basisX", WrapGetter<decltype(&Data::TransformType::GetBasisX)>::Callback("basisX", &Data::TransformType::GetBasisX, "X Axis"));
|
||||
getterFunctions.emplace("basisY", WrapGetter<decltype(&Data::TransformType::GetBasisY)>::Callback("basisY", &Data::TransformType::GetBasisY, "Y Axis"));
|
||||
getterFunctions.emplace("basisZ", WrapGetter<decltype(&Data::TransformType::GetBasisZ)>::Callback("basisZ", &Data::TransformType::GetBasisZ, "Z Axis"));
|
||||
getterFunctions.emplace("translation", WrapGetter<decltype(&Data::TransformType::GetTranslation)>::Callback("translation", &Data::TransformType::GetTranslation, "Translation"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("translation", WrapSetter<void(AZ::Transform::*)(const AZ::Vector3&)>::Callback("translation", &Data::TransformType::SetTranslation));
|
||||
setterFunctions.emplace("translation", WrapSetter<void(AZ::Transform::*)(const AZ::Vector3&)>::Callback("translation", &Data::TransformType::SetTranslation, "Translation"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -333,16 +335,16 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("min", WrapGetter<decltype(&Data::AABBType::GetMin)>::Callback("min", &Data::AABBType::GetMin));
|
||||
getterFunctions.emplace("max", WrapGetter<decltype(&Data::AABBType::GetMax)>::Callback("max", &Data::AABBType::GetMax));
|
||||
getterFunctions.emplace("min", WrapGetter<decltype(&Data::AABBType::GetMin)>::Callback("min", &Data::AABBType::GetMin, "Minimum"));
|
||||
getterFunctions.emplace("max", WrapGetter<decltype(&Data::AABBType::GetMax)>::Callback("max", &Data::AABBType::GetMax, "Maximum"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("min", WrapSetter<decltype(&Data::AABBType::SetMin)>::Callback("min", &Data::AABBType::SetMin));
|
||||
setterFunctions.emplace("max", WrapSetter<decltype(&Data::AABBType::SetMax)>::Callback("max", &Data::AABBType::SetMax));
|
||||
setterFunctions.emplace("min", WrapSetter<decltype(&Data::AABBType::SetMin)>::Callback("min", &Data::AABBType::SetMin, "Minimum"));
|
||||
setterFunctions.emplace("max", WrapSetter<decltype(&Data::AABBType::SetMax)>::Callback("max", &Data::AABBType::SetMax, "Maximum"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -353,23 +355,23 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("axisX", WrapGetter<decltype(&Data::OBBType::GetAxisX)>::Callback("axisX", &Data::OBBType::GetAxisX));
|
||||
getterFunctions.emplace("axisY", WrapGetter<decltype(&Data::OBBType::GetAxisY)>::Callback("axisY", &Data::OBBType::GetAxisY));
|
||||
getterFunctions.emplace("axisZ", WrapGetter<decltype(&Data::OBBType::GetAxisZ)>::Callback("axisZ", &Data::OBBType::GetAxisZ));
|
||||
getterFunctions.emplace("halfLengthX", WrapGetter<decltype(&Data::OBBType::GetHalfLengthX)>::Callback("halfLengthX", &Data::OBBType::GetHalfLengthX));
|
||||
getterFunctions.emplace("halfLengthY", WrapGetter<decltype(&Data::OBBType::GetHalfLengthY)>::Callback("halfLengthY", &Data::OBBType::GetHalfLengthY));
|
||||
getterFunctions.emplace("halfLengthZ", WrapGetter<decltype(&Data::OBBType::GetHalfLengthZ)>::Callback("halfLengthZ", &Data::OBBType::GetHalfLengthZ));
|
||||
getterFunctions.emplace("position", WrapGetter<decltype(&Data::OBBType::GetPosition)>::Callback("position", &Data::OBBType::GetPosition));
|
||||
getterFunctions.emplace("axisX", WrapGetter<decltype(&Data::OBBType::GetAxisX)>::Callback("axisX", &Data::OBBType::GetAxisX, "X Axis"));
|
||||
getterFunctions.emplace("axisY", WrapGetter<decltype(&Data::OBBType::GetAxisY)>::Callback("axisY", &Data::OBBType::GetAxisY, "Y Axis"));
|
||||
getterFunctions.emplace("Z Axis", WrapGetter<decltype(&Data::OBBType::GetAxisZ)>::Callback("axisZ", &Data::OBBType::GetAxisZ, "Z Axis"));
|
||||
getterFunctions.emplace("halfLengthX", WrapGetter<decltype(&Data::OBBType::GetHalfLengthX)>::Callback("halfLengthX", &Data::OBBType::GetHalfLengthX, "Half Length X"));
|
||||
getterFunctions.emplace("halfLengthY", WrapGetter<decltype(&Data::OBBType::GetHalfLengthY)>::Callback("halfLengthY", &Data::OBBType::GetHalfLengthY, "Half Length Y"));
|
||||
getterFunctions.emplace("halfLengthZ", WrapGetter<decltype(&Data::OBBType::GetHalfLengthZ)>::Callback("halfLengthZ", &Data::OBBType::GetHalfLengthZ, "Half Length Z"));
|
||||
getterFunctions.emplace("position", WrapGetter<decltype(&Data::OBBType::GetPosition)>::Callback("position", &Data::OBBType::GetPosition, "Position"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("halfLengthX", WrapSetter<decltype(&Data::OBBType::SetHalfLengthX)>::Callback("halfLengthX", &Data::OBBType::SetHalfLengthX));
|
||||
setterFunctions.emplace("halfLengthY", WrapSetter<decltype(&Data::OBBType::SetHalfLengthY)>::Callback("halfLengthY", &Data::OBBType::SetHalfLengthY));
|
||||
setterFunctions.emplace("halfLengthZ", WrapSetter<decltype(&Data::OBBType::SetHalfLengthZ)>::Callback("halfLengthZ", &Data::OBBType::SetHalfLengthZ));
|
||||
setterFunctions.emplace("position", WrapSetter<decltype(&Data::OBBType::SetPosition)>::Callback("position", &Data::OBBType::SetPosition));
|
||||
setterFunctions.emplace("halfLengthX", WrapSetter<decltype(&Data::OBBType::SetHalfLengthX)>::Callback("halfLengthX", &Data::OBBType::SetHalfLengthX, "Half Length X"));
|
||||
setterFunctions.emplace("halfLengthY", WrapSetter<decltype(&Data::OBBType::SetHalfLengthY)>::Callback("halfLengthY", &Data::OBBType::SetHalfLengthY, "Half Length Y"));
|
||||
setterFunctions.emplace("halfLengthZ", WrapSetter<decltype(&Data::OBBType::SetHalfLengthZ)>::Callback("halfLengthZ", &Data::OBBType::SetHalfLengthZ, "Half Length Z"));
|
||||
setterFunctions.emplace("position", WrapSetter<decltype(&Data::OBBType::SetPosition)>::Callback("position", &Data::OBBType::SetPosition, "Position"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -380,18 +382,18 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("basisX", WrapGetter<decltype(&Data::Matrix3x3Type::GetBasisX)>::Callback("basisX", &Data::Matrix3x3Type::GetBasisX));
|
||||
getterFunctions.emplace("basisY", WrapGetter<decltype(&Data::Matrix3x3Type::GetBasisY)>::Callback("basisY", &Data::Matrix3x3Type::GetBasisY));
|
||||
getterFunctions.emplace("basisZ", WrapGetter<decltype(&Data::Matrix3x3Type::GetBasisZ)>::Callback("basisZ", &Data::Matrix3x3Type::GetBasisZ));
|
||||
getterFunctions.emplace("basisX", WrapGetter<decltype(&Data::Matrix3x3Type::GetBasisX)>::Callback("basisX", &Data::Matrix3x3Type::GetBasisX, "Position"));
|
||||
getterFunctions.emplace("basisY", WrapGetter<decltype(&Data::Matrix3x3Type::GetBasisY)>::Callback("basisY", &Data::Matrix3x3Type::GetBasisY, "Position"));
|
||||
getterFunctions.emplace("basisZ", WrapGetter<decltype(&Data::Matrix3x3Type::GetBasisZ)>::Callback("basisZ", &Data::Matrix3x3Type::GetBasisZ, "Position"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("basisX", WrapSetter<void(AZ::Matrix3x3::*)(const AZ::Vector3&)>::Callback("basisX", &Data::Matrix3x3Type::SetBasisX));
|
||||
setterFunctions.emplace("basisY", WrapSetter<void(AZ::Matrix3x3::*)(const AZ::Vector3&)>::Callback("basisY", &Data::Matrix3x3Type::SetBasisY));
|
||||
setterFunctions.emplace("basisZ", WrapSetter<void(AZ::Matrix3x3::*)(const AZ::Vector3&)>::Callback("basisZ", &Data::Matrix3x3Type::SetBasisZ));
|
||||
setterFunctions.emplace("basisX", WrapSetter<void(AZ::Matrix3x3::*)(const AZ::Vector3&)>::Callback("basisX", &Data::Matrix3x3Type::SetBasisX, "X Axis"));
|
||||
setterFunctions.emplace("basisY", WrapSetter<void(AZ::Matrix3x3::*)(const AZ::Vector3&)>::Callback("basisY", &Data::Matrix3x3Type::SetBasisY, "Y Axis"));
|
||||
setterFunctions.emplace("basisZ", WrapSetter<void(AZ::Matrix3x3::*)(const AZ::Vector3&)>::Callback("basisZ", &Data::Matrix3x3Type::SetBasisZ, "Z Axis"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
@@ -402,20 +404,20 @@ namespace ScriptCanvas
|
||||
static GetterContainer GetGetterWrappers(const Data::Type&)
|
||||
{
|
||||
GetterContainer getterFunctions;
|
||||
getterFunctions.emplace("basisX", WrapGetter<decltype(&Data::Matrix4x4Type::GetBasisX)>::Callback("basisX", &Data::Matrix4x4Type::GetBasisX));
|
||||
getterFunctions.emplace("basisY", WrapGetter<decltype(&Data::Matrix4x4Type::GetBasisY)>::Callback("basisY", &Data::Matrix4x4Type::GetBasisY));
|
||||
getterFunctions.emplace("basisZ", WrapGetter<decltype(&Data::Matrix4x4Type::GetBasisZ)>::Callback("basisZ", &Data::Matrix4x4Type::GetBasisZ));
|
||||
getterFunctions.emplace("translation", WrapGetter<decltype(&Data::Matrix4x4Type::GetTranslation)>::Callback("translation", &Data::Matrix4x4Type::GetTranslation));
|
||||
getterFunctions.emplace("basisX", WrapGetter<decltype(&Data::Matrix4x4Type::GetBasisX)>::Callback("basisX", &Data::Matrix4x4Type::GetBasisX, "X Axis"));
|
||||
getterFunctions.emplace("basisY", WrapGetter<decltype(&Data::Matrix4x4Type::GetBasisY)>::Callback("basisY", &Data::Matrix4x4Type::GetBasisY, "Y Axis"));
|
||||
getterFunctions.emplace("basisZ", WrapGetter<decltype(&Data::Matrix4x4Type::GetBasisZ)>::Callback("basisZ", &Data::Matrix4x4Type::GetBasisZ, "Z Axis"));
|
||||
getterFunctions.emplace("Translation", WrapGetter<decltype(&Data::Matrix4x4Type::GetTranslation)>::Callback("translation", &Data::Matrix4x4Type::GetTranslation, "Translation"));
|
||||
return getterFunctions;
|
||||
}
|
||||
|
||||
static SetterContainer GetSetterWrappers(const Data::Type&)
|
||||
{
|
||||
SetterContainer setterFunctions;
|
||||
setterFunctions.emplace("basisX", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector4&)>::Callback("basisX", &Data::Matrix4x4Type::SetBasisX));
|
||||
setterFunctions.emplace("basisY", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector4&)>::Callback("basisY", &Data::Matrix4x4Type::SetBasisY));
|
||||
setterFunctions.emplace("basisZ", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector4&)>::Callback("basisZ", &Data::Matrix4x4Type::SetBasisZ));
|
||||
setterFunctions.emplace("translation", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector3&)>::Callback("translation", &Data::Matrix4x4Type::SetTranslation));
|
||||
setterFunctions.emplace("basisX", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector4&)>::Callback("basisX", &Data::Matrix4x4Type::SetBasisX, "X Axis"));
|
||||
setterFunctions.emplace("basisY", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector4&)>::Callback("basisY", &Data::Matrix4x4Type::SetBasisY, "Y Axis"));
|
||||
setterFunctions.emplace("basisZ", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector4&)>::Callback("basisZ", &Data::Matrix4x4Type::SetBasisZ, "Z Axis"));
|
||||
setterFunctions.emplace("translation", WrapSetter<void(AZ::Matrix4x4::*)(const AZ::Vector3&)>::Callback("translation", &Data::Matrix4x4Type::SetTranslation, "Translation"));
|
||||
return setterFunctions;
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ namespace ExecutionInterpretedAPICpp
|
||||
{
|
||||
if (lua_isstring(lua, -1))
|
||||
{
|
||||
AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, "%s", lua_tostring(lua, -1));
|
||||
AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, lua_tostring(lua, -1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -401,7 +401,7 @@ namespace ScriptCanvas
|
||||
// \note: the the object is being constructed, and is assumed to never leave or re-enter Lua again
|
||||
AZ_Assert(lua_isuserdata(lua, -2) && !lua_islightuserdata(lua, -2), "Error in compiled lua file, 1st argument to OverrideNodeableMetatable is not userdata (Nodeable)");
|
||||
AZ_Assert(lua_istable(lua, -1), "Error in compiled lua file, 2nd argument to OverrideNodeableMetatable is not a Lua table");
|
||||
|
||||
|
||||
[[maybe_unused]] auto userData = reinterpret_cast<AZ::LuaUserData*>(lua_touserdata(lua, -2));
|
||||
AZ_Assert(userData && userData->magicData == AZ_CRC_CE("AZLuaUserData"), "this isn't user data");
|
||||
// Lua: LuaUserData::nodeable, class_mt
|
||||
|
||||
+2
@@ -143,6 +143,8 @@ namespace ScriptCanvas
|
||||
AZ_Assert(m_luaRegistryIndex == LUA_NOREF, "ExecutionStateInterpreted already in the Lua registry and risks double deletion");
|
||||
// Lua: instance
|
||||
m_luaRegistryIndex = luaL_ref(m_luaState, LUA_REGISTRYINDEX);
|
||||
AZ_Assert(m_luaRegistryIndex != LUA_REFNIL, "ExecutionStateInterpreted was nil when trying to gain a reference");
|
||||
AZ_Assert(m_luaRegistryIndex != LUA_NOREF, "ExecutionStateInterpreted failed to gain a reference");
|
||||
}
|
||||
|
||||
void ExecutionStateInterpreted::Reflect(AZ::ReflectContext* reflectContext)
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ namespace ScriptCanvas
|
||||
lua_pushvalue(lua, -2);
|
||||
// Lua: instance, graph_VM.k_OnGraphStartFunctionName, instance
|
||||
const int result = Execution::InterpretedSafeCall(lua, 1, 0);
|
||||
// Lua: instance ?
|
||||
// Lua: instance, ?
|
||||
if (result == LUA_OK)
|
||||
{
|
||||
// Lua: instance
|
||||
|
||||
@@ -152,19 +152,19 @@ namespace ScriptCanvas
|
||||
{
|
||||
if (azrtti_istypeof<Nodes::String::Format>(execution->GetId().m_node))
|
||||
{
|
||||
return MetaDataPtr(aznew FormatStringMetaData());
|
||||
return AZStd::make_shared<FormatStringMetaData>();
|
||||
}
|
||||
else if (azrtti_istypeof<Nodes::String::Print>(execution->GetId().m_node))
|
||||
{
|
||||
return MetaDataPtr(aznew PrintMetaData());
|
||||
return AZStd::make_shared<PrintMetaData>();
|
||||
}
|
||||
else if (azrtti_istypeof<Nodes::Math::MathExpression>(execution->GetId().m_node))
|
||||
{
|
||||
return MetaDataPtr(aznew MathExpressionMetaData());
|
||||
return AZStd::make_shared<MathExpressionMetaData>();
|
||||
}
|
||||
else if (execution->GetSymbol() == Symbol::FunctionCall)
|
||||
{
|
||||
return MetaDataPtr(aznew FunctionCallDefaultMetaData());
|
||||
return AZStd::make_shared<FunctionCallDefaultMetaData>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace ScriptCanvas
|
||||
|
||||
void BooleanExpression::InitializeBooleanExpression()
|
||||
{
|
||||
AZ_Assert(false, "InitializeBooleanExpression must be overridden");
|
||||
AZ_Error("Script Canvas", false, "InitializeBooleanExpression implementation should be provided");
|
||||
}
|
||||
|
||||
void BooleanExpression::OnInit()
|
||||
|
||||
@@ -518,7 +518,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
const AZ::BehaviorParameter& argument(event.m_parameters[AZ::eBehaviorBusForwarderEventIndices::Result]);
|
||||
Data::Type inputType(AZ::BehaviorContextHelper::IsStringParameter(argument) ? Data::Type::String() : Data::FromAZType(argument.m_typeId));
|
||||
const AZStd::string argName(AZStd::string::format("Result: %s", Data::GetName(inputType).data()).data());
|
||||
const AZStd::string argName(Data::GetName(inputType));
|
||||
|
||||
DataSlotConfiguration resultConfiguration;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ScriptCanvas/Libraries/Core/ExtractProperty.h>
|
||||
#include <Libraries/Core/MethodUtility.h>
|
||||
|
||||
@@ -183,6 +184,10 @@ namespace ScriptCanvas
|
||||
DataSlotConfiguration config;
|
||||
|
||||
AZStd::string slotName = AZStd::string::format("%s: %s", propertyName.data(), Data::GetName(getterWrapper.m_propertyType).data());
|
||||
if (!getterWrapper.m_displayName.empty())
|
||||
{
|
||||
slotName = getterWrapper.m_displayName;
|
||||
}
|
||||
|
||||
if (existingSlots.find(slotName) == existingSlots.end())
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = AZStd::string::format("%s: %s", propertyName.data(), Data::GetName(getterWrapper.m_propertyType).data());
|
||||
slotConfiguration.m_name = (getterWrapper.m_displayName.empty()) ? propertyName.data() : getterWrapper.m_displayName;
|
||||
slotConfiguration.SetType(getterWrapper.m_propertyType);
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Output);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <Core/SlotExecutionMap.h>
|
||||
#include <Libraries/Core/MethodUtility.h>
|
||||
#include <ScriptCanvas/Utils/BehaviorContextUtils.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
|
||||
namespace MethodCPP
|
||||
{
|
||||
@@ -389,6 +390,9 @@ namespace ScriptCanvas
|
||||
MethodConfiguration config(*method, MethodType::Free);
|
||||
config.m_namespaces = &m_namespaces;
|
||||
config.m_lookupName = &methodName;
|
||||
config.m_prettyClassName = methodName;
|
||||
AZ::StringFunc::Replace(config.m_prettyClassName, "::Getter", "");
|
||||
AZ::StringFunc::Replace(config.m_prettyClassName, "::Setter", "");
|
||||
InitializeMethod(config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace ScriptCanvas
|
||||
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = AZStd::string::format("Result: %s", argumentTypeName.c_str());
|
||||
slotConfiguration.m_name = argumentTypeName;
|
||||
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Input);
|
||||
slotConfiguration.ConfigureDatum(AZStd::move(Datum(inputType, Datum::eOriginality::Copy, nullptr, AZ::Uuid::CreateNull())));
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace ScriptCanvas
|
||||
|
||||
Data::Type outputType(AZ::BehaviorContextHelper::IsStringParameter(*result) ? Data::Type::String() : Data::FromAZType(result->m_typeId));
|
||||
// multiple outs will need out value names
|
||||
const AZStd::string resultSlotName(AZStd::string::format("Result: %s", Data::GetName(outputType).c_str()));
|
||||
const AZStd::string resultSlotName(Data::GetName(outputType));
|
||||
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
Data::Type outputType(AZ::BehaviorContextHelper::IsStringParameter(*result) ? Data::Type::String() : Data::FromAZType(result->m_typeId));
|
||||
// multiple outs will need out value names
|
||||
const AZStd::string resultSlotName(AZStd::string::format("Result: %s", Data::GetName(outputType).c_str()));
|
||||
const AZStd::string resultSlotName(Data::GetName(outputType));
|
||||
|
||||
Slot* slot = GetSlotByName(resultSlotName);
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = AZStd::string::format("%s: %s", propertyName.data(), Data::GetName(getterWrapper.m_propertyType).data());
|
||||
slotConfiguration.m_name = (getterWrapper.m_displayName.empty()) ? propertyName.data() : getterWrapper.m_displayName;
|
||||
slotConfiguration.SetType(getterWrapper.m_propertyType);
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Output);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ScriptCanvas
|
||||
namespace EntityNodes
|
||||
{
|
||||
using namespace Data;
|
||||
static const char* k_categoryName = "Entity/Entity";
|
||||
static constexpr const char* k_categoryName = "Entity/Entity";
|
||||
|
||||
template<int t_Index>
|
||||
AZ_INLINE void DefaultScale(Node& node) { SetDefaultValuesByIndex<t_Index>::_(node, Data::One()); }
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace Data;
|
||||
using namespace MathNodeUtilities;
|
||||
static const char* k_categoryName = "Math/AABB";
|
||||
static constexpr const char* k_categoryName = "Math/AABB";
|
||||
|
||||
AZ_INLINE AABBType AddAABB(AABBType a, const AABBType& b)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace CRCNodes
|
||||
{
|
||||
static const char* k_categoryName = "Math/Crc32";
|
||||
static constexpr const char* k_categoryName = "Math/Crc32";
|
||||
|
||||
AZ_INLINE Data::CRCType FromString(Data::StringType value)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace Data;
|
||||
using namespace MathNodeUtilities;
|
||||
static const char* k_categoryName = "Math/Color";
|
||||
static constexpr const char* k_categoryName = "Math/Color";
|
||||
|
||||
AZ_INLINE ColorType Add(ColorType a, ColorType b)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace MathNodes
|
||||
{
|
||||
static const char* k_categoryName = "Math";
|
||||
static constexpr const char* k_categoryName = "Math";
|
||||
|
||||
AZ_INLINE Data::NumberType MultiplyAndAdd(Data::NumberType multiplicand, Data::NumberType multiplier, Data::NumberType addend)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace RandomNodes
|
||||
{
|
||||
static const char* k_categoryName = "Math/Random";
|
||||
static constexpr const char* k_categoryName = "Math/Random";
|
||||
|
||||
// RandomColor
|
||||
AZ_INLINE void SetRandomColorDefaults(Node& node)
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace Matrix3x3Nodes
|
||||
{
|
||||
static const char* k_categoryName = "Math/Matrix3x3";
|
||||
static constexpr const char* k_categoryName = "Math/Matrix3x3";
|
||||
|
||||
AZ_INLINE Data::Matrix3x3Type Add(const Data::Matrix3x3Type& lhs, const Data::Matrix3x3Type& rhs)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace Matrix4x4Nodes
|
||||
{
|
||||
static const char* k_categoryName = "Math/Matrix4x4";
|
||||
static constexpr const char* k_categoryName = "Math/Matrix4x4";
|
||||
|
||||
AZ_INLINE Data::Matrix4x4Type FromColumns(const Data::Vector4Type& col0, const Data::Vector4Type& col1, const Data::Vector4Type& col2, const Data::Vector4Type& col3)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace Data;
|
||||
using namespace MathNodeUtilities;
|
||||
static const char* k_categoryName = "Math/OBB";
|
||||
static constexpr const char* k_categoryName = "Math/OBB";
|
||||
|
||||
AZ_INLINE OBBType FromAabb(const AABBType& source)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace Data;
|
||||
using namespace MathNodeUtilities;
|
||||
static const char* k_categoryName = "Math/Plane";
|
||||
static constexpr const char* k_categoryName = "Math/Plane";
|
||||
|
||||
AZ_INLINE NumberType DistanceToPoint(PlaneType source, Vector3Type point)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace Data;
|
||||
using namespace MathNodeUtilities;
|
||||
static const char* k_categoryName = "Math/Quaternion";
|
||||
static constexpr const char* k_categoryName = "Math/Quaternion";
|
||||
|
||||
AZ_INLINE QuaternionType Add(QuaternionType a, QuaternionType b)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace Data;
|
||||
using namespace MathNodeUtilities;
|
||||
static const char* k_categoryName = "Math/Transform";
|
||||
static constexpr const char* k_categoryName = "Math/Transform";
|
||||
|
||||
AZ_INLINE std::tuple<NumberType, TransformType> ExtractUniformScale(TransformType source)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace MathNodeUtilities;
|
||||
using namespace Data;
|
||||
static const char* k_categoryName = "Math/Vector2";
|
||||
static constexpr const char* k_categoryName = "Math/Vector2";
|
||||
|
||||
AZ_INLINE Vector2Type Absolute(const Vector2Type source)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace MathNodeUtilities;
|
||||
using namespace Data;
|
||||
static const char* k_categoryName = "Math/Vector3";
|
||||
static constexpr const char* k_categoryName = "Math/Vector3";
|
||||
|
||||
AZ_INLINE Vector3Type Absolute(const Vector3Type source)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
using namespace MathNodeUtilities;
|
||||
using namespace Data;
|
||||
static const char* k_categoryName = "Math/Vector4";
|
||||
static constexpr const char* k_categoryName = "Math/Vector4";
|
||||
|
||||
AZ_INLINE Vector4Type Absolute(const Vector4Type source)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace StringNodes
|
||||
{
|
||||
static const char* k_categoryName = "String";
|
||||
static constexpr const char* k_categoryName = "String";
|
||||
|
||||
AZ_INLINE Data::StringType ToLower(Data::StringType sourceString)
|
||||
{
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Profiler
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Profiler
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* 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 <ScriptCanvas/Core/Graph.h>
|
||||
#include <ScriptCanvas/Core/Node.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Profiler
|
||||
{
|
||||
void Driller::OnNodeExecute(Node* node)
|
||||
{
|
||||
m_output->BeginTag(AZ_CRC("ScriptCanvasGraphDriller", 0xb161ccb2));
|
||||
{
|
||||
m_output->BeginTag(AZ_CRC("OnNodeExecute", 0x3e51a5eb));
|
||||
{
|
||||
m_output->Write(AZ_CRC("NodeName", 0x606d4587), node->GetEntity()->GetName());
|
||||
m_output->Write(AZ_CRC("NodeType", 0xb2906ca8), node->RTTI_GetTypeName());
|
||||
}
|
||||
m_output->EndTag(AZ_CRC("StringEvent", 0xd1e005df));
|
||||
}
|
||||
m_output->EndTag(AZ_CRC("ScriptCanvasGraphDriller", 0xb161ccb2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* 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/Driller/Driller.h>
|
||||
#include <AzCore/Driller/DrillerBus.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
class Graph;
|
||||
class Node;
|
||||
|
||||
namespace Profiler
|
||||
{
|
||||
class DrillerInterface
|
||||
: public AZ::Debug::DrillerEBusTraits
|
||||
{
|
||||
public:
|
||||
|
||||
// On Entry
|
||||
// On Execute/Upate
|
||||
// On Exit
|
||||
virtual void OnNodeExecute(Node*) = 0;
|
||||
|
||||
};
|
||||
|
||||
using DrillerBus = AZ::EBus<DrillerInterface>;
|
||||
|
||||
class DrillerCommandInterface
|
||||
: public AZ::Debug::DrillerEBusTraits
|
||||
{
|
||||
public:
|
||||
|
||||
virtual Graph* RequestDrilledGraph() = 0;
|
||||
};
|
||||
|
||||
using DrillerCommandBus = AZ::EBus<DrillerCommandInterface>;
|
||||
|
||||
class Driller
|
||||
: public AZ::Debug::Driller
|
||||
, public DrillerBus::Handler
|
||||
{
|
||||
bool m_isDetailedCapture;
|
||||
|
||||
Graph* m_drilledGraph;
|
||||
|
||||
using ParamArrayType = AZStd::vector<Param>;
|
||||
ParamArrayType m_params;
|
||||
|
||||
public:
|
||||
|
||||
AZ_CLASS_ALLOCATOR(Driller, AZ::SystemAllocator, 0);
|
||||
|
||||
const char* GroupName() const override { return "ScriptCanvasDrillers"; }
|
||||
const char* GetName() const override { return "ScriptCanvasGraphDriller"; }
|
||||
const char* GetDescription() const override { return "Drilling the Script Canvas execution engine"; }
|
||||
int GetNumParams() const override { return static_cast<int>(m_params.size()); }
|
||||
const Param* GetParam(int index) const override { return &m_params[index]; }
|
||||
|
||||
Driller()
|
||||
: m_isDetailedCapture(false)
|
||||
, m_drilledGraph(nullptr)
|
||||
{
|
||||
Param isDetailed;
|
||||
isDetailed.desc = "IsDetailedDrill";
|
||||
isDetailed.name = AZ_CRC("IsDetailedDrill", 0x2155cef2);
|
||||
isDetailed.type = Param::PT_BOOL;
|
||||
isDetailed.value = 0;
|
||||
m_params.push_back(isDetailed);
|
||||
}
|
||||
|
||||
void Start(const Param* params = nullptr, int numParams = 0) override
|
||||
{
|
||||
m_isDetailedCapture = m_params[0].value != 0;
|
||||
if (params)
|
||||
{
|
||||
for (int i = 0; i < numParams; i++)
|
||||
{
|
||||
if (params[i].name == m_params[0].name)
|
||||
{
|
||||
m_isDetailedCapture = params[i].value != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DrillerCommandBus::BroadcastResult(m_drilledGraph, &DrillerCommandInterface::RequestDrilledGraph);
|
||||
// AZ_TEST_ASSERT(m_drilledGraph != nullptr); /// Make sure we have our object by the time we started the driller
|
||||
|
||||
m_output->BeginTag(AZ_CRC("ScriptCanvasGraphDriller", 0xb161ccb2));
|
||||
m_output->Write(AZ_CRC("OnStart", 0x8b372fca), m_isDetailedCapture);
|
||||
// write drilled object initial state
|
||||
m_output->EndTag(AZ_CRC("ScriptCanvasGraphDriller", 0xb161ccb2));
|
||||
|
||||
BusConnect();
|
||||
}
|
||||
|
||||
void Stop() override
|
||||
{
|
||||
//m_drilledGraph = nullptr;
|
||||
//m_output->BeginTag(AZ_CRC("ScriptCanvasGraphDriller"));
|
||||
//m_output->Write(AZ_CRC("OnStop"), m_isDetailedCapture);
|
||||
//m_output->EndTag(AZ_CRC("ScriptCanvasGraphDriller"));
|
||||
//BusDisconnect();
|
||||
}
|
||||
|
||||
void OnNodeExecute(Node* node) override;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Profiler
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* 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/Memory/SystemAllocator.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Profiler
|
||||
{
|
||||
namespace Event
|
||||
{
|
||||
class GraphExecutionStart
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(GraphExecutionStart, AZ::SystemAllocator, 0)
|
||||
AZ_RTTI(GraphExecutionStart, "{AAB7E2E1-9096-4F51-90CA-259A057F2D88}");
|
||||
|
||||
GraphExecutionStart()
|
||||
{}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "TranslationUtilities.h"
|
||||
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
#include <AzCore/IO/FileIOEventBus.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <ScriptCanvas/Core/Node.h>
|
||||
#include <ScriptCanvas/Core/Slot.h>
|
||||
@@ -71,34 +70,6 @@ namespace TranslationUtilitiesCPP
|
||||
return AZStd::string::format("%s%s_VM.%s", TranslationUtilitiesCPP::k_fileDirectoryPathLua, source.m_name.data(), extension.data());
|
||||
}
|
||||
|
||||
class FileEventHandler
|
||||
: public AZ::IO::FileIOEventBus::Handler
|
||||
{
|
||||
public:
|
||||
int m_errorCode = 0;
|
||||
AZStd::string m_fileName;
|
||||
|
||||
FileEventHandler()
|
||||
{
|
||||
BusConnect();
|
||||
}
|
||||
|
||||
~FileEventHandler()
|
||||
{
|
||||
BusDisconnect();
|
||||
}
|
||||
|
||||
void OnError(const AZ::IO::SystemFile* /*file*/, const char* fileName, int errorCode) override
|
||||
{
|
||||
m_errorCode = errorCode;
|
||||
|
||||
if (fileName)
|
||||
{
|
||||
m_fileName = fileName;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
AZ::Outcome<void, AZStd::string> SaveFile(const Grammar::Source& source, AZStd::string_view text, AZStd::string_view extension)
|
||||
{
|
||||
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
|
||||
@@ -111,25 +82,23 @@ namespace TranslationUtilitiesCPP
|
||||
// \todo get a (debug) file path based on the extension
|
||||
const AZStd::string filePath = TranslationUtilitiesCPP::GetDebugLuaFilePath(source, extension);
|
||||
|
||||
FileEventHandler eventHandler;
|
||||
|
||||
AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle;
|
||||
const AZ::IO::Result fileOpenResult = fileIO->Open(filePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle);
|
||||
if (fileOpenResult != AZ::IO::ResultCode::Success)
|
||||
{
|
||||
return AZ::Failure(AZStd::string::format("Failed to open file: %s, error code: %d", filePath.c_str(), eventHandler.m_errorCode));
|
||||
return AZ::Failure(AZStd::string::format("Failed to open file: %sd", filePath.c_str()));
|
||||
}
|
||||
|
||||
const AZ::IO::Result fileWriteResult = fileIO->Write(fileHandle, text.begin(), text.size());
|
||||
if (fileWriteResult != AZ::IO::ResultCode::Success)
|
||||
{
|
||||
return AZ::Failure(AZStd::string::format("Failed to write file: %s, error code: %d", filePath.c_str(), eventHandler.m_errorCode));
|
||||
return AZ::Failure(AZStd::string::format("Failed to write file: %s", filePath.c_str()));
|
||||
}
|
||||
|
||||
const AZ::IO::Result fileCloseResult = fileIO->Close(fileHandle);
|
||||
if (fileCloseResult != AZ::IO::ResultCode::Success)
|
||||
{
|
||||
return AZ::Failure(AZStd::string::format("Failed to close file: %s, error code: %d", filePath.c_str(), eventHandler.m_errorCode));
|
||||
return AZ::Failure(AZStd::string::format("Failed to close file: %s", filePath.c_str()));
|
||||
}
|
||||
|
||||
return AZ::Success();
|
||||
|
||||
@@ -335,6 +335,11 @@ namespace ScriptCanvas
|
||||
return &m_datum;
|
||||
}
|
||||
|
||||
Datum& GraphVariable::ModDatum()
|
||||
{
|
||||
return m_datum;
|
||||
}
|
||||
|
||||
void GraphVariable::ConfigureDatumView(ModifiableDatumView& datumView)
|
||||
{
|
||||
datumView.ConfigureView((*this));
|
||||
@@ -493,14 +498,6 @@ namespace ScriptCanvas
|
||||
return m_sortPriority;
|
||||
}
|
||||
|
||||
bool GraphVariable::IsInFunction() const
|
||||
{
|
||||
AZ::Data::AssetType assetType = AZ::Data::AssetType::CreateNull();
|
||||
ScriptCanvas::GraphRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType);
|
||||
|
||||
return assetType == azrtti_typeid<ScriptCanvas::SubgraphInterfaceAsset>();
|
||||
}
|
||||
|
||||
AZ::u32 GraphVariable::OnInitialValueSourceChanged()
|
||||
{
|
||||
VariableNotificationBus::Event(GetGraphScopedId(), &VariableNotifications::OnVariableInitialValueSourceChanged);
|
||||
|
||||
@@ -127,6 +127,8 @@ namespace ScriptCanvas
|
||||
|
||||
const Datum* GetDatum() const;
|
||||
|
||||
Datum& ModDatum();
|
||||
|
||||
bool IsComponentProperty() const;
|
||||
|
||||
void ConfigureDatumView(ModifiableDatumView& accessController);
|
||||
@@ -194,9 +196,7 @@ namespace ScriptCanvas
|
||||
choices.emplace_back(AZStd::make_pair(static_cast<unsigned char>(VariableFlags::Scope::Function), s_ScopeNames[1]));
|
||||
return choices;
|
||||
}
|
||||
|
||||
bool IsInFunction() const;
|
||||
|
||||
|
||||
void OnScopeTypedChanged();
|
||||
AZ::u32 OnInitialValueSourceChanged();
|
||||
void OnSortPriorityChanged();
|
||||
|
||||
Reference in New Issue
Block a user