nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.21k stars 152 forks source link

Edit texture plugin crashes when trying to convert (same texture without replacing) from BC7 to any other format #314

Closed suphamster closed 8 months ago

suphamster commented 8 months ago

UABE 3.0 beta works, UABEA gives a crash.

System.NullReferenceException: Object reference not set to an instance of an object.
   at AssetRipper.TextureDecoder.Bc.BcHelpers.DecompressBc7(Byte* compressedBlock, Byte* decompressedBlock, Int32 destinationPitch)
   at AssetRipper.TextureDecoder.Bc.BcDecoder.DecompressBC7(Byte* input, Int32 width, Int32 height, Byte* output)
   at AssetRipper.TextureDecoder.Bc.BcDecoder.DecompressBC7(ReadOnlySpan`1 input, Int32 width, Int32 height, Span`1 output)
   at AssetRipper.TextureDecoder.Bc.BcDecoder.DecompressBC7(ReadOnlySpan`1 input, Int32 width, Int32 height, Byte[]& output)
   at AssetsTools.NET.Texture.TextureFile.DecodeManaged(Byte[] data, TextureFormat format, Int32 width, Int32 height, Boolean useBgra)
   at TexturePlugin.TextureEncoderDecoder.DecodeAssetRipperTex(Byte[] data, Int32 width, Int32 height, TextureFormat format)
   at TexturePlugin.TextureEncoderDecoder.Decode(Byte[] data, Int32 width, Int32 height, TextureFormat format)
   at TexturePlugin.TextureImportExport.Export(Byte[] encData, Int32 width, Int32 height, TextureFormat format, UInt32 platform, Byte[] platformBlob)
   at TexturePlugin.EditDialog.BtnSave_Click(Object sender, RoutedEventArgs e)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()
   at Avalonia.Threading.DispatcherOperation.Execute()
   at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job)
   at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback)
   at Avalonia.Threading.Dispatcher.Signaled()
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at UABEAvalonia.Program.Main(String[] args) in D:\a\UABEA\UABEA\UABEAvalonia\Program.cs:line 53 
nesrak1 commented 8 months ago

Should be fixed in latest commit

suphamster commented 8 months ago

Thanks, work fine now.