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.
ScriptCanvasEditor::EditorGraph Class Reference

EditorGraph is the editor version of the ScriptCanvas::Graph component that is activated when executing the script canvas engine. More...

#include <EditorGraph.h>

Inherits ScriptCanvas::Graph, NodeCreationNotificationBus::Handler, SceneCounterRequestBus::Handler, EditorGraphRequestBus::Handler, GraphCanvas::GraphModelRequestBus::Handler, GraphCanvas::SceneNotificationBus::Handler, GraphItemCommandNotificationBus::Handler, AzToolsFramework::ToastNotificationBus::MultiHandler, GeneralEditorNotificationBus::Handler, and AZ::SystemTickBus::Handler.

Classes

struct  LiveSlotInfo
 
struct  ReplacementInfo
 

Public Types

enum  UpgradeRequest { IfOutOfDate , Forced }
 

Public Member Functions

 AZ_COMPONENT (EditorGraph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph)
 
 EditorGraph (const ScriptCanvas::ScriptCanvasId &scriptCanvasId=AZ::Entity::MakeId())
 
void Activate () override
 
void Deactivate () override
 
AZ::u32 GetNewVariableCounter () override
 
void ReleaseVariableCounter (AZ::u32 variableCounter) override
 
void RequestUndoPoint () override
 
void RequestPushPreventUndoStateUpdate () override
 
void RequestPopPreventUndoStateUpdate () override
 
void TriggerUndo () override
 
void TriggerRedo () override
 
void EnableNodes (const AZStd::unordered_set< GraphCanvas::NodeId > &nodeIds) override
 
void DisableNodes (const AZStd::unordered_set< GraphCanvas::NodeId > &nodeIds) override
 
GraphCanvas::NodePropertyDisplay * CreateDataSlotPropertyDisplay (const AZ::Uuid &dataType, const AZ::EntityId &nodeId, const AZ::EntityId &slotId) const override
 
GraphCanvas::NodePropertyDisplay * CreatePropertySlotPropertyDisplay (const AZ::Crc32 &propertyId, const AZ::EntityId &nodeId, const AZ::EntityId &slotId) const override
 
void DisconnectConnection (const GraphCanvas::ConnectionId &connectionId) override
 
bool CreateConnection (const GraphCanvas::ConnectionId &connectionId, const GraphCanvas::Endpoint &sourcePoint, const GraphCanvas::Endpoint &targetPoint) override
 
void UpdateCorrespondingImplicitConnection (const ScriptCanvas::Endpoint &sourceEndpoint, const ScriptCanvas::Endpoint &targetEndpoint)
 
bool IsValidConnection (const GraphCanvas::Endpoint &sourcePoint, const GraphCanvas::Endpoint &targetPoint) const override
 
AZStd::string GetDataTypeString (const AZ::Uuid &typeId) override
 
void OnRemoveUnusedNodes () override
 
void OnRemoveUnusedElements () override
 
bool AllowReset (const GraphCanvas::Endpoint &endpoint) const override
 
void ResetSlotToDefaultValue (const GraphCanvas::Endpoint &endpoint) override
 
void ResetReference (const GraphCanvas::Endpoint &endpoint) override
 
void ResetProperty (const GraphCanvas::NodeId &nodeId, const AZ::Crc32 &propertyId) override
 
void RemoveSlot (const GraphCanvas::Endpoint &endpoint) override
 
bool IsSlotRemovable (const GraphCanvas::Endpoint &endpoint) const override
 
bool ConvertSlotToReference (const GraphCanvas::Endpoint &endpoint, bool isNewSlot=false) override
 
bool CanConvertSlotToReference (const GraphCanvas::Endpoint &endpoint, bool isNewSlot=false) override
 
GraphCanvas::CanHandleMimeEventOutcome CanHandleReferenceMimeEvent (const GraphCanvas::Endpoint &endpoint, const QMimeData *mimeData) override
 
bool HandleReferenceMimeEvent (const GraphCanvas::Endpoint &endpoint, const QMimeData *mimeData) override
 
bool CanPromoteToVariable (const GraphCanvas::Endpoint &endpoint, bool isNewSlot=false) const override
 
bool PromoteToVariableAction (const GraphCanvas::Endpoint &endpoint, bool isNewSlot=false) override
 
bool SynchronizeReferences (const GraphCanvas::Endpoint &sourceEndpoint, const GraphCanvas::Endpoint &targetEndpoint) override
 
