Search Unity

SpriteSharp - Sprite Mesh Optimizer

Discussion in 'Assets and Asset Store' started by ZimM, May 24, 2015.

  1. pietrina

    pietrina

    Joined:
    Aug 22, 2015
    Posts:
    2
    Hi ZimM,

    If I have several sprites with alpha channel. I will use SpriteSharp on these sprites in Precise mode. The grid is nicely set up. It will cut all the way it should be, just as SpriteSharp does.

    The problem is that SpritePacker does not see this grid but the standard Unity does.
    When running the application in the editor, all the grids that SprteSharp made are converted to old grids from Unity.

    How to prevent this?

    This is visible in the editor if Shading Mode: Shading Wireframe is enabled. All is ok, but if I set play, all sprites lost grids from SpriteSharp and I see old Unity grids.

    Exporting grids modified by SpriteSharp will result in not merging into one sprite grid.
    (I use Unity 5.5.1)
     
  2. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Unity's Sprite Packer has this issue that it doesn't re-calculates sprite atlases when sprite meshes are modified. Just use the "Tools → Lost Polygon → SpriteSharp → Clear Sprite Packer Atlas Cache" menu item and the issue should be gone.
     
  3. pietrina

    pietrina

    Joined:
    Aug 22, 2015
    Posts:
    2
    Thanks it's working!
     
  4. Serpass

    Serpass

    Joined:
    May 10, 2017
    Posts:
    1
    Hey @ZimM

    I am using your tool for a school project to decrease the overdraw in my game. I love the tool and it works as a charm, but I have one problem.

    I have a LOT of sprites in my scene and almost every sprites has to be separated (override) because of the alpha.
    That works fine but now I have to assigns every single Alpha sprite to the parent sprite. Is there a fast way to do this in the editor?

    Now I am dragging the sprites in the scene, parent it and set the transform coordinates to zero, but this is a lot of work.

    On a other note, what kind of shader do you recommend for the opaque sprites to decrease overdraw?

    Thank you a lot for this awesome tool!!!! :D
     
  5. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Good news everyone!

    SpriteSharp has been updated to version 2.4.0, the update is already available on the Asset Store.

    Changelog:
    • Added Sprite Dicing feature that allows for tighter sprite atlas packing.
    • Added "Attach Alpha Sprites To Selection" menu item.
    • External changes to the database file are now detected, new and modified sprites are reimported accordingly.
    • Fixed issue with Rect Grid mode failing on scaled down textures.
    • Fixed Sprite inspector displaying incorrect previews when multiple sprites were selected.
    • Minor fixes and improvements.

    There is now :) Check out the new menu item:

    Tools → Lost Polygon → SpriteSharp → Attach Alpha Sprites To Selection

    SpriteSharp comes with "Sprites-Opaque" shader and material, they are good to go.
     
    mahdi_jeddi likes this.
  6. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Also, SpriteSharp now has a free evaluation version available. The only limitation is a dialog box that shows up every so often. So if you were unsure about whether SpriteSharp will fit your needs, you can try it out now.

    Just PM me on the forum, or send me an email at contact@lostpolygon.com, and I'll send you the package.
     
    Last edited: Nov 3, 2017
  7. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    45
    I tried the Free Evaluation version, and I'm getting an exception on any sprite that I'm trying. The exception is spamming the console as long as the sprite is selected in the project panel:

    UnityException: get_value is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject '럦'.
    See "Script Serialization" page in the Unity Manual for further details.
    롇.럦..cctor ()
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for 롇.럦

    TargetException: Non-static method requires a target.
    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:236)
    System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoProperty.cs:331)
    System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/PropertyInfo.cs:102)
    롇.럭.롇 (UnityEditor.Editor , Int32 )
    롇.롆.롎 ()
    롇.롆.OnHeaderGUI ()
    UnityEditor.Editor.DrawHeader () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:352)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1105)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1019)
    UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:358)
    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)

    NullReferenceException: Object reference not set to an instance of an object
    롇.롆.RequiresConstantRepaint ()
    UnityEditor.InspectorWindow.Update () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1482)
    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 C:/buildslave/unity/build/Editor/Mono/HostView.cs:262)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
    UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:330)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)

    I'm on Unity 5.6.0p4 64bit, Windows 10.
     
  8. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Thank you for reporting. Please re-download, the issue should be fixed now.
     
  9. CaelumNoctis

    CaelumNoctis

    Joined:
    Nov 3, 2016
    Posts:
    25

    Getting this error in the latest Evaluation Version. On Unity 5.5.2f1
     
  10. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Hm, just imported in a new project in Unity 5.5.2p4 on Windows and in Unity 5.6.0.f3 in OS X, seems to work fine for me... Strange. Is that the entire exception message, or is there anything else? What OS do you use? Could you try importing in a new empty project and see if it works then?
     
  11. dothem

    dothem

    Joined:
    Feb 28, 2016
    Posts:
    22
    Better than last version, but receiving following. Did I something missing?

    Code (CSharp):
    1. Unhandled Exception:
    2. Mono.CSharp.InternalErrorException: Failed to import assembly `LostPolygon.SpriteSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.ArgumentNullException: Value cannot be null.
    3.  
    4. Parameter name: name
     
  12. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    @mahdi_jeddi
    @CaelumNoctis
    @dothem
    I've managed to finally track down the source of the issue, fixed it. Please re-download, should work fine for everyone now :)
     
  13. CaelumNoctis

    CaelumNoctis

    Joined:
    Nov 3, 2016
    Posts:
    25
    So, the evaluation version is working good now, thanks for that.

    I've spent all day setting all of our sprites with SpriteSharp (without testing first...) and it seems like packing the sprites into atlases ruins the new meshes. All the sprite meshes revert to their default unity ones as soon as I enter Play Mode. Removing the Packing Tag from the sprites fixed it but, of course, I want to use Sprite Atlases AND SpriteSharp. :)

    Also, it takes almost 3 minutes just to enter Play Mode after I installed this tool and I have no idea why.

    I'll keep trying for an hour. Will report back.
     
  14. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    The issue lies in the Sprite Packer itself, not in SpriteSharp, but there is a workaround:
    That's pretty strange. I can't reproduce this issue, but it might be somehow related to the additional protection that the evaluation version has, since I've never heard about this issue from users of the paid version. I'll try to investigate if I can somehow reduce the overhead.
     
    Last edited: May 18, 2017
  15. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    724
    Hi, I have some questions about sprite packer.

    I'd like to use the sprite packer for leaves at normal 3D trees. 1) Would it possible to simply select a texture with alpha and SP would cut out the opaque areas into a single mesh? 2) And would it possible to have a threshold/sensitivity value to reduce shard edges, to prevent creating a pixel based high poly count mesh?

    leaf-leaves-branch-acacia.png

    Is it possible to test with the evaluation version?
    Thank you!
     
  16. dozhwal

    dozhwal

    Joined:
    Aug 21, 2014
    Posts:
    54
    hi ! i would like to test the evaluation version if possible ! thx
     
  17. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    It might be possible, but for a texture like this, it isn't really going to work. There area of opaque pixels is way too low, so you'll probably end up with a high-poly mesh anyway, negating the performance gain. There are options to change sensitivity and how the mesh is generated, though, so perhaps you might be able to do it with some tweaking.
    Just PM me with your email and I'll send you the evaluation package.
    PM me with your email and I'll send you the evaluation package.
     
    Quatum1000 likes this.
  18. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    I want to use SpriteSharp's rect grid options but only on some props. The ones I use a shader on.

    These props will be placed in a certain folder, for this I use the AssetPostprocessor.
    So I have the sprites and access to their options, what do I do to set the SpriteSharp RectGrid options on those sprites now?

    Here's the example of what I want to use:

    Code (CSharp):
    1.     public class AssetProcessor : AssetPostprocessor
    2.     {
    3.  
    4.         public void OnPreprocessTexture()
    5.         {
    6.             // Apple settings to all atlases
    7.             if (assetPath.Contains(TEXTURES_FOLDER))
    8.             {
    9.                 if (assetPath.IndexOf(TEXTURES_FOLDER, StringComparison.Ordinal) == -1) return;
    10.  
    11.                 TextureImporter textureImporter = (TextureImporter)assetImporter;
    12.                 textureImporter.textureType = TextureImporterType.Sprite;
    13.                 textureImporter.mipmapEnabled = true;
    14.  
    15.  
    16.                 if (assetPath.Contains("_veg_"))
    17.                 {
    18.                     // apply spritesharp settings and set to RectGrid
    19.                 }
    20.             }
    21.         }
    22. }
     
  19. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Try something like this. Feel free to ask questions if something is not clear.
    Code (CSharp):
    1.  
    2. using System;
    3. using System.Collections.Generic;
    4. using System.Linq;
    5. using LostPolygon.SpriteSharp.Processing;
    6. using LostPolygon.SpriteSharp.TightMeshSettings;
    7. using UnityEditor;
    8. using UnityEngine;
    9.  
    10. public class TestFolderAssetPreprocessor : AssetPostprocessor {
    11.     private string TEXTURES_FOLDER = "Assets/MyFolder";
    12.  
    13.     public void OnPreprocessTexture() {
    14.         // Apple settings to all atlases
    15.         if (assetPath.Contains(TEXTURES_FOLDER)) {
    16.             if (assetPath.IndexOf(TEXTURES_FOLDER, StringComparison.Ordinal) == -1) return;
    17.  
    18.             bool mustReimport = false;
    19.             TextureImporter textureImporter = (TextureImporter) assetImporter;
    20.  
    21.             // Ensure the texture is in Sprite mode
    22.             if (textureImporter.textureType != TextureImporterType.Sprite) {
    23.                 mustReimport = true;
    24.             }
    25.             textureImporter.textureType = TextureImporterType.Sprite;
    26.             textureImporter.mipmapEnabled = true;
    27.  
    28.             // Reimport if it was not in Sprite mode
    29.             if (mustReimport) {
    30.                 EditorUtility.SetDirty(textureImporter);
    31.                 textureImporter.SaveAndReimport();
    32.             }
    33.  
    34.             mustReimport = false;
    35.  
    36.             if (assetPath.Contains("_veg_")) {
    37.                 IEnumerable<Sprite> sprites = AssetDatabase.LoadAllAssetsAtPath(assetPath).OfType<Sprite>();
    38.                 foreach (Sprite sprite in sprites) {
    39.                     SpriteTightMeshSettings settings = LostPolygon.SpriteSharp.Database.DatabaseProxy.Instance.GetTightMeshSettings(sprite);
    40.  
    41.                     // Enable SpriteSharp
    42.                     if (!settings.DefaultTightMeshSettings.IsOverriding) {
    43.                         settings.DefaultTightMeshSettings.IsOverriding = true;
    44.                         mustReimport = true;
    45.                     }
    46.  
    47.                     // Use Rect Grid method
    48.                     if (settings.DefaultTightMeshSettings.ProcessingMethod != SpriteProcessingMethod.RectGrid) {
    49.                         settings.DefaultTightMeshSettings.ProcessingMethod = SpriteProcessingMethod.RectGrid;
    50.                         mustReimport = true;
    51.                     }
    52.                 }
    53.             }
    54.  
    55.             // Reimport if there were any changes
    56.             if (mustReimport) {
    57.                 EditorUtility.SetDirty(textureImporter);
    58.                 textureImporter.SaveAndReimport();
    59.             }
    60.         }
    61.     }
    62. }
    63.  
    64.  
     
    FeastSC2 likes this.
  20. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Good news everyone!

    SpriteSharp has been updated to version 2.5.0, the update is already available on the Asset Store.

    Changelog:
    • Added "Opaque Alpha Tolerance" property to the Alpha Separation method.
    • Added Alpha Source Channel property, it defines the channel used for generating the mesh outline.
    • New database is now created relative to the SpriteSharp folder even if it was moved.
    • Fixed crash on Unity 2017.2 when closing the Editor.
    • Fixed an exception when SpriteSharp is moved to a directory with spaces in it.
    • Fixed overriding Polygon sprite type mesh.
    • Minor fixes and improvements.
     
    FeastSC2 likes this.
  21. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    Thanks for helping out ZimM,
    I have downloaded the latest SpriteSharp 2.5 version but these 2 includes are still not found by my IDE:
    "using LostPolygon.SpriteSharp.Processing;
    using LostPolygon.SpriteSharp.TightMeshSettings;"
     
  22. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    But does it compile in Unity with no errors? If yes, then the problem is with your IDE. I just imported SpriteSharp 2.5.0 and this example script in a new empty Unity project, and it worked fine in Visual Studio 2017. Try to close your IDE, delete all generated project files (*.sln, *.csproj, .vs etc) and open the project again in your IDE.
     
  23. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    I deleted all generated project files (*.sln, *.csproj, .vs etc), that's not it.
    Unity gives LogErrors stating that it doesn't find the namespaces.
    https://i.imgur.com/MlcJEVy.png
    I thought something might not have imported well but deleting and reimporting SpriteSharp didn't fix the issue.
    https://i.imgur.com/UVAG79U.png
    https://i.imgur.com/oxJFb6J.png

    EDIT: I'm going to create a new project too I'll update my post when that's done.
     
  24. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    That script is an editor script. As with other editor scripts, you have to put it into subfolder named Editor. That's the issue.
     
  25. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    Oops! Thanks a lot!
     
  26. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    One last thing, sorry for the trouble:
    Upon import, I still have to click Override for the settings to be applied (as showed in this gif).
    https://i.imgur.com/tIVott1.gifv
    Once I click on "Override" all the settings are set as they should be.
     
  27. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Not really, the Inspector is just unaware of the changes made by the script. Just deselect/select the sprite so the Inspector reloads, and you'll see the changes.
     
  28. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    Deselecting doesn't refresh for me and when I use it in my game as is the mesh is not subdivided, here's a gif showing that it's not updating upon deselection: https://i.imgur.com/6N38ij1.gifv
     
  29. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    In the video, you are not reimporting the textures. Sprites that are already imported won't update automatically, of course, since AssetPostprocessor is not called for them. Clicking the Apply button triggers a reimport and actually applies the settings from the script.
    Basically, just use Reimport from the context menu on the entire folder to do the initial setup. It will work automatically on new sprites.
     
    FeastSC2 likes this.
  30. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    261
    Would the highest precision setting with a perfect circle sprite be precise enough to use an opaque shader? As in maybe <5% overdraw max?
     
  31. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    We have to port a game from PC to mobile. The project is using SpriteSharp 2.3.4.0. Is it safe to update to the newest version or are there breaking changes? We don't want to spend too much of our time budget on this task.

    Thanks.
     
  32. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Yes, that is not a problem. If you want, PM me, and I'll send you a free evaluation version for you to test it out.
    Unless you are using SpriteSharp from code, it is safe to upgrade. Otherwise, there are breaking changes in the API, but nothing too major.
     
  33. fabri1983

    fabri1983

    Joined:
    Sep 29, 2015
    Posts:
    1
    HI. I'm interesting in buying this utility for a 2d matching-line mobile videogame. Does it work with latest Unity version 2017.2 ? Will I be able to upgrade to future versions without any cost?
    Sometimes an Unity update breaks your dll and it won't work anymore. Will I get any upgrade to continue using the utility?
    Thanks!
     
  34. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    What made you decide to restrict this to only sprites? Couldn't this also be used on quads or planes?
     
    Quatum1000 likes this.
  35. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    724
    Copy that!

    Was not abe to use on a simple plane. So I never brought it.
     
  36. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Um... I'm not sure I understand you guys. How could SpriteSharp be applied to quads or planes? The whole point of tight meshes is to *not* use quads or planes in order to reduce overdraw. If you want to use MeshRenderer instead of SpriteRenderer, then you can do that - just export the geometry to a Mesh.
    Yes, it does work with Unity 2017.2. If Unity update breaks something, I will make a fix. And upgrades are free, of course.
     
  37. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    724
    I don't understand why you try to explain here. Why I need a mesh renderer to have a "sprite shaped" mesh from a texture? I have only a texture, and the result should be a mesh (exported automatically to my fav location) . And done.
     
  38. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Because "using SpriteSharp on a simple plane/quad" is not the same as directly exporting a mesh from a texture, and the former made no sense to me. So as to answer your question about why is it not implemented yet. First - SpriteSharp was not designed to add any functionality - it only extends an existing Unity system. Second - for 3 years no one has requested that kind of feature, so I'm now surprised that there is a demand for it.
    Still, I'm not sure what's the use case for the feature you propose. What can you do with MeshRenderer that you can't do with SpriteRenderer? I might be missing something, and if there is a valid use case - I'll consider implementing it.
     
    Last edited: Jan 31, 2018
    FeastSC2 likes this.
  39. 39thstreet

    39thstreet

    Joined:
    Jan 30, 2012
    Posts:
    96
    Hello! Do you have any examples/documentation on this feature? It's pretty much the only thing I'm looking for from SpriteSharp ( I'd use the others, but am unlikely to have any performance problems there ). Doesn't look like Unity has any intention of adding this, and 2dtoolkit which I've been using appears to be waning, would love a solution that does sprite dicing and integrates seamlessly with Unity's own sprites.

    Thanks in advance!
     
  40. Talgame

    Talgame

    Joined:
    Oct 19, 2015
    Posts:
    2
    Hi, should I have to modify every sprite by hand to override it? Or setting it in preferences will do the trick? Because I don't know at the moment if anything changed at all. Vertex count is the same.
     
  41. TitoOliveira

    TitoOliveira

    Joined:
    Aug 4, 2014
    Posts:
    38
    I'm using the tool for a couple of days now.
    One thing that has been a bit of a hassle for me, is that when using the Alpha Separation method the object with the alpha image that becomes the child of the opaque one doesn't inherit the Flip property of the parent's Sprite Renderer.
    So i have to go object by object setting the flip option for the alpha sprite.
     
    Last edited: May 1, 2018
  42. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    598
    I have an error that I can't seem to get rid of. How can I fix it?
    Suddenly sprite sharp stopped working and is flooding me with errors, I can't simply remove it from my project because I heavily rely on it.
    Please help!


    Code (CSharp):
    1. Exception when filling SpriteSharpDatabase with JSON data
    2. System.ArgumentException: An element with the same key already exists in the dictionary.
    3.   at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (.TKey key, .TValue value) [0x0007e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404
    4.   at System.Collections.Generic.Dictionary`2[TKey,TValue].System.Collections.IDictionary.Add (System.Object key, System.Object value) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:671
    5.   at LostPolygon.SpriteSharp.fastJSON.deserializer.CreateDictionary (System.Collections.Generic.List`1 reader, System.Type pt, System.Type[] types, System.Collections.Generic.Dictionary`2 globalTypes) [0x00000] in <filename unknown>:0
    6.   at LostPolygon.SpriteSharp.fastJSON.deserializer.ParseDictionary (System.Collections.Generic.Dictionary`2 d, System.Collections.Generic.Dictionary`2 globaltypes, System.Type type, System.Object input) [0x00000] in <filename unknown>:0
    7.   at LostPolygon.SpriteSharp.fastJSON.JSON.FillObject (System.Object input, System.Object decodedJson) [0x00000] in <filename unknown>:0
    8.   at LostPolygon.SpriteSharp.Database.DatabaseProxy.LoadFromFileRaw (System.String databaseJson) [0x00000] in <filename unknown>:0
    9. UnityEngine.Debug:LogErrorFormat(String, Object[])
    10. LostPolygon.SpriteSharp.Database.DatabaseProxy:LoadFromFileRaw(String)
    11. LostPolygon.SpriteSharp.Database.DatabaseProxy:LoadFromFile(Boolean)
    12. LostPolygon.SpriteSharp.Processing.Internal.SpriteImportManager:ExecuteDelayedImportOperations(Boolean, Boolean)
    13. LostPolygon.SpriteSharp.Processing.Internal.SpriteImportPostProcessorImpl:OnPostprocessAllAssets(String[], String[], String[], String[])
    14. LostPolygon.SpriteSharp.Processing.Internal.SpriteImportPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[])
    15. UnityEditor.AssetPostprocessingInternal:postprocessAllAssets(String[], String[], String[], String[], String[])
     
  43. markv12

    markv12

    Joined:
    Dec 31, 2013
    Posts:
    8
    As far as I can tell, Sprite Sharp changes don't get saved to the database until you quit Unity. "Save Project" and "Save Scene" don't seem to do it.
    Is this unavoidable? It is inconvenient to have to quit Unity before I commit.
    I'm using Unity 2018.1.6
     
  44. LucidDreamsStudio

    LucidDreamsStudio

    Joined:
    Sep 21, 2018
    Posts:
    6
    Hello,

    We just purchased your asset and we love it very much! With Alpha Separation, we were able to optimize our rendering to reach 60 FPS.

    This is our game: https://www.luciddreamsstudio.com/legends-of-ethernal/

    We have one bug that we can't figure out though. When we use Alpha Separation and submit the changes (database + images) on Collab it does not seem to submit the (Alpha) mesh. When we sync on another machine the (Alpha) mesh is the same as the Opaque one. We have the same behavior with the Cloud Builder. Is it something you are aware off and do you know how to fix this?

    Thanks!
     
    Last edited: Nov 27, 2018
  45. squall-leonhart

    squall-leonhart

    Joined:
    May 5, 2017
    Posts:
    20
    Hi,

    I am new to SpriteSharp and want to ensure that I am doing correctly. Below were the steps I did

    1. Import the package into Unity project
    2. To tune project wide settings go to Edit-Preferences->SpriteSharp -The settings here would affect all the sprites in the project
    3. To override the project wide settings in (2) goto the individual sprite and check the manual override settings

    I did nothing with the Tools->LostPolygon->SpriteSharp menu options because I use a third party Sprite Packer component to create my spritesheet. I do occasionally re-import the assets though.

    That's about it, when I run the game in the editor I can’t find any performance differences at all, hence I am writing to ensure I did not miss anything.

    FYI I am still using Unity 5.6.6 if it matters
     
  46. Thompson11

    Thompson11

    Joined:
    Oct 31, 2012
    Posts:
    6
    Hey @ZimM big fan of the tool, seems broken in 2018.3 any chance of a patch/update?
    Regards,
    Ian
     
  47. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    67
    I’m using SpriteSharp with 2018.3.0f2, everything ok. What exactly do you mean by saying "broken"?
     
  48. Thompson11

    Thompson11

    Joined:
    Oct 31, 2012
    Posts:
    6
    Interesting, if you import a new sprite does spritesharp still cut it up?

    our existing sprites are fine, its new ones, it isn't slicing them.
     
  49. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    67
    Yes, just checked, everything ok.
     
    Thompson11 likes this.
  50. Thompson11

    Thompson11

    Joined:
    Oct 31, 2012
    Posts:
    6
    Okay, thanks for checking. I will try starting from the beginning and see if I can work out a reason why it wouldn't be working for me.

    **EDIT** problem is fixed, problem was on our side not with SpriteSharp.
     
    Last edited: Jan 11, 2019