ME3Tweaks / LegendaryExplorer

Editor toolset for Mass Effect Trilogy and Mass Effect Legendary Edition
https://me3tweaks.com
GNU General Public License v3.0
125 stars 27 forks source link

Meshplorer "Unable to read beyond the end of the stream" unhandled exception #275

Closed artamiss closed 3 years ago

artamiss commented 3 years ago

Describe the bug Unhandled exception when attempting to replace mesh from UDK. Exact log as follows:

EndOfStreamException: Unable to read beyond the end of the stream. at System.IO.BinaryReader.InternalRead(Int32 numBytes) at System.IO.BinaryReader.ReadUInt16() at LegendaryExplorerCore.Gammtek.IO.EndianReader.ReadUInt16() in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Gammtek\IO\EndianReader.cs:line 388 at LegendaryExplorerCore.Unreal.BinaryConverters.SCExt.Serialize(SerializingContainer2 sc, kDOPCollisionTriangle& kTri) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\StaticMesh.cs:line 673 at LegendaryExplorerCore.Unreal.BinaryConverters.SCExt.Serialize[T](SerializingContainer2 sc, T[]& arr, SerializeDelegate1 serialize) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\SerializingContainer2.cs:line 228 at LegendaryExplorerCore.Unreal.BinaryConverters.SCExt.Serialize(SerializingContainer2 sc, kDOPTreeCompact& kDopTree) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\StaticMesh.cs:line 742 at LegendaryExplorerCore.Unreal.BinaryConverters.SCExt.Serialize(SerializingContainer2 sc, PerPolyBoneCollisionData& bcd) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\SkeletalMesh.cs:line 671 at LegendaryExplorerCore.Unreal.BinaryConverters.SCExt.Serialize[T](SerializingContainer2 sc, T[]& arr, SerializeDelegate1 serialize) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\SerializingContainer2.cs:line 228 at LegendaryExplorerCore.Unreal.BinaryConverters.SkeletalMesh.Serialize(SerializingContainer2 sc) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\SkeletalMesh.cs:line 44 at LegendaryExplorerCore.Unreal.BinaryConverters.ObjectBinary.From[T](ExportEntry export, PackageCache packageCache) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorerCore\Unreal\BinaryConverters\ObjectBinary.cs:line 19 at LegendaryExplorer.Tools.Meshplorer.MeshplorerWindow.ReplaceFromUDK(Boolean lodOnly) in C:\Users\Mgamerz\source\repos\ME3Explorer\LegendaryExplorer\LegendaryExplorer\Tools\Meshplorer\MeshplorerWindow.xaml.cs:line 270

(Side note, why is it trying to reference any files in the C:\ directory of not me? How does that work?)

Error pop-up presents a continue option, apparently no effect (does not successfully complete the operation)

To Reproduce Unsure how to reproduce, as the mesh I am trying to import and replace with is itself slightly unique; I had to piece together a way to import .psk into Blender (2.92) and export again. As such, there might be some residual jank that causes the error. Other than that, I'm not doing anything outside of the ordinary, just exporting from UDK, opening the .pcc in Meshplorer, right clicking the outfit I want to replace and trying either Replace Mesh from UDK or Replace single LOD from UDK. There's only one LOD anyway and both throw the same error.

Expected behavior I had hoped it would work

Screenshots and files used to replicate this For the sake of reproduction, UPK file with the mesh attached below.

Version information: 6.0 7/29/2021

Stack trace See above

Other information

SirCxyrtyx commented 3 years ago

You don't seem to have attached the UPK.

(Side note, why is it trying to reference any files in the C:\ directory of not me? How does that work?)

That's the path of the source files on the machine that LEX was built on. Purely informational.

artamiss commented 3 years ago

I did indeed forget that MassEffectExport.zip

SirCxyrtyx commented 3 years ago

This is now fixed in the latest nightly build. You can get the nightly builds from the Tools menu in ME3Tweaks Mod Manager, or from the #lex_nightlies channel in the ME3Tweaks Discord server.

The issue was that UDK had created a variant of the SkeletalMesh format that I had not encountered before, and thus had not coded support for. Easily fixed. Thanks for the bug report!