bool ConvertSlotToValue (const GraphCanvas::Endpoint &endpoint) override
 
bool CanConvertSlotToValue (const GraphCanvas::Endpoint &endpoint) override
 
GraphCanvas::CanHandleMimeEventOutcome CanHandleValueMimeEvent (const GraphCanvas::Endpoint &endpoint, const QMimeData *mimeData) override
 
bool HandleValueMimeEvent (const GraphCanvas::Endpoint &endpoint, const QMimeData *mimeData) override
 
GraphCanvas::SlotId RequestExtension (const GraphCanvas::NodeId &nodeId, const GraphCanvas::ExtenderId &extenderId, GraphModelRequests::ExtensionRequestReason) override
 
void ExtensionCancelled (const GraphCanvas::NodeId &nodeId, const GraphCanvas::ExtenderId &extenderId) override
 
void FinalizeExtension (const GraphCanvas::NodeId &nodeId, const GraphCanvas::ExtenderId &extenderId) override
 
bool ShouldWrapperAcceptDrop (const GraphCanvas::NodeId &wrapperNode, const QMimeData *mimeData) const override
 
void AddWrapperDropTarget (const GraphCanvas::NodeId &wrapperNode) override
 
void RemoveWrapperDropTarget (const GraphCanvas::NodeId &wrapperNode) override
 
void OnEntitiesSerialized (GraphCanvas::GraphSerialization &serializationTarget) override
 
void OnEntitiesDeserialized (const GraphCanvas::GraphSerialization &serializationSource) override
 
void OnPreNodeDeleted (const AZ::EntityId &nodeId) override
 
void OnPreConnectionDeleted (const AZ::EntityId &nodeId) override
 
void OnUnknownPaste (const QPointF &scenePos) override
 
void OnSelectionChanged () override
 
void PostDeletionEvent () override
 
void PostCreationEvent () override
 
void OnPasteBegin () override
 
void OnPasteEnd () override
 
void OnViewRegistered () override
 
void OnGraphCanvasNodeCreated (const AZ::EntityId &nodeId) override
 NodeCreationNotifications.
 
void CreateGraphCanvasScene () override
 
void ClearGraphCanvasScene () override
 
void DisplayGraphCanvasScene () override
 
bool UpgradeGraph (SourceHandle source, UpgradeRequest upgradeRequest, const UpgradeGraphConfig &upgradeConfig)
 
void ConnectGraphCanvasBuses ()
 
void DisconnectGraphCanvasBuses ()
 
void OnSystemTick () override
 
void OnGraphCanvasSceneVisible () override
 
GraphCanvas::GraphId GetGraphCanvasGraphId () const override
 
AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer * > GetGraphCanvasSaveData () override
 
void UpdateGraphCanvasSaveData (const AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer * > &saveData) override
 
NodeIdPair CreateCustomNode (const AZ::Uuid &typeId, const AZ::Vector2 &position) override
 
void AddCrcCache (const AZ::Crc32 &crcValue, const AZStd::string &cacheString) override
 
void RemoveCrcCache (const AZ::Crc32 &crcValue) override
 
AZStd::string DecodeCrc (const AZ::Crc32 &crcValue) override
 
void ClearHighlights () override
 
void HighlightMembersFromTreeItem (const GraphCanvas::GraphCanvasTreeItem *treeItem) override
 
void HighlightVariables (const AZStd::unordered_set< ScriptCanvas::VariableId > &variableIds) override
 
void HighlightNodes (const AZStd::vector< NodeIdPair > &nodes) override
 
AZStd::vector< NodeIdPairGetNodesOfType (const ScriptCanvas::NodeTypeIdentifier &) override
 
AZStd::vector< NodeIdPairGetVariableNodes (const ScriptCanvas::VariableId &) override
 
void RemoveUnusedVariables () override
 
bool CanConvertVariableNodeToReference (const GraphCanvas::NodeId &nodeId) override
 
bool ConvertVariableNodeToReference (const GraphCanvas::NodeId &nodeId) override
 
bool ConvertReferenceToVariableNode (const GraphCanvas::Endpoint &endpoint) override
 
void QueueVersionUpdate (const AZ::EntityId &graphCanvasNodeId) override
 
bool CanExposeEndpoint (const GraphCanvas::Endpoint &endpoint) override
 
ScriptCanvas::Endpoint ConvertToScriptCanvasEndpoint (const GraphCanvas::Endpoint &endpoint) const override
 
GraphCanvas::Endpoint ConvertToGraphCanvasEndpoint (const ScriptCanvas::Endpoint &endpoint) const override
 
bool OnVersionConversionBegin (ScriptCanvas::Node &node)
 
void OnVersionConversionEnd (ScriptCanvas::Node &node)
 
void OnSaveDataDirtied (const AZ::EntityId &savedElement) override
 
bool NeedsSaveConversion () const
 
void ConvertSaveFormat ()
 
void ConstructSaveData ()
 
void OnToastInteraction () override
 
void OnToastDismissed () override
 
void OnUndoRedoEnd () override
 
void ReportError (const ScriptCanvas::Node &node, const AZStd::string &errorSource, const AZStd::string &errorMessage) override
 
const GraphStatisticsHelperGetNodeUsageStatistics () const
 
- Public Member Functions inherited from ScriptCanvas::Graph
 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 ScriptCanvas::DataPtr Create ()
 
static void Reflect (AZ::ReflectContext *context)
 
static const char * GetMimeType ()
 
static const char * GetWrappedNodeGroupingMimeType ()
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetRequiredServices (AZ::ComponentDescriptor::DependencyArrayType &required)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
- Static Public Member Functions inherited from ScriptCanvas::Graph
static void Reflect (AZ::ReflectContext *context)
 

Public Attributes

EditorGraphUpgradeMachine m_upgradeSM
 
- Public Attributes inherited from ScriptCanvas::Graph
friend Node
 

Protected Types

enum class  FixConnections { No , Yes }
 
using LiveSlotStates = AZStd::vector< LiveSlotInfo >
 
using ReplacementInfoByNode = AZStd::unordered_map< AZ::EntityId, ReplacementInfo >
 
using NodesById = AZStd::unordered_map< AZ::EntityId, ScriptCanvas::Node * >
 

Protected Member Functions

void PostRestore (const UndoData &restoredData) override
 
void UnregisterToast (const AzToolsFramework::ToastId &toastId)
 
 EditorGraph (const EditorGraph &)=delete
 
void DisplayUpdateToast ()
 
AZ::EntityId ConvertToScriptCanvasNodeId (const GraphCanvas::NodeId &nodeId) const
 
GraphCanvas::NodePropertyDisplay * CreateDisplayPropertyForSlot (const AZ::EntityId &scriptCanvasNodeId, const ScriptCanvas::SlotId &scriptCanvasSlotId) const
 
void SignalDirty ()
 
void HighlightNodesByType (const ScriptCanvas::NodeTypeIdentifier &nodeTypeIdentifier)
 
void HighlightEBusNodes (const ScriptCanvas::EBusBusId &busId, const ScriptCanvas::EBusEventId &eventId)
 
void HighlightScriptEventNodes (const ScriptCanvas::EBusBusId &busId, const ScriptCanvas::EBusEventId &eventId)
 
void HighlightScriptCanvasEntity (const AZ::EntityId &scriptCanvasId)
 
AZ::EntityId FindGraphCanvasSlotId (const AZ::EntityId &graphCanvasNodeId, const ScriptCanvas::SlotId &slotId)
 
bool ConfigureConnectionUserData (const ScriptCanvas::Endpoint &sourceEndpoint, const ScriptCanvas::Endpoint &targetEndpoint, GraphCanvas::ConnectionId connectionId)
 
void HandleQueuedUpdates ()
 
bool IsNodeVersionConverting (const AZ::EntityId &graphCanvasNodeId) const
 
void HandleFunctionDefinitionExtension (ScriptCanvas::Node *node, GraphCanvas::SlotId graphCanvasSlotId, const GraphCanvas::NodeId &nodeId)
 
AZ::Outcome< LiveSlotInfo, AZStd::string > ConvertToLiveStateInfo (const ScriptCanvas::Node &node, const ScriptCanvas::Slot &slot) const
 
AZ::Outcome< ScriptCanvas::Node *, AZStd::string > ReplaceLiveNode (ScriptCanvas::Node &, ScriptCanvas::NodeReplacementConfiguration &)
 
AZ::Outcome< LiveSlotStates, AZStd::string > GetSlotState (const ScriptCanvas::Node &node) const
 
