Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

Confirmed, the thumbnail issue is related to mesh bounds, so we can run a meshbounds check and inverse scale the mode, easy :) also found a bunch of disk write errors  that i thought were the cause for problems, but it's actually just you doing some maintenance on a null ref, and it's not actually causing any problems at all., it just happens to throw errors around the same time other things are breaking  :) 

(1 edit)

I would like to know what these disk write errors are that you're referring to.  After the thumbnails are generated, MAST does save each thumbnail as a PNG in MAST/etc/temp.  Is that what's throwing the error?

Error below, i looked at the code thinking this was the cause of blank images but as i played with the system further i realised it's because submesh model generation leaves the mesh bounds unchecked so really you just need to recalc bounds when importing, so that was next on my list of things to do.

Your code is just cleaning up some temp data but the method throws the Denied, because you're trying to delete a dir and my guess is those things are currently open by the engine etc, and for a couple of years now Unity has strongly recommended you don't write to the local project dir because of permission issues with Windows, now personally in my projects i _do_ but that's because i know how to set windows permissions and how to write code that doesn't invoke problems like this, which was a long trial/horror thing :)  for one thing don't shortcut file cleanup with a request to delete the entire directory and re-create it, a permission / security model will absolutely scream about that because it's massively aggressive, and specifically with the recursive flag, that's the sort of stuff that requires root administrator privs in any system because it can destroy an entire o/s partition in no time at all, what if the dir contains a broken link to the root? maybe a symlink won't do that but what about junctures or the 6 other types of low level system links? what about system links that don't exist yet? it's a fairly remote chance but the outcome is apocalyptic so that makes it mad high risk :)  and it's a design approach problem anyway so you don't even need that risk, a better option is to manage state caches, don't delete anything because you're forcing a rebuild and discarding "progress", which is wasteful, just manage what you're displaying and manage a cache queue so if something changes then invalidate that particular item and pick it up in your rebuild schedule.  So it does create thumbs anyway, it just doesn't orient the models so in my case they're miles from origin on this kitbash set and since most kitbashes come in this form i'm looking at coming up with a splitting system to handle this.

Also unity has some standard paths you can use for this sort of thing, StreamingAssets is where you write stuff like this, or the user path, I can understand why you wouldn't want to use the user path, that's the dumbest thing that has emerged from game development, as if a users profile capacity is infinite and that you want 5 gigs of save files per game to occupy your high priority offsite DR/backup schemes.

Here's your code that emits the error;
string paletteImagePath = MAST_Asset_Loader.GetMASTRootFolder() + "/Etc/Temp";
if (Directory.Exists(paletteImagePath)) { Directory.Delete(paletteImagePath, true); }
Directory.CreateDirectory(paletteImagePath)

then it's onto extending that interface,  I need all objects at all times :) I mean this is literally Unity's problem, horrific navigation systems, so if i have to use those same nav systems to locate my resources to put into your wonderful interface - it's just adding an extra step in an already nightmarish navigation hell, so i'll see what i can do and then ship the code over to you :) May need to modify the UI resizing code a bit, the most sensible setup for me is a vertical list snapped to the left, but the buttons resize too big and occupy a heap of screen real estate when you do that so i'll take the minimalist approach if i can and see about snapping those to mini icons by user interaction (usually the << icon)


The error (and note, i have given this dir all permissions available, admin/root with full management (similar to grant/super etc, the max possible) so that usually means it's a lock, and verifying just now that dir is locked. So the delete/create usage probably just locked the file node for that dir (but Unity can still see the content, oddly):

UnauthorizedAccessException: Access to the path "Assets\FSP\MAST/Etc/Temp" is denied.
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at <a8ed250850854b439cedc18931a314fe>:0)
System.IO.Directory.CreateDirectory (System.String path) (at <a8ed250850854b439cedc18931a314fe>:0)
MAST_Interface_State_Save.Save_Palette_State (System.Boolean forceSave) (at Assets/FSP/MAST/Scripts/Interface/MAST_Interface_State_Save.cs:46)
MAST_Interface.DisplayToolbarGUI () (at Assets/FSP/MAST/Scripts/Interface/MAST_Interface.cs:876)
MAST_Interface.OnGUI () (at Assets/FSP/MAST/Scripts/Interface/MAST_Interface.cs:615)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <a8ed250850854b439cedc18931a314fe>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <a8ed250850854b439cedc18931a314fe>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <a8ed250850854b439cedc18931a314fe>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:337)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:331)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:307)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:373)
UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:340)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:447)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:93)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:190)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

I really need to quit reading your posts when I first wake up lol

Mine throws no error.  If this is a permissions issue, it could be the location of your project in the Windows folder structure.  It may only allow Unity's native method of folder management.

I'm just attempting to clear the contents of MAST/etc/temp, so if there's a safer way than deleting/recreating the folder, please let me know.

Your post really was nightmarish to read on my phone though.  I was joking but not really about bullet points before.

lol ok :)  probably best i just write the code and send it to you :)

That would work!  I will add you as a contributor in a comment above the code block.