Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

SVG Importer | Vector Graphics | Unity UI Supported [RELEASED]

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

  1. vitorenes

    vitorenes

    Joined:
    Sep 17, 2013
    Posts:
    9
    Just in case anyone comes across the same problem:

    I got the "Cannot Load SVG Importer Settings! Please Move SVG Importer Settings into Resource folder." error while opening a project made in Unity 5.5 into 2017.1, that used a previous version of the SVG Importer asset.

    Nothing I did solve the problem, and Unity even crashed if I tried to apply settings to already imported SVG assets.

    After trying every other potential solution I found, I remembered this was a computer, and that computer tend to have weird behavior (as if they had some sort of personality), so I just deleted the whole plugin from the project and re-imported it afterward (contrary to just "upgrading" it to the newest version).

    It seems to have done the trick. I supposed some of the files were not being overwritten in the "upgrade" process, and at least now it is not throwing the error.

    Good luck if you've been here.
     
    Jaroslav-Stehlik likes this.
  2. BrainAndBrain

    BrainAndBrain

    Joined:
    Nov 27, 2014
    Posts:
    76
    Jumping in late here, is the latest SVG Importer 2017.01 compatible?
     
  3. pesiik

    pesiik

    Joined:
    Aug 10, 2015
    Posts:
    1

    Error in webGL demo
     
  4. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    23
    I have assets using gradients that display different colors depending from the scene they are in... it feels like they all share the same gradient texture and it gets mixed depending on how many objects using gradients are in the open scene... any solution to this or things that I'm missing?
     
  5. nerial

    nerial

    Joined:
    Jul 3, 2012
    Posts:
    1
    First, thanks for the quality of the plug-in and the support provided. Great job!

    I have an issue that appeared on the recent updates, specifically on mobile devices. The profiler tells me a couple of RenderTextures are generated by SVGImporter for no obvious reason (I don't have anything that could explain that sort of post-render process). So it's not huge (40-60Mo) but on middle-range iPad you feel that. When I switch back to 1.1.1 I don't have the issue.
     
    Last edited: Oct 31, 2017
  6. AndreaR

    AndreaR

    Joined:
    Nov 26, 2012
    Posts:
    2
    It's working for us on 2017.01f. We had a little issue with sorting that required a code tweak, but we're doing some weird stuff there, so it's probably unique to us. Happy to share if you have a sorting issue.
     
  7. AndreaR

    AndreaR

    Joined:
    Nov 26, 2012
    Posts:
    2
    I've seen similar issues. For me, at least, it's only been an editor problem. Restarting the editor or baking a build has always fixed it, so I just ignore it when it happens now.
     
  8. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    88
    It is working in 2017.2.0f3, but I can't get it to run with lights - none of the provided shaders seems to work. All diffuse shaders just display black shape and don't react to lights. What am I doing wrong?
     
  9. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    46
    Support seems to have seized again.

    In order to release a project we now had to kick out most svg icons and replace them with Unity UI image components because of the broken anti aliasing in screenspace canvases.
     
  10. Alejandro_P

    Alejandro_P

    Joined:
    Sep 8, 2015
    Posts:
    3
    Hi, did anyone experience issues with leaked meshes? I reported the bug including a project to reproduce it but didn't get any response. Maybe my email was marked as spam because I attached a zipped test project?

    I was just trying to fix some memory leaks in our apps (webgl build targets) and there seems to be some issues in the SVGImporter code.

    There’s just 2 scenes in the test project. I’m switching back and forth between scene 1 and 2. Every time I load a new scene, the meshes created for the SVGRenderers are not destroyed. You can see the mesh count incrementing on the profiler, every time I switch scenes.
    upload_2017-11-7_18-12-48.png
    In the profiler, under Not Saved > Meshes, you can see all the leaked ‘duplicates’ created every time I load the scene again:
    upload_2017-11-7_18-13-45.png


    There’s a mesh with 6 references, including the atlas, so maybe related to the atlas?
    upload_2017-11-7_18-14-20.png

    I’m using Unity 5.4.3, profiling the Webgl build (haven’t tried on other platforms)
     
    mikolajewskip likes this.
  11. pickassoreborn

    pickassoreborn

    Joined:
    Aug 20, 2015
    Posts:
    2
    Hello - just getting started with SVG Importer and already banging my head against a wall over the Stroke Renderer - seems to play nice with the SVG Renderer but when I point to an svg to display, nothing appears to appear or actually do anything. Any help regarding this would be great. Thank you.
     
  12. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello, that error looks weird because WebAudio is Unity Native Lib. I woudl recommend removing the example project .
     
  13. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello, does this happen only in the Editor or also on device?
    Which version of Unity? Which version of SVG Importer?
    Thank you!

    Just to provide help, this bug is related to updating SVG Atlas which is, in fact, a texture full of pre-rendered gradients.
    And inside Unity Editor the Atlas could be updated weirdly because it tracks references to assets so it can regenerate itself.
     
  14. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello,

    Does the antialiasing do not work in the latest version?
    Could you provide me more info? Thank you for your help!
     
  15. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello, I believe Unity 5.4.3 is no longer supported.
    But It would be good to know if this error is still present in Unity 2017 version.
     
  16. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello Folks!

    I personally think that I finally solved the SVG Renderer default overhead which the SVG Renderer had previously by default.
    Is there anyone who would like to try the new build as a beta tester?
    Thanks!
     
  17. Eidoboy

    Eidoboy

    Joined:
    Jul 3, 2012
    Posts:
    16
    Hi Jaroslav,
    I'm also experimenting this problem with anti-aliasing in screen overlay canvas. It looks good in the game view, but it breaks when I press the play button.
    I'm using the latest version of the package in Unity 2017.2.0f3
     
  18. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Thank you!
    Could you please send me stripped down example project with a screen shot?
    Thank you!
     
  19. Eidoboy

    Eidoboy

    Joined:
    Jul 3, 2012
    Posts:
    16
    I'm playing around a bit. The issue seems related to camera type instead of play mode. I started with an orthographic camera and the antialiasing change with orthographic size. An high orthographic size produced very blurred svg images, low doesn't get AA
     
  20. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    88
    @Jaroslav-Stehlik Great to see you here. Any idea why diffuse shaders don't work for me? Everything becomes pitch black.
     
  21. lexi89puzzle

    lexi89puzzle

    Joined:
    Feb 22, 2017
    Posts:
    9
    Hey @Jaroslav-Stehlik I'm thinking of moving my team to using SVG importer but I'm put off by the latest reviews on the Asset store about errors and slow support response.

    Can you please post an update about your (or your team's) status in terms of support and if you are updating to support the latest Unity releases? We always keep our Unity version up to date and don't want to be stuck with a broken tool after an update.

    Looking for some honest answers and expectations as this is a risky move for a studio like ours :) no hard feelings at all if you're thinking of moving on from this project as it seems like a lot of work.

    Thanks
    A
     
    defuncart, mountblanc and tosiabunio like this.
  22. dshook

    dshook

    Joined:
    Jul 14, 2015
    Posts:
    2
    A heads up for anyone using this with unity >= 5.6 and text mesh pro. SVG Importer is overriding the canvas additionalShaderChannels property instead of just adding to them causing blurry text in TMP.

    A simple patch to SVGImage.cs line 373 does the trick:
    Code (CSharp):
    1.  
    2.             if (_vectorGraphics.antialiasing || _vectorGraphics.generateNormals)
    3.             {
    4.                 canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1 | AdditionalCanvasShaderChannels.TexCoord2 | AdditionalCanvasShaderChannels.Normal;
    5.             }
    6.             else
    7.             {
    8.                 canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1 | AdditionalCanvasShaderChannels.TexCoord2;
    9.             }
    10.  
     
    bitcrusher and tosiabunio like this.
  23. Beex

    Beex

    Joined:
    Sep 2, 2012
    Posts:
    5
    Hi,
    Is there support for fillAmount feature in SVGImage?
    Thanks.
     
  24. mountblanc

    mountblanc

    Joined:
    Sep 24, 2015
    Posts:
    24
    Does anyone know if SVG works correctly in Unity 2017.2?
    I take it Windows builds are not supported ? I get a bunch of SVG errors trying to do a windows build.
    At this point i wish i never switched to SVG to be frank. due very lacking updates and support. Removing SVG from current project will probably take me about 20 hours as its a big part of my Avatar creator.
    20 hours I could have spend on other parts (Not to mention the many hours i spend on integrating SVG in the first place.)
     
    crudeMe and SmartMediaNL like this.
  25. BrainAndBrain

    BrainAndBrain

    Joined:
    Nov 27, 2014
    Posts:
    76
    Is SVGColorModifier performant, or is it not a great idea to use it in many places at once?
     
  26. Alejandro_P

    Alejandro_P

    Joined:
    Sep 8, 2015
    Posts:
    3
    I haven't tried 2017, I emailed a very simple project showing the error to the support email
     
  27. Alejandro_P

    Alejandro_P

    Joined:
    Sep 8, 2015
    Posts:
    3
    I think I fixed the leaks:
     

    Attached Files:

    tosiabunio likes this.
  28. BrainAndBrain

    BrainAndBrain

    Joined:
    Nov 27, 2014
    Posts:
    76
    @mountblanc We're using SVGImporter with Unity 2017.2p4, and its working okay. There are some minor issues with the SVGs not always refreshing in the editor, but aside from that it's been fine. The Windows error messages have been there for quite some time, and never cause an issue. We've shipped builds in Unity 5.6.3p4 (and others) with those errors and the Windows builds have played fine.
     
  29. TR33

    TR33

    Joined:
    Dec 27, 2016
    Posts:
    5
    Hi guys,
    just purchsed SVDImporter and ran into a problem. I'm using Affinity Designer by the way ;)
    All assets I exported so far have a major flaw. All outlines scale with the camera zoom. Is that fixable?
    Thx for the support and the awesome plugin :)
     
  30. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    88
    Well, during the import, the outline is changed into mesh as well thus has its original size no matter what camer size is. So if you zoom in, everything gets bigger, including outlines - those meshes are passive after and do not react to camera at all.
     
    Last edited: Dec 23, 2017
  31. TR33

    TR33

    Joined:
    Dec 27, 2016
    Posts:
    5
    Thx for answering but I don't get it. When I export a simple circle with white fill and with black stroke. Then import it into unity and zoom out, the stroke should NOT become wider (but it becomes). If I understood you right the svg file should be like an image. So don't change size at all. So to avoid this I should not use any strokes? Or could I change the original size of the strokes to .1 instead of 1 and have a workaround?
     
    Last edited: Dec 22, 2017
  32. mountblanc

    mountblanc

    Joined:
    Sep 24, 2015
    Posts:
    24
  33. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    87
    Hello and Happy New Year. We recently profiled the editor because we got complaints that it was taking too long to launch/play the game inside the editor. After some investigation, we found a couple of places in SVGImporterLaunchEditor class that consume almost 3-4 seconds at every launch.

    Over 2 seconds is taken up by the call to FindObjectOfType<SVGAtlas> in
    SVGImporterLaunchEditor.PlaymodeStateChanged()

    Around 1600 ms is taken when SVGImporterLaunchEditor is constructed during ReloadAssemblies. During construction it calls SVGImporterLaunchEditor.HideGizmos(), which invokes one very expensive call to
    GetAnnotations.

    Just wondering if these methods are necessary or perhaps things can be cached somehow?

    Thanks!
     
    Jaroslav-Stehlik and tosiabunio like this.
  34. Max_power1965

    Max_power1965

    Joined:
    Oct 31, 2013
    Posts:
    55
    Hello,
    I wanted to know how to improve the details of the following image:


    As you can see, the border of the circle is not detailed and sharp.
    These are the settings:


    I also tried to increase quality, but nothing changes.
    Thanks
    Marco
     
  35. helloworldgames

    helloworldgames

    Joined:
    Mar 16, 2017
    Posts:
    30
    Is SVG dead again?
     
  36. FlorentFal

    FlorentFal

    Joined:
    Nov 20, 2015
    Posts:
    12
    Hello,

    Do there's any plan for support Anima2D ? Maybe already the case ?
    Thanks
     
  37. mikolajewskip

    mikolajewskip

    Joined:
    Mar 29, 2017
    Posts:
    16
    @Jaroslav-Stehlik

    Could you please include following fix into code:


    SVG Importer/Plugins/Core/Implementation/SVG/DOM/BasicShapes/SVGCircleElement.cs
    @@ -79,6 +79,8 @@ namespace SVGImporter.Rendering
    public List<List<Vector2>> GetPath()
    {
    List<Vector2> output = Circle(cx.value, cy.value, r.value, transformMatrix);

    + if (output.Count == 0)
    + return new List<List<Vector2>>();

    output.Add(output[0]);
    return new List<List<Vector2>>(){output};
    }

    For some vectors we have problems with this and files are not imported at all.
    On the other hand - those files are readable by browser/illustrator/inkscape.


    This happens when circle has radius=0.


    <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="237.91602" height="173.91602" viewBox="0 0 237.91602 173.91602"><title>test_circle</title>

    <circle cx="65.08333" cy="65.08333" r="64.58333" style="stroke:#ef7d7d;stroke-miterlimit:10"/>

    <circle cx="227.95801" cy="163.95801" r="0" style="stroke:#684747;stroke-miterlimit:10"/>

    </svg>

    Second circle here has r=0. SVG fails to import. After patch -> it is just ignored.


    Thank you!

     
    Last edited: Jan 12, 2018
    Jaroslav-Stehlik and tosiabunio like this.
  38. AppTeck

    AppTeck

    Joined:
    Jan 31, 2018
    Posts:
    6
    I have the SVG assets imported to Unity, but when I drag them into the scene they won't show up in the Game "when I play the game", but I can see them in the scene tab? any suggestion?
     
  39. syamilsynz

    syamilsynz

    Joined:
    Dec 22, 2013
    Posts:
    29
    Hi,

    I'm having the problem where SVG Frame Animator always playing more frame that I don't want before reached frame that I need.

    For example, i put an animation for mouth. So the mouth got smile svg renderer at SVG Frame Animator 0, then I want to play animation mouth happy at SVG Frame Animator 7, however, the animation will play SVG Frame Animator between 0-7 (eg frame 4) before it play frame 7.

    How to fix this? The animation look so weird.

    Thanks.
     

    Attached Files:

    Jaroslav-Stehlik likes this.
  40. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    40
    This is still very much a problem, even in the newest version of Unity & SVG Importer... Have you gotten anywhere with this? It's been holding me back from updating my app for quite some time now, which is no bueno.
     
    Jaroslav-Stehlik likes this.
  41. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello,

    Could you please change the dope sheet to curves
    and see if there is any interpolation going on?
    If yes please select all keyframes,
    right click and both tangents
    and Constant

    that should do the work!
     
  42. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Great bughunt!

    Thank you sir!
    Will add in to new version.

    Please meail me on panfotograf@gmail.com for a new version to test
    if you want. Thanks!
     
  43. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello,

    SVG Importer has the possibility to extend SVG Modifier
    that means that someone could possibly write custom anima
    modifier for this reason.

    But I really do not want to depend on other libraries
    simply because depending on Unity changes was
    challenging enough...

    Thank you for your interest.
     
  44. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello,

    That is super strange.

    Could you give me Unity version,
    SVG Importer version?

    Do you see the SVG in the thumbnail?
    Maybe some stripped down project as zip?
     
  45. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    I believe you have to turn on antialiasing.


    Try watching this tutorial.
     
  46. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Those are some good perf reports!
    Thank you!

    I just disabled the Gizmo section because it was
    related to older Unity versions and in 2017
    should not be needed.

    It is weird that FindObjectOfType SVGAtlas
    is so slow...
     
  47. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello,

    Which version of Unity do you use?
     
  48. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    That is probably an antialiasing issues,
    Do you have turned on antialiasing on every asset?

    what version of Unity and SVG Importer do you run?
     
  49. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    481
    Hello,

    The lighting probably works but you have to disable antialiasing on the asset it self
    because it is not compatible...

    I had the same issue
     
    tosiabunio likes this.
  50. syamilsynz

    syamilsynz

    Joined:
    Dec 22, 2013
    Posts:
    29
    Hello @Jaroslav-Stehlik ,

    I already follow the steps but the problem still happen. I also try to do it with other project but the problem still occur. This problem happen when switch from play animation clip to other animation clip. Still don't know what cause that behaviour. so weird.
     

    Attached Files:

    Last edited: Feb 2, 2018