Perfare / UnityLive2DExtractor

Unity Live2D Cubism 3 Extractor
MIT License
526 stars 92 forks source link

System.OutOfMemoryException thrown in CubismPhysicsRig.cs #24

Closed BakaDani closed 5 months ago

BakaDani commented 5 months ago

System.OutOfMemoryException: 'Array dimensions exceeded supported range.'

Line 126 in CubismPhysicsRig.cs

Appears to not be able to handle cases where there are too many particles. In this case, particles were 1634885968.

BakaDani commented 5 months ago

Attempt from Azur Lane. Appears to stem from their Unity 2020 upgrade. Newer Unity versions appear to be incompatible with this extractor.

CCRcmcpe commented 5 months ago

Hello, I managed to get it work. https://github.com/Perfare/UnityLive2DExtractor/blob/ab37d53b99cf34641305704e93e2e0b9098f80c4/UnityLive2DExtractor/CubismPhysicsRig.cs#L113 Before this line, add:

reader.ReadAlignedString();

Currently, I'm using a version ported to .NET 8, with https://github.com/zhangjiequan/AssetStudio library seems to work fine. I can publish a fork later.

BakaDani commented 5 months ago

Thank you for this. I made the change suggested, and while it did fix the exception, for some reason it's not able to extract all of the files like it used to. Maybe the updated AssetStudio version would help.

Your fork would be very much appreciated. It does appear this project might be abandoned.

CCRcmcpe commented 5 months ago

https://github.com/CCRcmcpe/UnityLive2DExtractor

BakaDani commented 5 months ago

Thanks a lot. It's working.

kugon21 commented 5 months ago

Hey, I'm sorry in advance if this isn't the place to ask. I was wondering if a release could be made including this fix as I have also been having issues with using the extractor for Azur Lane. I am not sure how to turn the code into the finished product/.exe.

Any help would be greatly appreciated, thank you!

CCRcmcpe commented 5 months ago

@kugon21 Easiest way is to install .NET SDK, and run dotnet publish -r win-x64 -o bin\pub in the directory containing the .csproj. Then the results are in bin\pub.

kugon21 commented 5 months ago

Thank you! I was able to get that working with that, thanks again for the help and the fix.