TexTools / FFXIV_TexTools_UI

GNU General Public License v3.0
391 stars 64 forks source link

InvalidCastException when importing or exporting Paintings #34

Closed ghost closed 3 years ago

ghost commented 3 years ago

In version 2.3.4.19, attempting to export or import any Painting's textures results in the following exception followed by a full program crash.

System.InvalidCastException: Unable to cast object of type 'xivModdingFramework.Items.DataContainers.XivFurniture' to type 'xivModdingFramework.Items.DataContainers.XivCharacter'.
   at FFXIV_TexTools.ViewModels.TextureViewModel.<Export>d__105.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FFXIV_TexTools.Views.TextureView.<ExportTextureButton_Click>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at FFXIV_TexTools.App.Main()

Similarly, attempting to use any of the Material buttons results in "An error occurred when trying to modify the material. Error:Object reference not set to an instance of an object.", though the program recovers in these cases.

Fhurai commented 3 years ago

To add to the issue I encounter too, thoses messages image image image

I try to import file to change the texture of the Voor Siran Painting by the way, if this can help

Squall-Leonhart commented 3 years ago

Still present in 2.3.4.23

Luna664 commented 3 years ago

It shows me this message when I import since the last update

image

Fhurai commented 3 years ago

Confirmation of the problem pointed above. The importation menu can be opened for a painting but when the file to import is selected and the button to import is clicked, cast error is shown.

Lunaretic commented 3 years ago

Previous patch seems to have fixed this for export, but not Import.

Lunaretic commented 3 years ago

Fixed in 2.3.5.9