Open 3D Engine ScriptCanvas Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ScriptCanvas::Graph Class Reference

Graph is the execution model of a ScriptCanvas graph. More...

#include <Graph.h>

Inherits AZ::Component, GraphRequestBus::Handler, StatusRequestBus::Handler, AZ::EntityBus::Handler, and ValidationRequestBus::Handler.

Inherited by ScriptCanvasEditor::EditorGraph.

Public Member Functions

 AZ_COMPONENT (Graph, "{C3267D77-EEDC-490E-9E42-F1D1F473E184}")
 
 Graph (const ScriptCanvasId &executionId=AZ::Entity::MakeId())
 
void Init () override
 
void Activate () override
 
void Deactivate () override
 
const AZStd::vector< AZ::EntityId > GetNodesConst () const
 
AZStd::unordered_set< AZ::Entity * > & GetNodeEntities ()
 
const AZStd::unordered_set< AZ::Entity * > & GetNodeEntities () const
 
const ScriptCanvas::ScriptCanvasId & GetScriptCanvasId () const
 
void MarkVersion ()
 
const VersionDataGetVersion () const
 
bool HasDeprecatedNode () const
 
void Parse (ValidationResults &validationResults)
 
bool AddNode (const AZ::EntityId &) override
 
bool RemoveNode (const AZ::EntityId &nodeId) override
 
NodeFindNode (AZ::EntityId nodeID) const override
 
AZStd::vector< AZ::EntityId > GetNodes () const override
 
SlotFindSlot (const Endpoint &endpoint) const override
 
bool AddConnection (const AZ::EntityId &) override
 
void RemoveAllConnections ()
 
bool RemoveConnection (const AZ::EntityId &connectionId) override
 
AZStd::vector< AZ::EntityId > GetConnections () const override
 
AZStd::vector< EndpointGetConnectedEndpoints (const Endpoint &firstEndpoint) const override
 
AZStd::pair< EndpointMapConstIterator, EndpointMapConstIterator > GetConnectedEndpointIterators (const Endpoint &endpoint) const override
 
bool IsEndpointConnected (const Endpoint &endpoint) const override
 
bool FindConnection (AZ::Entity *&connectionEntity, const Endpoint &firstEndpoint, const Endpoint &otherEndpoint) const override
 
bool FindConnection (const Endpoint &firstEndpoint, const Endpoint &otherEndpoint) const
 
bool Connect (const AZ::EntityId &sourceNodeId, const SlotId &sourceSlotId, const AZ::EntityId &targetNodeId, const SlotId &targetSlotId) override
 
bool Disconnect (const AZ::EntityId &sourceNodeId, const SlotId &sourceSlotId, const AZ::EntityId &targetNodeId, const SlotId &targetSlotId) override
 
bool ConnectByEndpoint (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint) override
 
AZ::Outcome< void, AZStd::string > CanCreateConnectionBetween (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint) const override
 
AZ::Outcome< void, AZStd::string > CanConnectionExistBetween (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint) const override
 
bool DisconnectByEndpoint (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint) override
 
bool DisconnectById (const AZ::EntityId &connectionId) override
 
bool AddDependentAsset (AZ::EntityId nodeId, const AZ::TypeId assetType, const AZ::Data::AssetId assetId) override
 
bool RemoveDependentAsset (AZ::EntityId nodeId) override
 
AZ::Entity * GetGraphEntity () const override
 
GraphGetGraph () override
 
GraphDataGetGraphData () override
 
const GraphDataGetGraphDataConst () const override
 
VariableDataGetVariableData () override
 
const VariableDataGetVariableDataConst () const override
 
bool AddGraphData (const GraphData &) override
 
void RemoveGraphData (const GraphData &) override
 
bool IsBatchAddingGraphData () const override
 
AZStd::unordered_set< AZ::Entity * > CopyItems (const AZStd::unordered_set< AZ::Entity * > &entities) override
 
void AddItems (const AZStd::unordered_set< AZ::Entity * > &graphField) override
 
