-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClasses.cs
More file actions
582 lines (510 loc) · 24.8 KB
/
Classes.cs
File metadata and controls
582 lines (510 loc) · 24.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
using AtlasTexturePlugin;
using Frosty.Core;
using Frosty.Core.Viewport;
using FrostySdk;
using FrostySdk.Ebx;
using FrostySdk.IO;
using FrostySdk.Managers;
using FrostySdk.Resources;
using MeshSetPlugin.Resources;
using RootInstanceEntiresPlugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace BundleManager
{
//Used to find ebx, chunk and res references of "special" assets such as meshassets
internal class BundleParentArrays
{
public List<int> baseParents = new List<int>();
public List<int> moddedParents = new List<int>();
public List<int> allParents { get { return baseParents.Concat(moddedParents).ToList(); } }
public BundleParentArrays(List<int> BaseParents, List<int> ModdedParents)
{
baseParents = BaseParents;
moddedParents = ModdedParents;
}
}
internal class AssetLogger
{
public AssetManager AM = App.AssetManager;
public virtual string AssetType => null;
public virtual AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = new AssetData() { EbxReferences = new List<EbxAssetEntry>(), Chunks = new List<(ChunkAssetEntry, int, string)>(), Res = new List<ResAssetEntry>() };
data.EbxReferences = parEntry.EnumerateDependencies().Select(o => App.AssetManager.GetEbxEntry(o)).ToList();
ResAssetEntry resNameShare = AM.GetResEntry(parEntry.Name.ToLower());
if (resNameShare != null && !data.Res.Contains(resNameShare))
data.Res.Add(resNameShare);
void AddChunk(Guid chkId)
{
ChunkAssetEntry chkEntry = AM.GetChunkEntry(chkId);
if (chkEntry != null && !data.Chunks.Select(chkData => chkData.Item1).Contains(chkEntry) && !chkEntry.IsTocChunk)
data.Chunks.Add((chkEntry, chkEntry.FirstMip, null));
}
void AddRes(ulong resId)
{
ResAssetEntry resEntry = AM.GetResEntry(resId);
if (resEntry != null && !data.Res.Contains(resEntry))
data.Res.Add(resEntry);
}
void CheckList(dynamic obj)
{
Type listType = obj.GetType();
if (listType.GetGenericArguments()[0].GetProperties().Length > 0)
{
foreach (var item in obj)
CheckProperties(item);
}
else
{
if (obj.GetType().GetGenericArguments()[0].Name == "ResourceRef")
foreach (uint resId in obj)
AddRes(resId);
else if (obj.GetType().GetGenericArguments()[0].Name == "Guid")
foreach (Guid guid in obj)
AddChunk(guid);
}
}
List<string> exclusionTypes = new List<string>() { "__Id", "__InstanceGuid", "LinearTransform", "Vec3", "PointerRef" };
void CheckProperties(dynamic obj)
{
foreach (PropertyInfo pi in obj.GetType().GetProperties())
{
string propTypeName = pi.PropertyType.Name;
if (obj.GetType().Name == "PathfindingBlob")
App.Logger.Log(pi.Name);
if (exclusionTypes.Contains(propTypeName))
continue;
else if (propTypeName == "ResourceRef")
AddRes((ulong)pi.GetValue(obj));
else if (propTypeName == "Guid")
AddChunk((Guid)pi.GetValue(obj));
else if (propTypeName == "List`1")
CheckList(pi.GetValue(obj));
else if (pi.PropertyType.GetProperties().Length > 0)
{
CheckProperties(pi.PropertyType.GetProperties());
}
}
}
foreach (dynamic obj in parAsset.Objects)
{
//App.Logger.Log(obj.GetType().Name);
CheckProperties(obj);
if (obj.GetType().Name == "StaticModelGroupEntityData")
{
//App.Logger.Log("Static group");
Dictionary<uint, EbxAssetEntry> hashesToObjectVariations = AM.EnumerateEbx(type: "ObjectVariation").ToDictionary(refEntry => (uint)Utils.HashString(refEntry.Name, true), refEntry => refEntry);
List<UInt32> objVarNameHashes = new List<UInt32>();
foreach(dynamic memberData in obj.MemberDatas)
{
foreach(uint objVarNameHash in memberData.InstanceObjectVariation)
{
if (!objVarNameHashes.Contains(objVarNameHash) && objVarNameHash != 0)
objVarNameHashes.Add(objVarNameHash);
}
}
foreach(UInt32 objVarNameHash in objVarNameHashes)
{
if (hashesToObjectVariations.ContainsKey(objVarNameHash))
{
if (!data.EbxReferences.Contains(hashesToObjectVariations[objVarNameHash]))
data.EbxReferences.Add(hashesToObjectVariations[objVarNameHash]);
}
else
{
App.Logger.LogWarning($"{parEntry.Name}: Unrecognised object variation hash {objVarNameHash}");
}
}
}
}
return data;
}
}
internal class ClassSchematicsAssetLogger : AssetLogger
{
public override string AssetType => "SchematicsAsset";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
dynamic parRoot = parAsset.RootObject;
EbxAssetEntry refEntry = AM.GetEbxEntry(parRoot.InstanceType.ToString().Substring(9, parRoot.InstanceType.ToString().Length - 10));
if (refEntry != null)
data.EbxReferences.Add(refEntry);
return data;
}
}
internal class VisualUnlockRootAssetLogger : AssetLogger
{
public override string AssetType => "VisualUnlockRootAsset";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
dynamic parRoot = parAsset.RootObject;
if (parRoot.VisualUnlockAssets.Count == 0)
data.EbxReferences.Clear();
return data;
}
}
internal class TexureAssetLogger : AssetLogger
{
public override string AssetType => "TextureAsset";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
foreach (ResAssetEntry resEntry in data.Res)
{
Texture texture = App.AssetManager.GetResAs<Texture>(resEntry);
ChunkAssetEntry chkEntry = App.AssetManager.GetChunkEntry(texture.ChunkId);
if (chkEntry != null)
data.Chunks.Add((chkEntry, texture.FirstMip, resEntry.Name));
}
return data;
}
}
internal class AtlasTextureAssetLogger : AssetLogger
{
public override string AssetType => "AtlasTextureAsset";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
foreach (ResAssetEntry resEntry in data.Res)
{
AtlasTexture texture = App.AssetManager.GetResAs<AtlasTexture>(resEntry);
ChunkAssetEntry chkEntry = App.AssetManager.GetChunkEntry(texture.ChunkId);
if (chkEntry != null)
data.Chunks.Add((chkEntry, chkEntry.FirstMip, resEntry.Name));
}
return data;
}
}
internal class ShaderGraphAssetLogger : AssetLogger
{
public override string AssetType => "ShaderGraph";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
string resBlocksName = parEntry.Name.ToLower() + "_graph/blocks";
ResAssetEntry resBlockEntry = AM.GetResEntry(resBlocksName);
if (resBlockEntry != null)
{
data.Res.Add(resBlockEntry);
using (NativeReader reader = new NativeReader(AM.GetRes(resBlockEntry)))
{
for (int idx = 72; idx < Convert.ToInt32(reader.BaseStream.Length - 12); idx = idx + 4)
{
reader.BaseStream.Position = idx;
Guid ReadGuid = reader.ReadGuid();
if (RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid) != null && RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid) != parEntry && !data.EbxReferences.Contains(RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid)))
data.EbxReferences.Add(RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid));
}
}
}
return data;
}
}
internal class MeshAssetLogger : AssetLogger
{
public override string AssetType => "MeshAsset";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
dynamic parRoot = parAsset.RootObject;
ResAssetEntry MeshSetResEntry = AM.GetResEntry(parRoot.MeshSetResource);
if (MeshSetResEntry != null)
{
// Blocks Resources
string resBlocksName = parEntry.Name.ToLower() + "_mesh/blocks";
ResAssetEntry resBlockEntry = AM.GetResEntry(resBlocksName);
if (resBlockEntry != null)
{
data.Res.Add(resBlockEntry);
using (NativeReader reader = new NativeReader(AM.GetRes(resBlockEntry)))
{
for (int idx = 72; idx < Convert.ToInt32(reader.BaseStream.Length - 12); idx = idx + 4)
{
reader.BaseStream.Position = idx;
Guid ReadGuid = reader.ReadGuid();
if (RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid) != null && RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid) != parEntry && !data.EbxReferences.Contains(RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid)))
data.EbxReferences.Add(RootInstanceEbxEntryDb.GetEbxEntryByRootInstanceGuid(ReadGuid));
}
}
}
//Chunks
MeshSet meshSet = App.AssetManager.GetResAs<MeshSet>(MeshSetResEntry);
foreach (MeshSetLod lod in meshSet.Lods)
{
if (lod.ChunkId != Guid.Empty)
{
ChunkAssetEntry chkEntry = App.AssetManager.GetChunkEntry(lod.ChunkId);
data.Chunks.Add((chkEntry, chkEntry.FirstMip, meshSet.FullName));
}
}
}
return data;
}
}
internal class EmitterGraphAssetLogger : AssetLogger
{
public override string AssetType => "EmitterGraph";
public override AssetData GetAssetData(EbxAssetEntry parEntry, EbxAsset parAsset)
{
AssetData data = base.GetAssetData(parEntry, parAsset);
dynamic parRoot = parAsset.RootObject;
foreach (EbxAssetEntry refEntry in new List<string> { parRoot.MeshVertexShaderFragmentAssetName, parRoot.VertexShaderFragmentAssetName }.Select(o => AM.GetEbxEntry(o)).ToList())
{
if (refEntry != null && !data.EbxReferences.Contains(refEntry) && refEntry != parEntry)
data.EbxReferences.Add(refEntry);
}
return data;
}
}
public class BM_BundleData
{
public List<int> Parents;
public List<EbxAssetEntry> ModifiedAssets;
}
public class MeshVariData
{
public BM_MeshVariationDatabaseEntry BM_MeshVariationDatabaseEntry;
//public dynamic MeshVariationDatabaseEntry;
public List<Guid> refGuids;
}
public class MeshVariOriginalData : MeshVariData
{
public Dictionary<EbxAssetEntry, int> dbLocations;
}
public class AssetData
{
public List<EbxAssetEntry> EbxReferences;
public List<(ChunkAssetEntry, int, string)> Chunks;
public List<ResAssetEntry> Res;
public List<EbxImportReference> Objects;
public MeshVariData meshVari;
}
public class BM_TextureShaderParameter
{
public PointerRef Value;
public CString ParameterName;
public BM_TextureShaderParameter(NativeReader reader, Boolean Test)
{
ParameterName = reader.ReadNullTerminatedString();
Value = new PointerRef(new EbxImportReference() { FileGuid = reader.ReadGuid(), ClassGuid = reader.ReadGuid() });
}
public BM_TextureShaderParameter(dynamic texparam)
{
Value = texparam.Value;
ParameterName = texparam.ParameterName;
}
public dynamic WriteToGameTexParam()
{
dynamic mvdbTexParam = TypeLibrary.CreateObject("TextureShaderParameter");
mvdbTexParam.Value = Value;
mvdbTexParam.ParameterName = ParameterName;
return mvdbTexParam;
}
}
public class BM_MeshVariationDatabaseMaterial
{
public PointerRef Material;
public PointerRef MaterialVariation;
public Int64 MaterialId;
public Guid SurfaceShaderGuid;
public UInt32 SurfaceShaderId;
public List<BM_TextureShaderParameter> TextureParameters = new List<BM_TextureShaderParameter>();
public BM_MeshVariationDatabaseMaterial(NativeReader reader, PointerRef mesh, UInt32 var)
{
Material = new PointerRef(new EbxImportReference() { FileGuid = mesh.External.FileGuid, ClassGuid = reader.ReadGuid() });
if (var != 0)
MaterialVariation = new PointerRef(new EbxImportReference() { FileGuid = reader.ReadGuid(), ClassGuid = reader.ReadGuid() });
SurfaceShaderId = reader.ReadUInt();
SurfaceShaderGuid = reader.ReadGuid();
MaterialId = reader.ReadLong();
int texParamCount = reader.ReadInt();
for (int i = 0; i < texParamCount; i++)
TextureParameters.Add(new BM_TextureShaderParameter(reader, true));
}
public BM_MeshVariationDatabaseMaterial(dynamic material)
{
Material = material.Material;
MaterialVariation = material.MaterialVariation;
if (ProfilesLibrary.IsLoaded(ProfileVersion.StarWarsBattlefrontII))
{
MaterialId = material.MaterialId;
SurfaceShaderGuid = material.SurfaceShaderGuid;
SurfaceShaderId = material.SurfaceShaderId;
}
foreach (dynamic texparam in material.TextureParameters)
TextureParameters.Add(new BM_TextureShaderParameter(texparam));
}
public BM_MeshVariationDatabaseMaterial(EbxAssetEntry parEntry, dynamic material)
{
Material = new PointerRef(new EbxImportReference() { FileGuid = parEntry.Guid, ClassGuid = material.__InstanceGuid.ExportedGuid });
dynamic shader = material.Shader;
if (shader.Shader.Type == PointerRefType.External)
{
SurfaceShaderGuid = shader.Shader.External.FileGuid;
EbxAssetEntry shaderEntry = App.AssetManager.GetEbxEntry(shader.Shader.External.FileGuid);
if (shaderEntry != null)
SurfaceShaderId = (uint)Utils.HashString(shaderEntry.Name.ToLower());
}
foreach (dynamic texparam in shader.TextureParameters)
TextureParameters.Add(new BM_TextureShaderParameter(texparam));
}
public BM_MeshVariationDatabaseMaterial(EbxAssetEntry parEntry, dynamic material, EbxAssetEntry varEntry, dynamic variationMaterial)
{
Material = new PointerRef(new EbxImportReference() { FileGuid = parEntry.Guid, ClassGuid = material.__InstanceGuid.ExportedGuid });
MaterialVariation = new PointerRef(new EbxImportReference() { FileGuid = varEntry.Guid, ClassGuid = variationMaterial.__InstanceGuid.ExportedGuid });
dynamic shader = variationMaterial.Shader.Shader.Type == PointerRefType.External ? variationMaterial.Shader : material.Shader;
if (shader.Shader.Type == PointerRefType.External)
{
SurfaceShaderGuid = shader.Shader.External.FileGuid;
EbxAssetEntry shaderEntry = App.AssetManager.GetEbxEntry(shader.Shader.External.FileGuid);
if (shaderEntry != null)
SurfaceShaderId = (uint)Utils.HashString(shaderEntry.Name.ToLower());
}
foreach (dynamic texparam in variationMaterial.Shader.TextureParameters)
TextureParameters.Add(new BM_TextureShaderParameter(texparam));
}
public dynamic WriteToGameMaterial()
{
dynamic mvdbMaterial = TypeLibrary.CreateObject("MeshVariationDatabaseMaterial");
mvdbMaterial.Material = Material;
mvdbMaterial.MaterialVariation = MaterialVariation;
mvdbMaterial.MaterialId = MaterialId;
mvdbMaterial.SurfaceShaderGuid = SurfaceShaderGuid;
mvdbMaterial.SurfaceShaderId = SurfaceShaderId;
foreach (BM_TextureShaderParameter BM_TexParam in TextureParameters)
mvdbMaterial.TextureParameters.Add(BM_TexParam.WriteToGameTexParam());
return mvdbMaterial;
}
}
public class BM_MeshVariationDatabaseEntry
{
public PointerRef Mesh;
public List<BM_MeshVariationDatabaseMaterial> Materials = new List<BM_MeshVariationDatabaseMaterial>();
public UInt32 VariationAssetNameHash;
public BM_MeshVariationDatabaseEntry(NativeReader reader, PointerRef mesh)
{
Mesh = mesh;
VariationAssetNameHash = reader.ReadUInt();
int matCount = reader.ReadInt();
for (int i = 0; i < matCount; i++)
Materials.Add(new BM_MeshVariationDatabaseMaterial(reader, mesh, VariationAssetNameHash));
}
public BM_MeshVariationDatabaseEntry(dynamic mvdbEntry) //Constructor from base game MeshVariationDatabaseEntry
{
Mesh = mvdbEntry.Mesh;
VariationAssetNameHash = mvdbEntry.VariationAssetNameHash;
foreach (dynamic material in mvdbEntry.Materials)
Materials.Add(new BM_MeshVariationDatabaseMaterial(material));
}
public BM_MeshVariationDatabaseEntry(EbxAssetEntry parEntry, EbxAsset parAsset, dynamic parRoot)
{
Mesh = new PointerRef(new EbxImportReference() { FileGuid = parEntry.Guid, ClassGuid = parAsset.RootInstanceGuid });
if (TypeLibrary.IsSubClassOf(parRoot.GetType(), "MeshAsset"))
VariationAssetNameHash = 0;
foreach(dynamic pr in parRoot.Materials)
{
if (pr.Type == PointerRefType.Internal)
Materials.Add(new BM_MeshVariationDatabaseMaterial(parEntry, pr.Internal));
}
}
public BM_MeshVariationDatabaseEntry(EbxAssetEntry meshEntry, EbxAsset meshAsset, dynamic meshRoot, EbxAssetEntry varEntry, dynamic varRoot, Dictionary<Guid, dynamic> meshSectionToVariationSection)
{
Mesh = new PointerRef(new EbxImportReference() { FileGuid = meshEntry.Guid, ClassGuid = meshAsset.RootInstanceGuid });
VariationAssetNameHash = (uint)Utils.HashString(varEntry.Name.ToLower());
foreach (dynamic pr in meshRoot.Materials)
{
if (pr.Type == PointerRefType.Internal)
{
Materials.Add(new BM_MeshVariationDatabaseMaterial(meshEntry, pr.Internal, varEntry, meshSectionToVariationSection[pr.Internal.__InstanceGuid.ExportedGuid]));
}
}
}
public dynamic WriteToGameEntry()
{
dynamic mvdbObject = TypeLibrary.CreateObject("MeshVariationDatabaseEntry");
mvdbObject.Mesh = Mesh;
mvdbObject.VariationAssetNameHash = VariationAssetNameHash;
foreach(BM_MeshVariationDatabaseMaterial BM_Material in Materials)
mvdbObject.Materials.Add(BM_Material.WriteToGameMaterial());
return mvdbObject;
}
public bool CheckMeshNeedsUpdating(EbxAsset parAsset, dynamic parRoot)
{
if (Materials.Count != parRoot.Materials.Count)
return true;
foreach (BM_MeshVariationDatabaseMaterial material in Materials)
{
dynamic matObj = parAsset.GetObject(material.Material.External.ClassGuid);
if (matObj == null)
return true;
if (matObj.Shader.Shader.External.FileGuid != material.SurfaceShaderGuid)
return true;
if (material.TextureParameters.Count != matObj.Shader.TextureParameters.Count)
return true;
for (int i = 0; i < material.TextureParameters.Count; i++)
{
if ((material.TextureParameters[i].ParameterName != matObj.Shader.TextureParameters[i].ParameterName)
|| (material.TextureParameters[i].Value.External.FileGuid != matObj.Shader.TextureParameters[i].Value.External.FileGuid))
return true;
}
}
return false;
}
public bool CheckVariationNeedsUpdating(EbxAsset parAsset, dynamic parRoot, EbxAsset meshAsset)
{
if (Materials.Count != parRoot.Materials.Count)
return true;
foreach (BM_MeshVariationDatabaseMaterial material in Materials)
{
if (material.MaterialVariation.Type != PointerRefType.External)
continue;
dynamic matMesh = meshAsset.GetObject(material.Material.External.ClassGuid);
dynamic matVar = parAsset.GetObject(material.MaterialVariation.External.ClassGuid);
if (matMesh == null || matVar == null)
return true;
if (matVar.Shader.Shader.Type != PointerRefType.External)
{
if (matMesh.Shader.Shader.External.FileGuid != material.SurfaceShaderGuid)
return true;
}
else
if (matVar.Shader.Shader.External.FileGuid != material.SurfaceShaderGuid)
return true;
if (material.TextureParameters.Count != matVar.Shader.TextureParameters.Count)
return true;
for (int i = 0; i < material.TextureParameters.Count; i++)
{
if ((material.TextureParameters[i].ParameterName != matVar.Shader.TextureParameters[i].ParameterName)
|| (material.TextureParameters[i].Value.External.FileGuid != matVar.Shader.TextureParameters[i].Value.External.FileGuid))
return true;
}
}
return false;
}
public List<Guid> GetReferenceGuids()
{
List<Guid> guids = new List<Guid>();
if (App.AssetManager.GetEbxEntry(Mesh.External.FileGuid) != null)
guids.Add(Mesh.External.FileGuid);
foreach(BM_MeshVariationDatabaseMaterial material in Materials)
{
if (App.AssetManager.GetEbxEntry(material.Material.External.FileGuid) != null && !guids.Contains(material.Material.External.FileGuid))
guids.Add(material.Material.External.FileGuid);
foreach(BM_TextureShaderParameter texParam in material.TextureParameters)
{
if (App.AssetManager.GetEbxEntry(texParam.Value.External.FileGuid) != null && !guids.Contains(texParam.Value.External.FileGuid))
guids.Add(texParam.Value.External.FileGuid);
}
}
return guids;
}
}
}