MCPcopy Create free account
hub / github.com/MrDrElliot/LuminaEngine / PostLoad

Method PostLoad

Engine/Editor/Source/UI/Tools/NodeGraph/EdNodeGraph.cpp:80–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 CEdNodeGraph::~CEdNodeGraph()
79 {
80 }
81
82 bool CEdNodeGraph::GraphSaveSettings(const char* data, size_t size, ax::NodeEditor::SaveReasonFlags Reason, void* userPointer)
83 {
84 CEdNodeGraph* ThisGraph = (CEdNodeGraph*)userPointer;
85
86 if ( Reason == ax::NodeEditor::SaveReasonFlags::None
87 || Reason == ax::NodeEditor::SaveReasonFlags::Navigation
88 || Reason == ax::NodeEditor::SaveReasonFlags::Selection
89 || ThisGraph->bFirstDraw)
90 {
91 return true;
92 }
93
94 // The graph is un-changed.
95 if (ThisGraph->GraphSaveData.size() == size && (size == 0 || Memory::Memcmp(ThisGraph->GraphSaveData.data(), data, size) == 0))
96 {
97 return true;
98 }
99
100 ThisGraph->GraphSaveData.assign(data, size);
101 ThisGraph->GetPackage()->MarkDirty();
102
103 return true;
104 }
105
106 size_t CEdNodeGraph::GraphLoadSettings(char* Data, void* UserPointer)
107 {
108 CEdNodeGraph* ThisGraph = (CEdNodeGraph*)UserPointer;
109 if (Data)
110 {
111 Memory::Memcpy(Data, ThisGraph->GraphSaveData.data(), ThisGraph->GraphSaveData.size());
112 }
113 return ThisGraph->GraphSaveData.size();
114 }
115
116
117 void CEdNodeGraph::Initialize()
118 {
119 ax::NodeEditor::Config Config;
120 Config.EnableSmoothZoom = true;
121 Config.UserPointer = this;
122 Config.SaveSettings = GraphSaveSettings;
123 Config.LoadSettings = GraphLoadSettings;
124 Config.SettingsFile = nullptr;
125 Context = ax::NodeEditor::CreateEditor(&Config);
126 }
127
128 void CEdNodeGraph::Shutdown()
129 {
130 // Otherwise closing the editor you copied from leaves a paste pointing at freed nodes.
131 for (const TObjectPtr<CEdGraphNode>& Node : Nodes)
132 {
133 if (Node.IsValid())
134 {
135 ForgetClipboardNode(Node.Get());
136 }
137 }

Callers 8

CreateNewMethod · 0.45
CompileMaterialGraphFunction · 0.45
DrawToolMenuMethod · 0.45
OnInitializeMethod · 0.45
DrawToolMenuMethod · 0.45
CompileMethod · 0.45
OnInitializeMethod · 0.45
GenerateMaterialsFunction · 0.45

Calls 11

MoveFunction · 0.85
GetSchemaFunction · 0.85
HasConnectionMethod · 0.80
AddConnectionMethod · 0.80
AddNodeFunction · 0.50
clearMethod · 0.45
IsValidMethod · 0.45
GetMethod · 0.45
sizeMethod · 0.45
GetPinMethod · 0.45

Tested by

no test coverage detected