LiveSlotInfoFindMatchingSlotState (ScriptCanvas::Node &node, ScriptCanvas::Slot &slot, LiveSlotStates &slotState) const
 
AZ::Outcome< void, AZStd::string > UpdateSlotConnections (ScriptCanvas::Node &node, ScriptCanvas::Slot &slot, const ScriptCanvas::NodeReplacementConfiguration &nodeConfig, LiveSlotInfo &slotInfo, const ReplacementInfoByNode &ainfoByOldNode)
 
AZ::Outcome< void, AZStd::string > UpdateSlotDatum (ScriptCanvas::Node &node, ScriptCanvas::Slot &slot, LiveSlotInfo &slotInfo)
 
AZ::Outcome< void, AZStd::string > UpdateSlotState (ScriptCanvas::Node &node, ScriptCanvas::Slot &slot, const ScriptCanvas::NodeReplacementConfiguration &nodeConfig, LiveSlotStates &slotState, const ReplacementInfoByNode &infoByOldNode, FixConnections fixConnections)
 
AZ::Outcome< void, AZStd::string > UpdateSlotState (ScriptCanvas::Node &node, const ScriptCanvas::NodeReplacementConfiguration &nodeConfig, LiveSlotStates &slotState, const ReplacementInfoByNode &infoByOldNode, FixConnections fixConnections)
 
void RefreshVariableReferences (const ScriptCanvas::VariableId &variableId) override
 
- Protected Member Functions inherited from ScriptCanvas::Graph
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)
 

Protected Attributes

AZStd::unordered_map< AzToolsFramework::ToastId, AZ::EntityId > m_toastNodeIds
 
bool m_allowVersionUpdate = false
 
AZStd::unordered_set< AZ::EntityId > m_queuedConvertingNodes
 
AZStd::unordered_set< AZ::EntityId > m_convertingNodes
 
AZStd::unordered_multimap< AZ::EntityId, ScriptCanvas::SlotIdm_versionedSlots
 
AZStd::unordered_set< AZStd::string > m_updateStrings
 
AZ::u32 m_variableCounter
 
AZ::EntityId m_wrapperNodeDropTarget
 
VariableComboBoxDataModel m_variableDataModel
 
WrappedNodeGroupingMap m_wrappedNodeGroupings
 
AZStd::vector< AZ::EntityId > m_lastGraphCanvasCreationGroup
 
AZ::Entity * m_graphCanvasSceneEntity
 
GraphCanvas::EntitySaveDataContainer::VersionInformation m_graphCanvasSaveVersion
 
AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer * > m_graphCanvasSaveData
 
AZStd::unordered_map< AZ::Crc32, CRCCache > m_crcCacheMap
 
AZStd::unordered_set< GraphCanvas::GraphicsEffectId > m_highlights
 
GraphCanvas::NodeFocusCyclingHelper m_focusHelper
 
GraphStatisticsHelper m_statisticsHelper
 
UndoHelper m_undoHelper
 
bool m_ignoreSaveRequests
 
bool m_saveFormatConverted = true
 Defaults to true to signal that this graph does not have the GraphCanvas stuff intermingled.
 
SourceHandle m_assetId
 
- Protected Attributes inherited from ScriptCanvas::Graph
GraphData m_graphData
 
AZ::Data::AssetType m_assetType
 
ScriptCanvas::ScriptCanvasDatam_owner
 

Friends

class Start
 
class PreRequisites
 
class PreventUndo
 
class CollectData
 
class ReplaceDeprecatedNodes
 
class RemapConnections
 
class VerifySaveDataVersion
 
class SanityChecks
 
class UpgradeScriptEvents
 
class UpdateOutOfDateNodes
 
class BuildGraphCanvasMapping
 
class FixLeakedData
 
class RestoreUndo
 
class DisplayReport
 
class Finalize
 

Additional Inherited Members

- Static Protected Member Functions inherited from ScriptCanvas::Graph
static void GetDependentServices (AZ::ComponentDescriptor::DependencyArrayType &dependent)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 

Detailed Description

EditorGraph is the editor version of the ScriptCanvas::Graph component that is activated when executing the script canvas engine.

Member Function Documentation

◆ ReportError()

void ScriptCanvasEditor::EditorGraph::ReportError ( const ScriptCanvas::Node node,
const AZStd::string &  errorSource,
const AZStd::string &  errorMessage 
)
overridevirtual

Reimplemented from ScriptCanvas::Graph.


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