redbluegames / unity-mulligan-renamer

Mulligan Renamer tool for the Unity Editor allows for quick and safe renaming of many assets and gameobjects at once
MIT License
550 stars 57 forks source link

Sprites fail to rename when also renaming parent Texture #139

Closed edwardrowe closed 6 years ago

edwardrowe commented 6 years ago

Repro steps:

  1. Add a sprite into the bulk renamer
  2. Add its texture into the renamer
  3. Rename to new names

Observe FileNotFoundException:

FileNotFoundException: Could not find file "/Users/erowe/Development/unity-mulligan-renamer/Assets/RedBlueGames/MulliganRenamer/Tests/TargetAssets/HappyPathAssets/NumberSprites.png.meta". System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:305) System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:363) System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:167) System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding) (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string,System.Text.Encoding) System.IO.File.ReadAllText (System.String path, System.Text.Encoding encoding) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:587) System.IO.File.ReadAllText (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:582) RedBlueGames.MulliganRenamer.SpritesheetRenamer.RenameSprites () (at Assets/RedBlueGames/MulliganRenamer/Editor/SpritesheetRenamer.cs:108) RedBlueGames.MulliganRenamer.BulkRenamer.ApplyNameDeltas (System.Collections.Generic.List1 objectsAndNewNames, Boolean ignoreUndo) (at Assets/RedBlueGames/MulliganRenamer/Editor/BulkRenamer.cs:146) RedBlueGames.MulliganRenamer.BulkRenamer.RenameObjects (System.Collections.Generic.List1 objectsToRename, Boolean ignoreUndo) (at Assets/RedBlueGames/MulliganRenamer/Editor/BulkRenamer.cs:195) RedBlueGames.MulliganRenamer.MulliganRenamerWindow.OnGUI () (at Assets/RedBlueGames/MulliganRenamer/Editor/MulliganRenamerWindow.cs:389) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295) UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288) UnityEditor.HostView.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:107) UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:179)

edwardrowe commented 6 years ago

Fixed in develop-v1.2.0