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

Method GetReferences

Source/Engine/Content/Assets/Material.cpp:46–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#if USE_EDITOR
45
46void Material::GetReferences(Array<Guid>& assets, Array<String>& files) const
47{
48 ShaderAssetTypeBase<MaterialBase>::GetReferences(assets, files);
49
50 // Collect references from material graph (needs to load it)
51 if (!WaitForLoaded() && HasChunk(SHADER_FILE_CHUNK_VISJECT_SURFACE))
52 {
53 ScopeLock lock(Locker);
54 if (!LoadChunks(GET_CHUNK_FLAG(SHADER_FILE_CHUNK_VISJECT_SURFACE)))
55 {
56 const auto surfaceChunk = GetChunk(SHADER_FILE_CHUNK_VISJECT_SURFACE);
57 if (surfaceChunk)
58 {
59 MemoryReadStream stream(surfaceChunk->Get(), surfaceChunk->Size());
60 MaterialGraph graph;
61 if (!graph.Load(&stream, false))
62 {
63 graph.GetReferences(assets);
64 }
65 }
66 }
67 }
68
69}
70
71#endif
72

Callers 1

GetReferencesFunction · 0.45

Calls 6

HasChunkFunction · 0.85
GetChunkFunction · 0.85
GetReferencesFunction · 0.70
GetMethod · 0.45
SizeMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected