mirror of
https://github.com/Scobalula/Tyrant
synced 2024-11-10 06:24:14 +00:00
RE7 Fixes
This commit is contained in:
parent
a545324002
commit
38dae7b9f2
6 changed files with 237 additions and 128 deletions
11
README.md
11
README.md
|
@ -46,3 +46,14 @@ Greyhound is distributed with an automatic updater that will check for updates e
|
||||||
## Reporting Bugs
|
## Reporting Bugs
|
||||||
|
|
||||||
Bugs can be reported through the Github issues or through the Discord server. Please make sure to provide a log when reporting bugs and any info you can possibly give.
|
Bugs can be reported through the Github issues or through the Discord server. Please make sure to provide a log when reporting bugs and any info you can possibly give.
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
* **Q**: I can't find some models?
|
||||||
|
* **A**: Not all assets have names as entries within the archives are hashed, currently you can enable the setting to show all assets and in the future the tool will attempt to convert these if they are supported, however currently they are dumped raw.
|
||||||
|
|
||||||
|
* **Q**: Some models export with no images?
|
||||||
|
* **A**: The tool attempts to locate the material files based off the model name, this works for most models, but not all, in the future material defs will be exportable on their own to aid with models where the materials cannot be located.
|
||||||
|
|
||||||
|
* **Q**: Some models export with incorrect UVs?
|
||||||
|
* **A**: A lot of materials rely on UV scales and offsets, currently it is unknown what data defines this. Usually this easy to fix by shifting the UVs yourself, or spliting the images, as it is usually used where 1 image contains multiple variants.
|
Binary file not shown.
|
@ -33,6 +33,27 @@ namespace Tyrant.Logic
|
||||||
/// Resident Evil 7 Material Entry
|
/// Resident Evil 7 Material Entry
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
|
internal struct MaterialEntryRE7
|
||||||
|
{
|
||||||
|
public long NamePointer;
|
||||||
|
public uint Hash; // MurMur3
|
||||||
|
public uint Unk01;
|
||||||
|
public uint Unk02;
|
||||||
|
public int SettingsBufferSize;
|
||||||
|
public int SettingsInfoCount;
|
||||||
|
public int TextureCount;
|
||||||
|
public int Unk03;
|
||||||
|
public int Unk04;
|
||||||
|
public long SettingsInfoPointer;
|
||||||
|
public long TexturesPointer;
|
||||||
|
public long SettingsBufferPointer;
|
||||||
|
public long ShaderNamePointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resident Evil 2 Material Entry
|
||||||
|
/// </summary>
|
||||||
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
internal struct MaterialEntryRE2
|
internal struct MaterialEntryRE2
|
||||||
{
|
{
|
||||||
public long NamePointer;
|
public long NamePointer;
|
||||||
|
@ -76,27 +97,16 @@ namespace Tyrant.Logic
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the given material file
|
/// Converts the given material file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Dictionary<string, Model.Material> Convert(byte[] buffer)
|
public static Dictionary<string, Model.Material> ConvertRE7(BinaryReader reader)
|
||||||
{
|
|
||||||
using (var stream = new MemoryStream(buffer))
|
|
||||||
{
|
|
||||||
return Convert(stream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Converts the given material file
|
|
||||||
/// </summary>
|
|
||||||
public static Dictionary<string, Model.Material> Convert(Stream stream)
|
|
||||||
{
|
{
|
||||||
var results = new Dictionary<string, Model.Material>();
|
var results = new Dictionary<string, Model.Material>();
|
||||||
|
|
||||||
using (var reader = new BinaryReader(stream))
|
|
||||||
{
|
{
|
||||||
|
reader.BaseStream.Position = 0;
|
||||||
var header = reader.ReadStruct<MaterialHeaderRE7>();
|
var header = reader.ReadStruct<MaterialHeaderRE7>();
|
||||||
var materials = reader.ReadArray<MaterialEntryRE2>(header.MaterialCount);
|
var materials = reader.ReadArray<MaterialEntryRE7>(header.MaterialCount);
|
||||||
|
|
||||||
foreach(var material in materials)
|
foreach (var material in materials)
|
||||||
{
|
{
|
||||||
var result = new Model.Material(reader.ReadUTF16NullTerminatedString(material.NamePointer));
|
var result = new Model.Material(reader.ReadUTF16NullTerminatedString(material.NamePointer));
|
||||||
|
|
||||||
|
@ -111,5 +121,65 @@ namespace Tyrant.Logic
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the given material file
|
||||||
|
/// </summary>
|
||||||
|
public static Dictionary<string, Model.Material> ConvertRE2(BinaryReader reader)
|
||||||
|
{
|
||||||
|
var results = new Dictionary<string, Model.Material>();
|
||||||
|
|
||||||
|
{
|
||||||
|
reader.BaseStream.Position = 0;
|
||||||
|
var header = reader.ReadStruct<MaterialHeaderRE7>();
|
||||||
|
var materials = reader.ReadArray<MaterialEntryRE2>(header.MaterialCount);
|
||||||
|
|
||||||
|
foreach (var material in materials)
|
||||||
|
{
|
||||||
|
var result = new Model.Material(reader.ReadUTF16NullTerminatedString(material.NamePointer));
|
||||||
|
|
||||||
|
foreach (var texture in reader.ReadArray<MaterialTextureEntryRE7>(material.TexturesPointer, material.TextureCount))
|
||||||
|
result.Images[reader.ReadUTF16NullTerminatedString(texture.TypePointer)] = reader.ReadUTF16NullTerminatedString(texture.TextureNamePointer).ToLower();
|
||||||
|
foreach (var setting in reader.ReadArray<MaterialSettingsInfoRE7>(material.SettingsInfoPointer, material.SettingsInfoCount))
|
||||||
|
result.Settings[reader.ReadUTF16NullTerminatedString(setting.NamePointer)] = reader.ReadArray<float>(material.SettingsBufferPointer + setting.DataOffset, setting.DataCount);
|
||||||
|
|
||||||
|
results[result.Name] = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the given material file
|
||||||
|
/// </summary>
|
||||||
|
public static Dictionary<string, Model.Material> Convert(byte[] buffer)
|
||||||
|
{
|
||||||
|
using (var stream = new MemoryStream(buffer))
|
||||||
|
{
|
||||||
|
return Convert(stream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the given material file
|
||||||
|
/// </summary>
|
||||||
|
public static Dictionary<string, Model.Material> Convert(Stream stream)
|
||||||
|
{
|
||||||
|
using (var reader = new BinaryReader(stream))
|
||||||
|
{
|
||||||
|
reader.BaseStream.Position = 28;
|
||||||
|
|
||||||
|
// Check size of buffer
|
||||||
|
if(reader.ReadUInt32() != 0)
|
||||||
|
{
|
||||||
|
return ConvertRE2(reader);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ConvertRE7(reader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,9 +325,7 @@ namespace Tyrant.Logic
|
||||||
foreach (var boneNameIndex in reader.ReadArray<ushort>(header.BoneNamesPointer, boneDataHeader.BoneCount))
|
foreach (var boneNameIndex in reader.ReadArray<ushort>(header.BoneNamesPointer, boneDataHeader.BoneCount))
|
||||||
boneNames.Add(strings[boneNameIndex]);
|
boneNames.Add(strings[boneNameIndex]);
|
||||||
|
|
||||||
Model model = new Model();
|
var bones = new List<Model.Bone>(boneDataHeader.BoneCount);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (header.BoneDataHeaderPointer > 0)
|
if (header.BoneDataHeaderPointer > 0)
|
||||||
{
|
{
|
||||||
|
@ -341,144 +339,160 @@ namespace Tyrant.Logic
|
||||||
boneMatrices[i].W.Y,
|
boneMatrices[i].W.Y,
|
||||||
boneMatrices[i].W.Z), boneMatrices[i].ToQuaternion());
|
boneMatrices[i].W.Z), boneMatrices[i].ToQuaternion());
|
||||||
|
|
||||||
model.Bones.Add(bone);
|
bones.Add(bone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var modelHeader = reader.ReadStruct<ModelHeaderRE7>(header.ModelPointers[0]);
|
bool firstMdlProcessed = false;
|
||||||
var vertexSize = 20 + (modelHeader.UVCount * 4) + (boneDataHeader.BoneCount > 0 ? 16 : 0);
|
|
||||||
|
|
||||||
reader.BaseStream.Position = header.ModelPointers[0] + 64;
|
for (int mdl = 0; mdl < 3; mdl++)
|
||||||
var materialIndices = reader.ReadArray<short>(header.MaterialNamesPointer, modelHeader.MaterialCount);
|
|
||||||
|
|
||||||
var lodPointers = reader.ReadArray<long>(reader.ReadInt64(), modelHeader.LODCount);
|
|
||||||
|
|
||||||
var uniqueMaterials = new List<string>(modelHeader.MaterialCount);
|
|
||||||
|
|
||||||
foreach (var lodPointer in lodPointers)
|
|
||||||
{
|
{
|
||||||
|
if (header.ModelPointers[mdl] == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
var lodHeader = reader.ReadStruct<LODHeaderRE7>(lodPointer);
|
if (firstMdlProcessed)
|
||||||
var boneIndices = reader.ReadArray<short>(lodPointer + 16, lodHeader.BoneCount);
|
break;
|
||||||
|
|
||||||
var meshPointers = reader.ReadArray<long>(lodHeader.MeshesPointer, lodHeader.MeshCount);
|
var lods = new List<Model>();
|
||||||
|
|
||||||
foreach (var meshPointer in meshPointers)
|
var modelHeader = reader.ReadStruct<ModelHeaderRE7>(header.ModelPointers[mdl]);
|
||||||
|
var vertexSize = 20 + (modelHeader.UVCount * 4) + (boneDataHeader.BoneCount > 0 ? 16 : 0);
|
||||||
|
|
||||||
|
reader.BaseStream.Position = header.ModelPointers[mdl] + (firstMdlProcessed ? 16 : 64);
|
||||||
|
var materialIndices = reader.ReadArray<short>(header.MaterialNamesPointer, modelHeader.MaterialCount);
|
||||||
|
|
||||||
|
firstMdlProcessed = true;
|
||||||
|
|
||||||
|
var lodPointers = reader.ReadArray<long>(reader.ReadInt64(), modelHeader.LODCount);
|
||||||
|
|
||||||
|
foreach (var lodPointer in lodPointers)
|
||||||
{
|
{
|
||||||
var mesh = reader.ReadStruct<LODMeshRE7>(meshPointer);
|
var model = new Model()
|
||||||
var subMeshes = reader.ReadArray<LODSubMeshRE7>(meshPointer + 16, mesh.SubMeshCount);
|
|
||||||
int verticesRead = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < subMeshes.Length; i++)
|
|
||||||
{
|
{
|
||||||
var materialName = strings[materialIndices[subMeshes[i].MaterialIndex]];
|
Bones = bones
|
||||||
|
};
|
||||||
|
|
||||||
if (!uniqueMaterials.Contains(materialName))
|
var uniqueMaterials = new List<string>(modelHeader.MaterialCount);
|
||||||
uniqueMaterials.Add(materialName);
|
|
||||||
|
|
||||||
var subMesh = new Model.Mesh();
|
var lodHeader = reader.ReadStruct<LODHeaderRE7>(lodPointer);
|
||||||
|
var boneIndices = reader.ReadArray<short>(lodPointer + 16, lodHeader.BoneCount);
|
||||||
|
|
||||||
subMesh.MaterialIndices.Add(uniqueMaterials.IndexOf(materialName));
|
var meshPointers = reader.ReadArray<long>(lodHeader.MeshesPointer, lodHeader.MeshCount);
|
||||||
|
|
||||||
int subMeshVertexCount = 0;
|
foreach (var meshPointer in meshPointers)
|
||||||
int subMeshFaceCount = subMeshes[i].FaceCount;
|
{
|
||||||
|
var mesh = reader.ReadStruct<LODMeshRE7>(meshPointer);
|
||||||
|
var subMeshes = reader.ReadArray<LODSubMeshRE7>(meshPointer + 16, mesh.SubMeshCount);
|
||||||
|
int verticesRead = 0;
|
||||||
|
|
||||||
// Since the counts aren't stored in each, we can use this to determine the counts
|
for (int i = 0; i < subMeshes.Length; i++)
|
||||||
if (i != subMeshes.Length - 1)
|
|
||||||
subMeshVertexCount = subMeshes[i + 1].VertexIndex - subMeshes[i].VertexIndex;
|
|
||||||
else
|
|
||||||
subMeshVertexCount = mesh.VertexCount - verticesRead;
|
|
||||||
|
|
||||||
|
|
||||||
verticesRead += subMeshVertexCount;
|
|
||||||
|
|
||||||
reader.BaseStream.Position = header.GeometryPointer + 48 + (vertexSize * subMeshes[i].VertexIndex);
|
|
||||||
|
|
||||||
for (int v = 0; v < subMeshVertexCount; v++)
|
|
||||||
{
|
{
|
||||||
// Base vertex data
|
var materialName = strings[materialIndices[subMeshes[i].MaterialIndex]];
|
||||||
var vertex = new Model.Vertex(
|
|
||||||
reader.ReadStruct<Vector3>(),
|
|
||||||
reader.ReadStruct<PackedVector3>().Unpack(),
|
|
||||||
reader.ReadStruct<PackedVector3>().Unpack());
|
|
||||||
vertex.UVs.Add(new Vector2(reader.ReadStruct<Half>(), reader.ReadStruct<Half>()));
|
|
||||||
// Skip unnsupported UV layers
|
|
||||||
reader.BaseStream.Position += 4 * (modelHeader.UVCount - 1);
|
|
||||||
|
|
||||||
// Check if we have bones
|
if (!uniqueMaterials.Contains(materialName))
|
||||||
if (lodHeader.BoneCount > 0)
|
uniqueMaterials.Add(materialName);
|
||||||
|
|
||||||
|
var subMesh = new Model.Mesh();
|
||||||
|
|
||||||
|
subMesh.MaterialIndices.Add(uniqueMaterials.IndexOf(materialName));
|
||||||
|
|
||||||
|
int subMeshVertexCount = 0;
|
||||||
|
int subMeshFaceCount = subMeshes[i].FaceCount;
|
||||||
|
|
||||||
|
// Since the counts aren't stored in each, we can use this to determine the counts
|
||||||
|
if (i != subMeshes.Length - 1)
|
||||||
|
subMeshVertexCount = subMeshes[i + 1].VertexIndex - subMeshes[i].VertexIndex;
|
||||||
|
else
|
||||||
|
subMeshVertexCount = mesh.VertexCount - verticesRead;
|
||||||
|
|
||||||
|
|
||||||
|
verticesRead += subMeshVertexCount;
|
||||||
|
|
||||||
|
reader.BaseStream.Position = header.GeometryPointer + 48 + (vertexSize * subMeshes[i].VertexIndex);
|
||||||
|
|
||||||
|
for (int v = 0; v < subMeshVertexCount; v++)
|
||||||
{
|
{
|
||||||
var localBoneIndices = reader.ReadBytes(8);
|
// Base vertex data
|
||||||
var weights = reader.ReadBytes(8);
|
var vertex = new Model.Vertex(
|
||||||
var weightSum = 0.0f;
|
reader.ReadStruct<Vector3>(),
|
||||||
|
reader.ReadStruct<PackedVector3>().Unpack(),
|
||||||
|
reader.ReadStruct<PackedVector3>().Unpack());
|
||||||
|
vertex.UVs.Add(new Vector2(reader.ReadStruct<Half>(), reader.ReadStruct<Half>()));
|
||||||
|
// Skip unnsupported UV layers
|
||||||
|
reader.BaseStream.Position += 4 * (modelHeader.UVCount - 1);
|
||||||
|
|
||||||
for (int w = 0; w < 8 && weights[w] != 0; w++)
|
// Check if we have bones
|
||||||
|
if (lodHeader.BoneCount > 0)
|
||||||
{
|
{
|
||||||
vertex.Weights.Add(new Model.Vertex.Weight()
|
var localBoneIndices = reader.ReadBytes(8);
|
||||||
{
|
var weights = reader.ReadBytes(8);
|
||||||
BoneIndex = boneIndices[localBoneIndices[w]],
|
var weightSum = 0.0f;
|
||||||
Influence = weights[w] / 255.0f
|
|
||||||
});
|
|
||||||
|
|
||||||
weightSum += vertex.Weights[w].Influence;
|
for (int w = 0; w < 8 && weights[w] != 0; w++)
|
||||||
|
{
|
||||||
|
vertex.Weights.Add(new Model.Vertex.Weight()
|
||||||
|
{
|
||||||
|
BoneIndex = boneIndices[localBoneIndices[w]],
|
||||||
|
Influence = weights[w] / 255.0f
|
||||||
|
});
|
||||||
|
|
||||||
|
weightSum += vertex.Weights[w].Influence;
|
||||||
|
}
|
||||||
|
|
||||||
|
var multiplier = 1.0f / weightSum;
|
||||||
|
|
||||||
|
foreach (var weight in vertex.Weights)
|
||||||
|
weight.Influence *= multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
var multiplier = 1.0f / weightSum;
|
subMesh.Vertices.Add(vertex);
|
||||||
|
|
||||||
foreach (var weight in vertex.Weights)
|
|
||||||
weight.Influence *= multiplier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
subMesh.Vertices.Add(vertex);
|
switch (lodHeader.Flags)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
reader.BaseStream.Position = geometryHeader.FaceBufferOffset + (2 * subMeshes[i].FaceIndex);
|
||||||
|
|
||||||
|
for (int f = 0; f < subMeshes[i].FaceCount / 3; f++)
|
||||||
|
{
|
||||||
|
var v1 = reader.ReadUInt16();
|
||||||
|
var v2 = reader.ReadUInt16();
|
||||||
|
var v3 = reader.ReadUInt16();
|
||||||
|
|
||||||
|
if (v1 != v2 && v2 != v3 && v3 != v1)
|
||||||
|
subMesh.Faces.Add(new Model.Face(v1, v2, v3));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
reader.BaseStream.Position = geometryHeader.FaceBufferOffset + (4 * subMeshes[i].FaceIndex);
|
||||||
|
|
||||||
|
for (int f = 0; f < subMeshes[i].FaceCount / 3; f++)
|
||||||
|
{
|
||||||
|
var v1 = reader.ReadInt32();
|
||||||
|
var v2 = reader.ReadInt32();
|
||||||
|
var v3 = reader.ReadInt32();
|
||||||
|
|
||||||
|
if (v1 != v2 && v2 != v3 && v3 != v1)
|
||||||
|
subMesh.Faces.Add(new Model.Face(v1, v2, v3));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
model.Meshes.Add(subMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (lodHeader.Flags)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
reader.BaseStream.Position = geometryHeader.FaceBufferOffset + (2 * subMeshes[i].FaceIndex);
|
|
||||||
|
|
||||||
for (int f = 0; f < subMeshes[i].FaceCount / 3; f++)
|
|
||||||
{
|
|
||||||
var v1 = reader.ReadUInt16();
|
|
||||||
var v2 = reader.ReadUInt16();
|
|
||||||
var v3 = reader.ReadUInt16();
|
|
||||||
|
|
||||||
if (v1 != v2 && v2 != v3 && v3 != v1)
|
|
||||||
subMesh.Faces.Add(new Model.Face(v1, v2, v3));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
reader.BaseStream.Position = geometryHeader.FaceBufferOffset + (4 * subMeshes[i].FaceIndex);
|
|
||||||
|
|
||||||
for (int f = 0; f < subMeshes[i].FaceCount / 3; f++)
|
|
||||||
{
|
|
||||||
var v1 = reader.ReadInt32();
|
|
||||||
var v2 = reader.ReadInt32();
|
|
||||||
var v3 = reader.ReadInt32();
|
|
||||||
|
|
||||||
if (v1 != v2 && v2 != v3 && v3 != v1)
|
|
||||||
subMesh.Faces.Add(new Model.Face(v1, v2, v3));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
model.Meshes.Add(subMesh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var materialName in uniqueMaterials)
|
||||||
|
{
|
||||||
|
model.Materials.Add(new Model.Material(materialName));
|
||||||
|
}
|
||||||
|
|
||||||
|
lods.Add(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var materialName in uniqueMaterials)
|
results.Add(lods);
|
||||||
{
|
|
||||||
var material = new Model.Material(materialName);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
results.Add(new List<Model>
|
|
||||||
{
|
|
||||||
model
|
|
||||||
});
|
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,6 +562,9 @@ namespace Tyrant.Logic
|
||||||
if (header.ModelPointers[mdl] == 0)
|
if (header.ModelPointers[mdl] == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (firstMdlProcessed)
|
||||||
|
break;
|
||||||
|
|
||||||
var lods = new List<Model>();
|
var lods = new List<Model>();
|
||||||
|
|
||||||
var modelHeader = reader.ReadStruct<ModelHeaderRE7>(header.ModelPointers[mdl]);
|
var modelHeader = reader.ReadStruct<ModelHeaderRE7>(header.ModelPointers[mdl]);
|
||||||
|
|
|
@ -51,5 +51,5 @@ using System.Windows;
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.1")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.1")]
|
||||||
|
|
|
@ -79,8 +79,11 @@ namespace Tyrant
|
||||||
{
|
{
|
||||||
".mdf2.10",
|
".mdf2.10",
|
||||||
"_mat.mdf2.10",
|
"_mat.mdf2.10",
|
||||||
|
".mdf2.6",
|
||||||
|
"_mat.mdf2.6",
|
||||||
".10",
|
".10",
|
||||||
".11",
|
".11",
|
||||||
|
".8",
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -361,6 +364,13 @@ namespace Tyrant
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ExportUnknownFile(Package.Entry entry, string name)
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(name));
|
||||||
|
|
||||||
|
File.WriteAllBytes(name, ActivePackage.LoadEntry(entry));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exports a Model Asset
|
/// Exports a Model Asset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -468,6 +478,7 @@ namespace Tyrant
|
||||||
ExportMotionList(asset.PackageEntry, Path.Combine("exported_files", asset.Name));
|
ExportMotionList(asset.PackageEntry, Path.Combine("exported_files", asset.Name));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
ExportUnknownFile(asset.PackageEntry, Path.Combine("exported_files", asset.Name));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue