MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Load

Method Load

Source/Engine/Visject/Graph.h:162–307  ·  view source on GitHub ↗

Load graph from the stream Input stream True if load all saved metadata True if cannot load data, otherwise false

Source from the content-addressed store, hash-verified

160 /// <param name="loadMeta">True if load all saved metadata</param>
161 /// <returns>True if cannot load data, otherwise false</returns>
162 virtual bool Load(ReadStream* stream, bool loadMeta)
163 {
164 // Clear previous data
165 Clear();
166
167 // Magic Code
168 int32 tmp;
169 stream->ReadInt32(&tmp);
170 if (tmp != 1963542358)
171 {
172 LOG(Warning, "Invalid data.");
173 return true;
174 }
175
176 // Version
177 uint32 version;
178 stream->ReadUint32(&version);
179
180 Array<TmpConnectionHint> tmpHints;
181 if (version < 7000)
182 {
183 LOG(Warning, "Not supported Visject Surface version. Open and re-save asset with Flax 1.11.");
184 return true;
185 }
186 if (version == 7000)
187 {
188 // Nodes count
189 int32 nodesCount;
190 stream->ReadInt32(&nodesCount);
191 Nodes.Resize(nodesCount, false);
192
193 // Parameters count
194 int32 parametersCount;
195 stream->ReadInt32(&parametersCount);
196 Parameters.Resize(parametersCount, false);
197
198 // For each node
199 for (int32 i = 0; i < nodesCount; i++)
200 {
201 auto node = &Nodes[i];
202 stream->ReadUint32(&node->ID);
203 stream->ReadUint32(&node->Type);
204 if (onNodeCreated(node))
205 return true;
206 }
207
208 // For each param
209 for (int32 i = 0; i < parametersCount; i++)
210 {
211 auto param = &Parameters[i];
212 stream->Read(param->Type);
213 stream->Read(param->Identifier);
214 stream->Read(param->Name, 97);
215 param->IsPublic = stream->ReadBool();
216 stream->Read(param->Value);
217 if (param->Meta.Load(stream, loadMeta))
218 return true;
219 if (onParamCreated(param))

Callers 2

DrawTypeMethod · 0.45

Calls 10

RemoveAtKeepOrderMethod · 0.80
ClearFunction · 0.50
ReadInt32Method · 0.45
ResizeMethod · 0.45
ReadMethod · 0.45
ClearMethod · 0.45
ReadByteMethod · 0.45
CountMethod · 0.45
AddMethod · 0.45
TryGetBoxMethod · 0.45

Tested by

no test coverage detected