Search Unity

SVG Importer | Vector Graphics | Unity UI Supported [OPEN SOURCE]

Discussion in 'Assets and Asset Store' started by Jaroslav-Stehlik, May 4, 2015.

  1. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    You can PM me for a version of SVG Importer which support real-time import. I think that it would need only a handful of optimization.
     
  2. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    Could you send me please email with detailed info about your version of Unity, version of Plugin and version of OS?
    I can send you the latest build.
     
  3. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,
    Could you please send me the whole SVG so I can investigate it?
    http://svgimporter.com/contact/ you can find my email there.
    Thanks!
     
  4. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Great day folks!

    Please, take a look at our little puzzle platformer Mimpi Dreams
    Right now we are starting Steam Green Light.
    Would love to hear any feedback from you!


    OPEN STEAM GREEN LIGHT



     
  5. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    UnityEditor.Graphs.AnimationStateMachine.StateEditor.OnDisable AND?
     
  6. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    Good afternoon. Create an animation, like everything is OK, but the device no pictures or animations. What could it be? Thank you
     
  7. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there, you have probably patch version of unity, please install the latest stable version of Unity and it should be OK.
    If not, please contact me directly with more informations, thanks!
     
  8. Ikannuna

    Ikannuna

    Joined:
    Oct 4, 2013
    Posts:
    9
    Hi,
    I am using SVG Importer and it works great, thank you for making our jobs easier.
    Using the latest version of unity (5.3.2) and the latest version from SVG Importer from the asset store there is still the issue with 9-slicing. It was a while back that you were working on it, how is that progress going?
    Thank you
     
  9. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi there, does SVG work with WebGL and New UI? For example i want to use SVG Sprites to skin New UI Controls
     
  10. Max_power1965

    Max_power1965

    Joined:
    Oct 31, 2013
    Posts:
    127
    Hello,
    I'm working with the leatest unity version, the project it's exported correctly for iOS and Android, but when i'm trying to export it for windows phone, I got these errors:

    1. Assets\Plugins\SVG Importer\Plugins\Core\Implementation\XML Parser\SmallXmlParser.cs(550,53): error CS0246: The type or namespace name 'SystemException' could not be found (are you missing a using directive or an assembly reference?)


    2. Assets\Plugins\SVG Importer\Plugins\Core\Implementation\SVG\DOM\Utilities\DOMException.cs(51,32): error CS0246: The type or namespace name 'SerializationInfo' could not be found (are you missing a using directive or an assembly reference?)
    3. Assets\Plugins\SVG Importer\Plugins\Core\Implementation\SVG\DOM\Utilities\SVGException.cs(33,32): error CS0246: The type or namespace name 'SerializationInfo' could not be found (are you missing a using directive or an assembly reference?)
    I'm I missing something?? with the other platforms works without problems.
     
  11. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Hello, i have two questions:
    1. in general, does meshes performs better on older devices
    (from memory, gpu memory & render time point of view)
    (we found this plugin while trying to find a solution to support hd & sd graphics)

    2. does it support svg groups ?
    - (creating a mesh from a group of objects in inkscape)

    Thanks.
     
  12. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there,

    I have a much better version of 9slicing in my current version,
    so you can send me an email with your invoice number so I can send you the build.
     
  13. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there,
    SVG Importer works with webGL,
    even the demo is done with webGL.
    And also the UI is compatible with unity UI which you can
    see in the demo as well.

    http://www.svgimporter.com/demos/curves/
    Have a nice day!
     
  14. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi, please send me an email with your invoice number so I can send you new build.
     
  15. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there,

    1. Meshes are in general performant even on older devices, the thing which
    is more a problem is fillrate which is mostly caused by transparent graphics.
    that is the reason why SVG Importer also supports opaque rendering which can
    discard invisible pixels before the rasterizer tries to render them.
    Because meshes takes in most cases less space than textures, it is more
    memory efficient also saves a lot of disk space. Our game Mimpi Dreams
    is a good proof of concept that the whole vector graphics in the whole game
    take only 10MB and can be rendered in any resolution with good quality.
    http://www.mimpi-dreams.com/

    2. could you explain this question a little bit further?
     
  16. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    hi there,
    in inkscape, for easy editing, we group objects using ctrl+G,
    - we wanted to know if svg importer can convert them to one mesh automatically.
    Thanks.
     
  17. Max_power1965

    Max_power1965

    Joined:
    Oct 31, 2013
    Posts:
    127
    I've sent you an email, let me know if you have received it and when can I have the new build. Thanks
     
  18. SlothMachine

    SlothMachine

    Joined:
    Sep 17, 2014
    Posts:
    4
    I can't get it to work with Unity 4.7 :(
     
  19. syamilsynz

    syamilsynz

    Joined:
    Dec 22, 2013
    Posts:
    31
    I just brought this asset and try to follow the tutorial getting started. Use your example scene.

    And I try to add a 2D collider to some of the .svg file (eg: cloud) using SVG Collider 2D but it got an error in the inspector

    "the collider did not create any collission shapes as they all failed verification. This could be because they were deemed too small or the vertices were too close..."


    Can't even proceed the tutorial. How to fix this?
     

    Attached Files:

  20. tayloreichhorst

    tayloreichhorst

    Joined:
    Nov 14, 2013
    Posts:
    6
    Is there a way to access the color of the SVG Rendered through script?

    I don't see anything about this in the documentation. Maybe I missed it?
     
  21. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Could you please provide more information?
    Which version of plugin do you have and what errors do you see?
    Thanks!
     
  22. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    SVG Importer converts whole SVG file into one mesh so it is extremely easy to handle.
     
  23. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Did you enabled collisions on the SVG Asset it self?
     
  24. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    If you mean individual objects which you can recolour, that is something which I cam currently
    working on. SO it is highly under development.
     
  25. syamilsynz

    syamilsynz

    Joined:
    Dec 22, 2013
    Posts:
    31
    ya! didn't notice this part. Fix it. Thanks!
     
  26. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    Hey. When you create animation file is such a mistake


    InvalidOperationException: Operation is not valid due to the current state of the object
    System.Collections.Stack.Peek () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Stack.cs:321)
    UnityEngine.GUILayoutUtility.EndLayoutGroup ()
    UnityEngine.GUILayout.EndVertical ()
    UnityEditor.AnimEditor.OnBreadcrumbGUI (UnityEditor.EditorWindow parent, Rect position) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimEditor.cs:114)
    UnityEditor.AnimationWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindow.cs:47)
    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-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


    Thanks
     
  27. SlothMachine

    SlothMachine

    Joined:
    Sep 17, 2014
    Posts:
    4
    Version 1.1.1. These are the errors.

    And if I change all "#if !UNITY_4_6" to "!UNITY_4_7"
    I get this message and only pink objects, "Shader wants normals, but the mesh lion-mesh doesn't have them"
     

    Attached Files:

  28. Robbie999

    Robbie999

    Joined:
    Jul 30, 2015
    Posts:
    2
    Hi Jaroslav,

    First of all, congrats on building this very nice importer!
    I do however have a feature request which would make it even better for me:
    When creating artwork, I edit multiple objects in one drawing (I use Inkscape btw).
    As they need to be moved individually in the game, I need to save each part to a different SVG for Unity to import them as separate assets.

    I would really like to be able to group meshes related to their respective objects inside the SVG itself (using layers, or group elements). And on import, have them split out into separate assets (so one SVG file could result in multiple assets).

    Is this doable? And would it be useful to more users perhaps?

    Cheers,
    Rob
     
  29. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    I used SVG Importer for WebGL, and a simple circle is looking terrible on WebGL.
    Please advise

    Screen Shot 2016-02-09 at 3.36.29 PM.png Screen Shot 2016-02-09 at 3.39.03 PM.png Screen Shot 2016-02-09 at 3.36.29 PM.png Screen Shot 2016-02-09 at 3.39.03 PM.png
     
  30. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    Starting with version 5.3.0 is such a mistake when creating SVG animation.

    InvalidOperationException: Operation is not valid due to the current state of the object
    System.Collections.Stack.Peek () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Stack.cs:321)
    UnityEngine.GUILayoutUtility.EndLayoutGroup ()
    UnityEngine.GUILayout.EndVertical ()
    UnityEditor.AnimEditor.OnBreadcrumbGUI (UnityEditor.EditorWindow parent, Rect position) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimEditor.cs:114)
    UnityEditor.AnimationWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindow.cs:47)
    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-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  31. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thank you!

    I will definitely take a look at it.
     
  32. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Did you bought the plugin? This error is related only to old version of SVG Importer which is probably downloaded from a torrent site.
     
  33. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there,

    I absolutely understand your problem and yes there are more users with this request but
    I am really not sure how to solve this from the user perspective.
    As you know unity can work also with PSD files but you cannot work with individual layers in Unity
    or export layers to sprites in unity which is the same problem btw.
    The problem with this workflow is that for new users it is highly unpractical.

    This is only a design problem not an implementation problem.
    If you would have any ideas on how to operate such a solution I would be really glad.
     
  34. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
  35. Antti-Hamara-Sulake

    Antti-Hamara-Sulake

    Joined:
    Dec 31, 2014
    Posts:
    4
    I am bringing SVG file from the Adobe Illustrator to unity with ugui settings to UI.
    If I use scale 0.1 "Set Native Size"button will size element to correct size, but if I use 9-Slice scale in importer need to be 0.01 to get correct size in UI.
    Is there reason why scale needs to be different?

    I have used same document settings in AI and export settings that is on documentation.
     
  36. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    I have a problem with SVG canvas being ignored in UGUI even when I turn the "Ignore SVG Canvas" off in the imported. It shows everything from the outside of the canvas which is really ugly. It shows it properly in a web-browser or in the SVG Editor window.
     
  37. Robbie999

    Robbie999

    Joined:
    Jul 30, 2015
    Posts:
    2
    I'm only conversant with Inkscape so my suggested solution is based on that. I understand that a good implementation would need to support multiple drawing packages.

    I've added a sample Inkscape SVG file. Layers are represented by svg:g elements with inkscape:groupmode="layer":
    Code (CSharp):
    1. <g inkscape:label="Object B"
    2.      inkscape:groupmode="layer"
    3.      id="layer1">
    4.  
    The simplest solution I can think of would be to mimic the way Blender files are imported. Each file is represented as a root asset that expands into multiple child assets. Maybe this explosion into child assets could be optional, triggered by a tickbox called "Split layers into seperate assets" on the root asset. This way new users could continue using the importer as before.

    In the case of Inkscape, the name of the child asset could be a concatenation of the filename and the layer label name. So importing the example file would result in 2 child assets called example_Object_A and example_Object_B.
     

    Attached Files:

  38. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there,
    You found a bug, you can write me on my email http://svgimporter.com/contact your invoice number and email so I can send you the fix.
     
  39. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    SVG Importer v 1.1.1 Unity 5.3.2p2 What's next?
     
  40. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi, does it mean a 25x25 pixel shape with 100% view in illustrator appear exactly in Unity? Thanks
     
  41. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thank you, did you try to delete the old version and replace it with the latest?
    You can contact me directly with your invoice number so we can progress further with your issue.
    Thanks, have a nice day!
     
  42. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Its still terrible with 2000
     
    Last edited: Feb 14, 2016
  43. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    @Jaroslav Stehlik
    I was doing some profiling today while trying to find ways of optimizing my project for WebGL and I found a strange leaking of meshes coming from SVG Importer (as far as I can tell). I implemented a call to Resources.UnloadUnusedAssets(); between scenes and that helped with some other leaks I noticed, but the meshes still continued to increase. Actually, they increase through-out the use of the editor itself. After an hour of working I have almost 10k meshes in memory.
    Am I doing something wrong? Or is this a known issue?

    Edit: I profiled the standalone PC build and it does not appear to be happening there. Perhaps it is editor-only issue?
    Edit: In the profiler's detailed memory sample, the meshes pile up under "Not Saved > Mesh" and are all named some variant of "Instance -324231"
     
    Last edited: Feb 15, 2016
  44. Ikannuna

    Ikannuna

    Joined:
    Oct 4, 2013
    Posts:
    9
    Thanks! The new 9 slice works great :)
     
    Jaroslav-Stehlik likes this.
  45. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    I tried quality with 5000 but results are still terrible,


    Turning Pixel Perfect On = WebGL out of memory error and we dont want to turn Pixel Perfect On as it will be targetting toward mobile users too

    plz advise
     
    Last edited: Feb 15, 2016
  46. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    John,

    I did not understand what Pixel Perfect means to you?
    Do you mean antialiasing? On mobile, you can use antialiasing even on older devices.
    http://docs.unity3d.com/Manual/script-Antialiasing.html
    http://docs.unity3d.com/Manual/class-QualitySettings.html
    or you can turn it on in Unity or with script
    http://docs.unity3d.com/ScriptReference/QualitySettings-antiAliasing.html
    That should do the trick.

    Hope this helps!
     
  47. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi there,
    It is possible because in the editor the meshes are generated more often due to problems with
    some bugs which can cause disappearing the meshes from the scene. Which is really annoying.
    I hope that Unity editor will bring more unity events for fixing this bug.
     
  48. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    Ah I understand. Well for now it's not too bothersome. I was mainly concerned about it happening in standalone, but since I discovered it does not that means I can simply restart the editor if it stacks up too much.
     
  49. syamilsynz

    syamilsynz

    Joined:
    Dec 22, 2013
    Posts:
    31
    Hi Jaroslav,

    I got a bug in display SVG correctly when play mode in unity editor (android platform) in uGUI canvas.

    It display correctly in scene mode, but when I click 'play', the bug happen.

    Using a color gradient at the front and a collection of white/black rectangle on the back.

    You can see the image I upload and .ai.
     

    Attached Files:

  50. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    I tried it and I did not have the problem in playmode.
    Which version of Unity, SVG Importer and Operating System do you run?
    Thanks!