The Great ScriptCanvas Purge, Part II
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -171,15 +171,15 @@ namespace ScriptCanvasEditor
|
||||
|
||||
struct ScopedOutputSuppression
|
||||
{
|
||||
ScopedOutputSuppression(bool suppressState = true)
|
||||
ScopedOutputSuppression([[maybe_unused]] bool suppressState = true)
|
||||
{
|
||||
AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", "");
|
||||
TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState);
|
||||
// AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", "");
|
||||
// TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState);
|
||||
}
|
||||
|
||||
~ScopedOutputSuppression()
|
||||
{
|
||||
TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression);
|
||||
// TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression);
|
||||
}
|
||||
private:
|
||||
bool m_oldSuppression = false;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ScriptCanvasEditor
|
||||
EBusHandler,
|
||||
EBusHandlerEvent,
|
||||
EBusSender,
|
||||
EntityRef,
|
||||
_deprecated_,
|
||||
VariableNode,
|
||||
SetVariable,
|
||||
GetVariable,
|
||||
|
||||
@@ -131,36 +131,6 @@ namespace ScriptCanvasEditor::Nodes
|
||||
return AZStd::make_pair(node, nodeIdPair);
|
||||
}
|
||||
|
||||
NodeIdPair CreateEntityNode(const AZ::EntityId& sourceId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId)
|
||||
{
|
||||
AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__);
|
||||
NodeIdPair nodeIdPair;
|
||||
|
||||
ScriptCanvas::Node* node = nullptr;
|
||||
AZ::Entity* scriptCanvasEntity{ aznew AZ::Entity };
|
||||
scriptCanvasEntity->Init();
|
||||
nodeIdPair.m_scriptCanvasId = scriptCanvasEntity->GetId();
|
||||
ScriptCanvas::SystemRequestBus::BroadcastResult(node, &ScriptCanvas::SystemRequests::CreateNodeOnEntity, scriptCanvasEntity->GetId(), scriptCanvasId, ScriptCanvas::Nodes::Entity::EntityRef::RTTI_Type());
|
||||
|
||||
auto* entityNode = azrtti_cast<ScriptCanvas::Nodes::Entity::EntityRef*>(node);
|
||||
entityNode->SetEntityRef(sourceId);
|
||||
|
||||
// Set the name
|
||||
AZ::Entity* sourceEntity = nullptr;
|
||||
AZ::ComponentApplicationBus::BroadcastResult(sourceEntity, &AZ::ComponentApplicationRequests::FindEntity, sourceId);
|
||||
if (sourceEntity)
|
||||
{
|
||||
scriptCanvasEntity->SetName(AZStd::string::format("SC-EntityRef(%s)", sourceEntity->GetName().data()));
|
||||
}
|
||||
|
||||
AZ::EntityId graphCanvasGraphId;
|
||||
EditorGraphRequestBus::EventResult(graphCanvasGraphId, scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId);
|
||||
|
||||
nodeIdPair.m_graphCanvasId = DisplayEntityNode(graphCanvasGraphId, entityNode);
|
||||
|
||||
return nodeIdPair;
|
||||
}
|
||||
|
||||
NodeIdPair CreateObjectMethodNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, ScriptCanvas::PropertyStatus propertyStatus)
|
||||
{
|
||||
AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__);
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace ScriptCanvasEditor::Nodes
|
||||
// Specific create methods which will also handle displaying the node.
|
||||
AZStd::pair<ScriptCanvas::Node*, NodeIdPair> CreateAndGetNode(const AZ::Uuid& classData, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const StyleConfiguration& styleConfiguration, AZStd::function<void(ScriptCanvas::Node*)> = nullptr);
|
||||
NodeIdPair CreateNode(const AZ::Uuid& classData, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const StyleConfiguration& styleConfiguration);
|
||||
NodeIdPair CreateEntityNode(const AZ::EntityId& sourceId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId);
|
||||
NodeIdPair CreateObjectMethodNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, ScriptCanvas::PropertyStatus propertyStatus);
|
||||
NodeIdPair CreateObjectMethodOverloadNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasGraphId);
|
||||
NodeIdPair CreateGlobalMethodNode(AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId);
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include <ScriptCanvas/Libraries/Core/Method.h>
|
||||
#include <ScriptCanvas/Libraries/Core/SendScriptEvent.h>
|
||||
#include <ScriptCanvas/Libraries/Core/SetVariable.h>
|
||||
#include <ScriptCanvas/Libraries/Entity/EntityRef.h>
|
||||
|
||||
|
||||
namespace ScriptCanvasEditor::Nodes::SlotDisplayHelper
|
||||
{
|
||||
@@ -1093,10 +1091,6 @@ namespace ScriptCanvasEditor::Nodes
|
||||
{
|
||||
graphCanvasNodeId = DisplayAzEventHandlerNode(graphCanvasGraphId, azEventHandlerNode);
|
||||
}
|
||||
else if (azrtti_istypeof<ScriptCanvas::Nodes::Entity::EntityRef>(node))
|
||||
{
|
||||
graphCanvasNodeId = DisplayEntityNode(graphCanvasGraphId, static_cast<const ScriptCanvas::Nodes::Entity::EntityRef*>(node));
|
||||
}
|
||||
else if (azrtti_istypeof<ScriptCanvas::Nodes::Core::ReceiveScriptEvent>(node))
|
||||
{
|
||||
graphCanvasNodeId = DisplayScriptEventWrapperNode(graphCanvasGraphId, static_cast<const ScriptCanvas::Nodes::Core::ReceiveScriptEvent*>(node));
|
||||
|
||||
@@ -30,10 +30,6 @@ namespace ScriptCanvas::Nodes::Core
|
||||
class SetVariableNode;
|
||||
class SendScriptEvent;
|
||||
}
|
||||
namespace ScriptCanvas::Nodes::Entity
|
||||
{
|
||||
class EntityRef;
|
||||
}
|
||||
namespace ScriptEvents
|
||||
{
|
||||
class Method;
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace ScriptCanvasEditor
|
||||
CreateEBusHandlerMimeEvent::Reflect(context);
|
||||
CreateEBusHandlerEventMimeEvent::Reflect(context);
|
||||
CreateEBusSenderMimeEvent::Reflect(context);
|
||||
CreateEntityRefNodeMimeEvent::Reflect(context);
|
||||
CreateGetVariableNodeMimeEvent::Reflect(context);
|
||||
CreateSetVariableNodeMimeEvent::Reflect(context);
|
||||
CreateVariableChangedNodeMimeEvent::Reflect(context);
|
||||
|
||||
-41
@@ -27,47 +27,6 @@
|
||||
|
||||
namespace ScriptCanvasEditor
|
||||
{
|
||||
/////////////////////////////////
|
||||
// CreateEntityRefNodeMimeEvent
|
||||
/////////////////////////////////
|
||||
|
||||
void CreateEntityRefNodeMimeEvent::Reflect(AZ::ReflectContext* reflectContext)
|
||||
{
|
||||
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflectContext);
|
||||
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<CreateEntityRefNodeMimeEvent, GraphCanvas::GraphCanvasMimeEvent>()
|
||||
->Version(0)
|
||||
->Field("EntityId", &CreateEntityRefNodeMimeEvent::m_entityId)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
CreateEntityRefNodeMimeEvent::CreateEntityRefNodeMimeEvent(const AZ::EntityId& entityId)
|
||||
: m_entityId(entityId)
|
||||
{
|
||||
}
|
||||
|
||||
ScriptCanvasEditor::NodeIdPair CreateEntityRefNodeMimeEvent::CreateNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const
|
||||
{
|
||||
return Nodes::CreateEntityNode(m_entityId, scriptCanvasId);
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
// EntityRefNodePaletteTreeItem
|
||||
/////////////////////////////////
|
||||
|
||||
EntityRefNodePaletteTreeItem::EntityRefNodePaletteTreeItem(AZStd::string_view nodeName, [[maybe_unused]] const QString& iconPath)
|
||||
: DraggableNodePaletteTreeItem(nodeName, ScriptCanvasEditor::AssetEditorId)
|
||||
{
|
||||
}
|
||||
|
||||
GraphCanvas::GraphCanvasMimeEvent* EntityRefNodePaletteTreeItem::CreateMimeEvent() const
|
||||
{
|
||||
return aznew CreateEntityRefNodeMimeEvent();
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
// CreateCommentNodeMimeEvent
|
||||
///////////////////////////////
|
||||
|
||||
-33
@@ -11,39 +11,6 @@
|
||||
|
||||
namespace ScriptCanvasEditor
|
||||
{
|
||||
// <EntityRefNode>
|
||||
class CreateEntityRefNodeMimeEvent
|
||||
: public CreateNodeMimeEvent
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(CreateEntityRefNodeMimeEvent, "{20CD5AF5-216E-4A41-9630-191C2803899B}", CreateNodeMimeEvent);
|
||||
AZ_CLASS_ALLOCATOR(CreateEntityRefNodeMimeEvent, AZ::SystemAllocator, 0);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* reflectContext);
|
||||
|
||||
CreateEntityRefNodeMimeEvent() = default;
|
||||
CreateEntityRefNodeMimeEvent(const AZ::EntityId& entityId);
|
||||
~CreateEntityRefNodeMimeEvent() = default;
|
||||
|
||||
protected:
|
||||
ScriptCanvasEditor::NodeIdPair CreateNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const override;
|
||||
|
||||
private:
|
||||
AZ::EntityId m_entityId;
|
||||
};
|
||||
|
||||
class EntityRefNodePaletteTreeItem
|
||||
: public GraphCanvas::DraggableNodePaletteTreeItem
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(EntityRefNodePaletteTreeItem, AZ::SystemAllocator, 0);
|
||||
EntityRefNodePaletteTreeItem(AZStd::string_view nodeName, const QString& iconPath);
|
||||
~EntityRefNodePaletteTreeItem() = default;
|
||||
|
||||
GraphCanvas::GraphCanvasMimeEvent* CreateMimeEvent() const override;
|
||||
};
|
||||
// </EntityRefNode>
|
||||
|
||||
// <CommentNode>
|
||||
class CreateCommentNodeMimeEvent
|
||||
: public SpecializedCreateNodeMimeEvent
|
||||
|
||||
-1
@@ -30,7 +30,6 @@
|
||||
#include "Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h"
|
||||
|
||||
#include <Core/Attributes.h>
|
||||
#include <Libraries/Core/Assign.h>
|
||||
#include <Libraries/Core/Method.h>
|
||||
|
||||
#include <Editor/GraphCanvas/GraphCanvasEditorNotificationBusId.h>
|
||||
|
||||
@@ -55,59 +55,6 @@
|
||||
|
||||
namespace ScriptCanvasEditor
|
||||
{
|
||||
//////////////////////////////
|
||||
// AddSelectedEntitiesAction
|
||||
//////////////////////////////
|
||||
|
||||
AddSelectedEntitiesAction::AddSelectedEntitiesAction(QObject* parent)
|
||||
: GraphCanvas::ContextMenuAction("", parent)
|
||||
{
|
||||
}
|
||||
|
||||
GraphCanvas::ActionGroupId AddSelectedEntitiesAction::GetActionGroupId() const
|
||||
{
|
||||
return AZ_CRC("EntityActionGroup", 0x17e16dfe);
|
||||
}
|
||||
|
||||
void AddSelectedEntitiesAction::RefreshAction(const GraphCanvas::GraphId&, const AZ::EntityId&)
|
||||
{
|
||||
AzToolsFramework::EntityIdList selectedEntities;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
|
||||
|
||||
setEnabled(!selectedEntities.empty());
|
||||
|
||||
if (selectedEntities.size() <= 1)
|
||||
{
|
||||
setText("Reference selected entity");
|
||||
}
|
||||
else
|
||||
{
|
||||
setText("Reference selected entities");
|
||||
}
|
||||
}
|
||||
|
||||
GraphCanvas::ContextMenuAction::SceneReaction AddSelectedEntitiesAction::TriggerAction(const AZ::EntityId& graphCanvasGraphId, const AZ::Vector2& scenePos)
|
||||
{
|
||||
AzToolsFramework::EntityIdList selectedEntities;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
|
||||
|
||||
ScriptCanvas::ScriptCanvasId scriptCanvasId;
|
||||
GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::GetScriptCanvasId, graphCanvasGraphId);
|
||||
|
||||
GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::ClearSelection);
|
||||
|
||||
AZ::Vector2 addPosition = scenePos;
|
||||
|
||||
for (const AZ::EntityId& id : selectedEntities)
|
||||
{
|
||||
NodeIdPair nodePair = Nodes::CreateEntityNode(id, scriptCanvasId);
|
||||
GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::AddNode, nodePair.m_graphCanvasId, addPosition, false);
|
||||
addPosition += AZ::Vector2(20, 20);
|
||||
}
|
||||
|
||||
return GraphCanvas::ContextMenuAction::SceneReaction::PostUndo;
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
// EndpointSelectionAction
|
||||
////////////////////////////
|
||||
@@ -860,12 +807,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
const bool inContextMenu = true;
|
||||
Widget::ScriptCanvasNodePaletteConfig paletteConfig(paletteModel, assetModel, inContextMenu);
|
||||
|
||||
m_addSelectedEntitiesAction = aznew AddSelectedEntitiesAction(this);
|
||||
|
||||
AddActionGroup(m_addSelectedEntitiesAction->GetActionGroupId());
|
||||
AddMenuAction(m_addSelectedEntitiesAction);
|
||||
|
||||
AddNodePaletteMenuAction(paletteConfig);
|
||||
}
|
||||
|
||||
@@ -905,8 +846,6 @@ namespace ScriptCanvasEditor
|
||||
m_graphCanvasConstructGroups.SetCommentsEnabled(false);
|
||||
m_nodeGroupPresets.SetEnabled(false);
|
||||
m_alignmentActionsGroups.SetEnabled(false);
|
||||
|
||||
m_addSelectedEntitiesAction->setEnabled(false);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
@@ -32,22 +32,6 @@ namespace ScriptCanvasEditor
|
||||
// CustomActions
|
||||
//////////////////
|
||||
|
||||
class AddSelectedEntitiesAction
|
||||
: public GraphCanvas::ContextMenuAction
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(AddSelectedEntitiesAction, AZ::SystemAllocator, 0);
|
||||
|
||||
AddSelectedEntitiesAction(QObject* parent);
|
||||
virtual ~AddSelectedEntitiesAction() = default;
|
||||
|
||||
GraphCanvas::ActionGroupId GetActionGroupId() const override;
|
||||
|
||||
void RefreshAction(const GraphCanvas::GraphId& graphCanvasGraphId, const AZ::EntityId& targetId) override;
|
||||
SceneReaction TriggerAction(const GraphCanvas::GraphId& graphCanvasGraphId, const AZ::Vector2& scenePos) override;
|
||||
};
|
||||
|
||||
class EndpointSelectionAction
|
||||
: public QAction
|
||||
{
|
||||
@@ -217,8 +201,6 @@ namespace ScriptCanvasEditor
|
||||
protected:
|
||||
|
||||
AZ::EntityId m_sourceSlotId;
|
||||
|
||||
AddSelectedEntitiesAction* m_addSelectedEntitiesAction;
|
||||
};
|
||||
|
||||
class ConnectionContextMenu
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <ScriptCanvas/Libraries/Core/UnaryOperator.h>
|
||||
#include <ScriptCanvas/Libraries/Core/BinaryOperator.h>
|
||||
#include <ScriptCanvas/Libraries/Core/EBusEventHandler.h>
|
||||
#include <ScriptCanvas/Libraries/Core/ErrorHandler.h>
|
||||
#include <ScriptCanvas/Libraries/Core/FunctionDefinitionNode.h>
|
||||
#include <ScriptCanvas/Libraries/Core/Method.h>
|
||||
#include <ScriptCanvas/Libraries/Core/Start.h>
|
||||
@@ -95,7 +94,6 @@ namespace ScriptCanvas
|
||||
|
||||
void Graph::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
Data::PropertyMetadata::Reflect(context);
|
||||
Data::Type::Reflect(context);
|
||||
Nodes::UnaryOperator::Reflect(context);
|
||||
Nodes::UnaryExpression::Reflect(context);
|
||||
|
||||
@@ -29,8 +29,7 @@ namespace ScriptCanvas
|
||||
|
||||
friend class Node;
|
||||
friend class GraphVariable;
|
||||
friend class PureData;
|
||||
|
||||
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(ModifiableDatumView, AZ::SystemAllocator, 0);
|
||||
|
||||
|
||||
@@ -316,9 +316,6 @@ namespace ScriptCanvas
|
||||
#define SCRIPT_CANVAS_GENERICS_TO_VM(GenericClass, ReflectClass, BehaviorContext, CategoryName)\
|
||||
GenericClass::Reflect<ReflectClass>(BehaviorContext, ScriptCanvas::Translation::Context::GetCategoryLibraryName(CategoryName).c_str());
|
||||
|
||||
#define SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(GenericClass, BehaviorContext, CategoryName)\
|
||||
GenericClass::Reflect(BehaviorContext, ScriptCanvas::Translation::Context::GetCategoryLibraryName(CategoryName).c_str());
|
||||
|
||||
template<typename... t_Node>
|
||||
class RegistrarGeneric
|
||||
{
|
||||
@@ -335,13 +332,6 @@ namespace ScriptCanvas
|
||||
SCRIPT_CANVAS_CALL_ON_INDEX_SEQUENCE(nodes.push_back({ azrtti_typeid<t_Node>(), AZ::AzTypeInfo<t_Node>::Name() }));
|
||||
}
|
||||
|
||||
static void Reflect(AZ::BehaviorContext* behaviorContext, const char* libraryName)
|
||||
{
|
||||
auto reflection = behaviorContext->Class<RegistrarGeneric<t_Node...>>(libraryName);
|
||||
reflection->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent)->Attribute(AZ::ScriptCanvasAttributes::Internal::ImplementedAsNodeGeneric, true);
|
||||
SCRIPT_CANVAS_CALL_ON_INDEX_SEQUENCE(reflection->Method(t_Node::GetNodeFunctionName(), t_Node::GetFunction())->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List | AZ::Script::Attributes::ExcludeFlags::Documentation));
|
||||
}
|
||||
|
||||
template<typename t_Library>
|
||||
static void Reflect(AZ::BehaviorContext* behaviorContext, const char* libraryName)
|
||||
{
|
||||
|
||||
@@ -99,8 +99,6 @@ namespace ScriptCanvas
|
||||
void Core::InitNodeRegistry(NodeRegistry& nodeRegistry)
|
||||
{
|
||||
using namespace ScriptCanvas::Nodes::Core;
|
||||
AddNodeToRegistry<Core, Error>(nodeRegistry);
|
||||
AddNodeToRegistry<Core, ErrorHandler>(nodeRegistry);
|
||||
AddNodeToRegistry<Core, Method>(nodeRegistry);
|
||||
AddNodeToRegistry<Core, MethodOverloaded>(nodeRegistry);
|
||||
AddNodeToRegistry<Core, Start>(nodeRegistry);
|
||||
@@ -122,8 +120,6 @@ namespace ScriptCanvas
|
||||
AZStd::vector<AZ::ComponentDescriptor*> Core::GetComponentDescriptors()
|
||||
{
|
||||
return AZStd::vector<AZ::ComponentDescriptor*>({
|
||||
ScriptCanvas::Nodes::Core::Error::CreateDescriptor(),
|
||||
ScriptCanvas::Nodes::Core::ErrorHandler::CreateDescriptor(),
|
||||
ScriptCanvas::Nodes::Core::Method::CreateDescriptor(),
|
||||
ScriptCanvas::Nodes::Core::MethodOverloaded::CreateDescriptor(),
|
||||
ScriptCanvas::Nodes::Core::Start::CreateDescriptor(),
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
// shared code
|
||||
|
||||
#include "EBusEventHandler.h"
|
||||
#include "Error.h"
|
||||
#include "ErrorHandler.h"
|
||||
#include "ExtractProperty.h"
|
||||
#include "FunctionDefinitionNode.h"
|
||||
#include "ForEach.h"
|
||||
|
||||
@@ -1,84 +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 "Error.h"
|
||||
|
||||
#include <ScriptCanvas/Core/Graph.h>
|
||||
#include <ScriptCanvas/Core/Contracts/ContractRTTI.h>
|
||||
#include <ScriptCanvas/Core/Contracts/ConnectionLimitContract.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Nodes
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
void Error::OnInit()
|
||||
{
|
||||
{
|
||||
ExecutionSlotConfiguration slotConfiguration("In", ConnectionType::Input);
|
||||
AddSlot(slotConfiguration);
|
||||
}
|
||||
|
||||
{
|
||||
DynamicDataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = "This";
|
||||
slotConfiguration.m_dynamicDataType = DynamicDataType::Any;
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Output);
|
||||
|
||||
AddSlot(slotConfiguration); // \todo for testing only, we need to ability to arbitrarily connect nodes themeselve to slots (as input to function call or error handling) or directly (as the flow of execution with arrows if easier to read...)
|
||||
}
|
||||
|
||||
{
|
||||
DataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = "Description";
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Input);
|
||||
slotConfiguration.ConfigureDatum(AZStd::move(Datum(AZStd::move(Data::Type::String()), Datum::eOriginality::Copy)));
|
||||
|
||||
AddSlot(slotConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
void Error::OnInputSignal(const SlotId&)
|
||||
{
|
||||
const Datum* input = FindDatum(GetSlotId("Description"));
|
||||
if (const Data::StringType* desc = input ? input->GetAs<Data::StringType>() : nullptr)
|
||||
{
|
||||
SCRIPTCANVAS_REPORT_ERROR((*this), desc->data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// \todo get a more descriptive default error report
|
||||
SCRIPTCANVAS_REPORT_ERROR((*this), "Undescribed error");
|
||||
}
|
||||
}
|
||||
|
||||
void Error::Reflect(AZ::ReflectContext* reflectContext)
|
||||
{
|
||||
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflectContext))
|
||||
{
|
||||
serializeContext->Class<Error, Node>()
|
||||
->Version(0)
|
||||
;
|
||||
|
||||
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<Error>("Error", "")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::Category, "Utilities/Debug")
|
||||
->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Error.png")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +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 <ScriptCanvas/Core/Node.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Nodes
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
class Error
|
||||
: public Node
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(Error, "{C6928F30-87BA-4FFE-A3C0-B6096C161DD0}", Node);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* reflection);
|
||||
|
||||
bool IsDeprecated() const override { return true; }
|
||||
|
||||
protected:
|
||||
void OnInit() override;
|
||||
void OnInputSignal(const SlotId&) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +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 "ErrorHandler.h"
|
||||
|
||||
#include <ScriptCanvas/Core/Contracts/ConnectionLimitContract.h>
|
||||
#include <ScriptCanvas/Core/Contracts/ContractRTTI.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Nodes
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
const char* ErrorHandler::k_sourceName = "Source";
|
||||
|
||||
void ErrorHandler::OnInit()
|
||||
{
|
||||
{
|
||||
ExecutionSlotConfiguration slotConfiguration("Out", ConnectionType::Output);
|
||||
AddSlot(slotConfiguration);
|
||||
}
|
||||
|
||||
{
|
||||
DynamicDataSlotConfiguration slotConfiguration;
|
||||
|
||||
slotConfiguration.m_name = k_sourceName;
|
||||
slotConfiguration.SetConnectionType(ConnectionType::Input);
|
||||
|
||||
slotConfiguration.m_dynamicDataType = DynamicDataType::Any;
|
||||
|
||||
// \todo split node abstractions into executable and !executable
|
||||
AZStd::vector<AZ::Uuid> forbiddenTypes{ azrtti_typeid<PureData>() };
|
||||
auto func = [forbiddenTypes]() { return aznew ContractRTTI(forbiddenTypes, ContractRTTI::Flags::Exclusive); };
|
||||
ContractDescriptor descriptor{ AZStd::move(func) };
|
||||
|
||||
slotConfiguration.m_contractDescs.emplace_back(descriptor);
|
||||
|
||||
AddSlot(slotConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::pair<Node*, const SlotId>> ErrorHandler::GetSources() const
|
||||
{
|
||||
return ModConnectedNodes(*GetSlot(GetSlotId(k_sourceName)));
|
||||
}
|
||||
|
||||
void ErrorHandler::Reflect(AZ::ReflectContext* reflectContext)
|
||||
{
|
||||
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflectContext))
|
||||
{
|
||||
serializeContext->Class<ErrorHandler, Node>()
|
||||
->Version(0)
|
||||
;
|
||||
|
||||
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<ErrorHandler>("Error Handler", "")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::Category, "Utilities/Debug")
|
||||
->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ErrorHandler.png")
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +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 <ScriptCanvas/Core/Node.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Nodes
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
class ErrorHandler
|
||||
: public Node
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(ErrorHandler, "{CF23B5A6-827C-4364-9714-EA99612D6CAE}", Node);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* reflection);
|
||||
|
||||
AZStd::vector<AZStd::pair<Node*, const SlotId>> GetSources() const;
|
||||
|
||||
bool IsDeprecated() const override { return true; }
|
||||
|
||||
protected:
|
||||
static const char* k_sourceName;
|
||||
void OnInit() override;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace ScriptCanvas
|
||||
}
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(reflection))
|
||||
{
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(EntityNodes::Registrar, behaviorContext, EntityNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(EntityNodes::Registrar, Entity, behaviorContext, EntityNodes::k_categoryName);
|
||||
}
|
||||
|
||||
ScriptCanvas::Entity::RotateMethod::Reflect(reflection);
|
||||
|
||||
@@ -12,6 +12,21 @@
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
|
||||
#define REFLECT_MATH_LIBRARY_TYPE(MathType, Guid)\
|
||||
struct MathType\
|
||||
{\
|
||||
AZ_TYPE_INFO(MathType, Guid);\
|
||||
static void Reflect(AZ::ReflectContext* reflection)\
|
||||
{\
|
||||
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection))\
|
||||
{\
|
||||
serializeContext->Class<MathType>()\
|
||||
->Version(0)\
|
||||
;\
|
||||
}\
|
||||
}\
|
||||
};
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
class ReflectContext;
|
||||
|
||||
@@ -13,6 +13,26 @@
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Nodes
|
||||
{
|
||||
namespace Math
|
||||
{
|
||||
REFLECT_MATH_LIBRARY_TYPE(AABB, "{AB0C2753-680E-47AD-8277-66B3AC01C659}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Color, "{6CC7B2F9-F551-4CB8-A713-4149959AE337}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(CRC, "{D8B65A5B-38FF-4B41-9FA4-FCA080D75625}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Matrix3x3, "{8C5F6959-C2C4-46D9-9FCD-4DC234E7732D}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Matrix4x4, "{537AB179-E23C-492D-8EF7-53845A2DB163}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(OBB, "{8CBDA3B7-9DCD-4A04-A12C-123C322CA63A}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Plane, "{F2C799DF-2CC1-4DD8-91DC-18C2D517BAB0}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Quaternion, "{9BE75E2E-AA07-4767-9BF3-905C289EB38A}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Random, "{D9DF1385-6C5C-4E41-94CA-8B10E9D8FAAF}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Transform, "{59E0EF87-352C-4CFB-A810-5B8752BDD1EF}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Vector2, "{FD1BFADF-BA1F-4AFC-819B-ABA1F22AE6E6}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Vector3, "{53EA7604-E3AE-4E88-BE0E-66CBC488A7DB}");
|
||||
REFLECT_MATH_LIBRARY_TYPE(Vector4, "{66027D7A-FCD1-4592-93E5-EB4B7F4BD671}");
|
||||
}
|
||||
}
|
||||
|
||||
namespace Library
|
||||
{
|
||||
void Math::Reflect(AZ::ReflectContext* reflection)
|
||||
@@ -37,22 +57,20 @@ namespace ScriptCanvas
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(reflection))
|
||||
{
|
||||
using namespace ScriptCanvas::Nodes::Math;
|
||||
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(AABBNodes::Registrar, AABB, behaviorContext, AABBNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(ColorNodes::Registrar, Color, behaviorContext, ColorNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(CRCNodes::Registrar, CRC, behaviorContext, CRCNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(MathNodes::Registrar, Math, behaviorContext, MathNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(Matrix3x3Nodes::Registrar, Matrix3x3, behaviorContext, Matrix3x3Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(Matrix4x4Nodes::Registrar, Matrix4x4, behaviorContext, Matrix4x4Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(OBBNodes::Registrar, OBB, behaviorContext, OBBNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(PlaneNodes::Registrar, Plane, behaviorContext, PlaneNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(QuaternionNodes::Registrar, Quaternion, behaviorContext, QuaternionNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(RandomNodes::Registrar, Random, behaviorContext, RandomNodes::k_categoryName);
|
||||
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(AABBNodes::Registrar, behaviorContext, AABBNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(CRCNodes::Registrar, behaviorContext, CRCNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(ColorNodes::Registrar, behaviorContext, ColorNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Matrix3x3Nodes::Registrar, behaviorContext, Matrix3x3Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Matrix4x4Nodes::Registrar, behaviorContext, Matrix4x4Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(OBBNodes::Registrar, behaviorContext, OBBNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(PlaneNodes::Registrar, behaviorContext, PlaneNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(QuaternionNodes::Registrar, behaviorContext, QuaternionNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(TransformNodes::Registrar, behaviorContext, TransformNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector2Nodes::Registrar, behaviorContext, Vector2Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector3Nodes::Registrar, behaviorContext, Vector3Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM_LIBRARY_ONLY(Vector4Nodes::Registrar, behaviorContext, Vector4Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(TransformNodes::Registrar, Transform, behaviorContext, TransformNodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(Vector2Nodes::Registrar, Vector2, behaviorContext, Vector2Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(Vector3Nodes::Registrar, Vector3, behaviorContext, Vector3Nodes::k_categoryName);
|
||||
SCRIPT_CANVAS_GENERICS_TO_VM(Vector4Nodes::Registrar, Vector4, behaviorContext, Vector4Nodes::k_categoryName);
|
||||
}
|
||||
|
||||
Nodes::Internal::ExpressionNodeBase::Reflect(reflection);
|
||||
|
||||
@@ -258,10 +258,6 @@ set(FILES
|
||||
Include/ScriptCanvas/Libraries/Core/ExtractProperty.ScriptCanvasGrammar.xml
|
||||
Include/ScriptCanvas/Libraries/Core/EventHandlerTranslationUtility.h
|
||||
Include/ScriptCanvas/Libraries/Core/EventHandlerTranslationUtility.cpp
|
||||
Include/ScriptCanvas/Libraries/Core/Error.cpp
|
||||
Include/ScriptCanvas/Libraries/Core/Error.h
|
||||
Include/ScriptCanvas/Libraries/Core/ErrorHandler.cpp
|
||||
Include/ScriptCanvas/Libraries/Core/ErrorHandler.h
|
||||
Include/ScriptCanvas/Libraries/Core/ForEach.cpp
|
||||
Include/ScriptCanvas/Libraries/Core/ForEach.h
|
||||
Include/ScriptCanvas/Libraries/Core/ForEach.ScriptCanvasGrammar.xml
|
||||
|
||||
Reference in New Issue
Block a user