void RemoveItems (const AZStd::unordered_set< AZ::Entity * > &graphField) override
 
void RemoveItems (const AZStd::vector< AZ::Entity * > &graphField)
 
AZStd::unordered_set< AZ::Entity * > GetItems () const override
 
bool AddItem (AZ::Entity *itemRef) override
 
bool RemoveItem (AZ::Entity *itemRef) override
 
void ValidateGraph (ValidationResults &validationEvents) override
 
void ReportValidationResults (ValidationResults &) override
 
AZStd::pair< ScriptCanvas::ScriptCanvasId, ValidationResultsGetValidationResults () override
 
virtual void ReportError (const Node &node, const AZStd::string &errorSource, const AZStd::string &errorMessage)
 
template<typename NodeType >
AZStd::vector< const NodeType * > GetNodesOfType () const
 
void MarkOwnership (ScriptCanvas::ScriptCanvasData &owner)
 
ScriptCanvas::DataPtr GetOwnership () const
 
void ClearScriptEventExtension ()
 
bool IsScriptEventExtension () const
 
void MarkScriptEventExtension ()
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Public Attributes

friend Node
 

Protected Member Functions

void PostActivate ()
 
void ValidateVariables (ValidationResults &validationResults)
 
void ValidateScriptEvents (ValidationResults &validationResults)
 
bool ValidateConnectionEndpoints (const AZ::EntityId &connectionRef, const AZStd::unordered_set< AZ::EntityId > &nodeRefs)
 
AZ::Outcome< void, AZStd::vector< ValidationStruct > > ValidateNode (AZ::Entity *nodeEntity, ValidationResults &validationEvents) const
 
AZ::Outcome< void, ValidationStruct > ValidateConnection (AZ::Entity *connection) const
 
bool IsInDataFlowPath (const Node *sourceNode, const Node *targetNode) const
 
void RefreshConnectionValidity (bool warnOnRemoval=false)
 
AZ::Data::AssetId GetAssetId () const override
 
GraphIdentifier GetGraphIdentifier () const override
 
AZStd::string GetAssetName () const override
 
AZ::EntityId GetRuntimeEntityId () const override
 
VariableId FindAssetVariableIdByRuntimeVariableId (VariableId runtimeId) const override
 
AZ::EntityId FindAssetNodeIdByRuntimeNodeId (AZ::EntityId editorNode) const override
 
AZ::EntityId FindRuntimeNodeIdByAssetNodeId (AZ::EntityId runtimeNode) const override
 
void RefreshVariableReferences (const VariableId &) override
 
const GraphVariableMapping * GetVariables () const override
 
GraphVariableFindVariable (AZStd::string_view propName) override
 
GraphVariableFindVariableById (const VariableId &variableId) override
 
Data::Type GetVariableType (const VariableId &variableId) const
 
AZStd::string_view GetVariableName (const VariableId &variableId) const
 
bool IsGraphObserved () const override
 
void SetIsGraphObserved (bool isObserved) override
 
const AZStd::unordered_map< AZ::EntityId, Node * > & GetNodeMapping () const
 
void VersioningRemoveSlot (ScriptCanvas::Node &scriptCanvasNode, const SlotId &slotId)
 

Static Protected Member Functions

static void GetDependentServices (AZ::ComponentDescriptor::DependencyArrayType &dependent)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 

Protected Attributes

GraphData m_graphData
 
AZ::Data::AssetType m_assetType
 
ScriptCanvas::ScriptCanvasDatam_owner
 

Detailed Description

Graph is the execution model of a ScriptCanvas graph.

Member Function Documentation

◆ GetGraphEntity()

AZ::Entity * ScriptCanvas::Graph::GetGraphEntity ( ) const
inlineoverride

Retrieves the Entity this Graph component is currently located on NOTE: There can be multiple Graph components on the same entity so calling FindComponent may not not return this GraphComponent


The documentation for this class was generated from the following file: