Skip to content

Commit

Permalink
(Nu2) Scene OBJ Exporting
Browse files Browse the repository at this point in the history
I do some very bizarre stuff with a MaxScript here but oh well!
  • Loading branch information
Knuxfan24 committed Feb 11, 2024
1 parent eec7d79 commit 2569110
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 6 deletions.
6 changes: 3 additions & 3 deletions KnuxLib/Engines/Nu2/ObjectChunks/SPECSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class SPECData
public Matrix4x4 UnknownMatrix4x4_1 { get; set; }

/// <summary>
/// The index of the geometry entry in the file's geometry set that this entry should use.
/// The index of the instance entry in the file's instance set that this entry should use.
/// </summary>
public uint ModelIndex { get; set; }
public uint InstanceIndex { get; set; }

/// <summary>
/// The name of this entry.
Expand Down Expand Up @@ -68,7 +68,7 @@ public static List<SPECData> Read(BinaryReaderEx reader, FormatVersion version)
entry.UnknownMatrix4x4_1 = reader.ReadMatrix();

// Read this entry's model index.
entry.ModelIndex = reader.ReadUInt32();
entry.InstanceIndex = reader.ReadUInt32();

// Read the node name table offset for this data's name.
entry.Name = Helpers.FindNu2SceneName(reader, reader.ReadUInt32(), version);
Expand Down
2 changes: 2 additions & 0 deletions KnuxLib/Engines/Nu2/ObjectChunks/TextureSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public static List<TextureData> Read(BinaryReaderEx reader, FormatVersion versio
// If this is a GameCube file, then flip chunkType.
if (version == FormatVersion.GameCube)
chunkType = new string(chunkType.Reverse().ToArray());
else
throw new NotImplementedException();

if (chunkType != "TSH0")
throw new Exception($"Expected 'TSH0', got '{chunkType}'.");
Expand Down
Loading

0 comments on commit 2569110

Please sign in to comment.