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. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Jaroslav Stehlik Hello. did you get a chance to take a look at the project I put in Dropbox?
     
  2. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    I am really sorry, I forgot to reply to your email. I wanted to send you the latest version,
    But now you can download version 1.1.0 on the Asset Store. It was updated just today.
    There is a new shader called SolidColorDiffuseOpaque
    SVG Importer/SolidColor/SolidColorDiffuseOpaque
    and that should work,

    There is a limitation which I discovered lately that it is almost impossible to support full unity lighting system
    on fully or semi-transparent objects because it creates the artefact which you discovered,
    the invisible parts which show up are actually a natural phenomenon of the lighting shader passes
    which is not possible to fix without some limitations. We can make a transparent shader which will support 1 light but more lights would be very inefficient without the artefacts.

    Again, I am really sorry that I forgot to reply to your email. Please accept my apology.
    Best regards!
     
  3. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hi Jaeoslav. Thanks for the help.

    But I am confused. I was using only one light. And my SVG asset was not fully or semi-transparent it was opaque (that's what I set it to in the SVG inspector) . So what was I doing wrong or what was I doing that is not supported?
     
  4. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    The SolidColorDiffuseOpaque shader did the trick. Thanks.
    As for the Sorting settings: Since the Unity sorting does not work on Opaque objects am I correct in assuming that under Unity Sorter, Sorting Layer and Sorting Order have no effect, and also under SVG Sorter, Override Sorter also has no effect on opaque objects?
     
  5. kasskata

    kasskata

    Joined:
    Sep 28, 2015
    Posts:
    2
    We are very pleased for the quick response.
    We need it by the end of January.
    Could you make it?
     
    Last edited: Dec 2, 2015
  6. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    SVG Sorter supports Opaque Objects
    But every SVG renderer gameobject has to be put in the SVGsorter gameobject
     
  7. FIFTYTWO

    FIFTYTWO

    Joined:
    Oct 21, 2014
    Posts:
    21
    Hi Jaroslav. New update is really awesome! Antialiasing is amazing. Now we use it for all UI elements so they look great. Thanks for fixing all issues we posted to you and adding all these new features. SVG Importer is so cool tool. Wish you good luck!
     
    Jaroslav-Stehlik likes this.
  8. vitorenes

    vitorenes

    Joined:
    Sep 17, 2013
    Posts:
    11
    Hello Jaroslav!

    First of all, and as has been said so many times, thank you SO MUCH for a great asset! Keep up the awesome work. Also, it was really nice to meet you (back in Unite Europe - Amsterdam), after your delightful session, which led me to buy the asset in the first place!

    I just had a very weird experience with an SVG asset, and maybe you could shed some light on the issue (I scanned this entire thread looking for previous related posts but found none - hopefully I didn't miss it and I am not double posting).

    I am working on a project, and just updated the SVGImporter asset to the latest version. Now, I am not 100% sure this started to happen AFTER the update, since I had not imported any new assets for a long time, but today I needed to add a new asset (a very simple SVG graphic for a button) so I saved it out of Adobe Illustrator CC (as I did with the previous assets), and dragged it into the Unity Editor (to a folder where I keep the other SVG assets). So far, all was good, as always had been.

    But then it got weird.

    I noticed the icon/avatar/preview for the asset (on the editor) was a different shade (it looked a lighter color) than the other, equally-colored buttons (all these buttons are copies of the same shape, with different icons over it); at first I thought I had messed up somehow on exporting, so I saved the scene I was working on to go check the file on Illustrator... and I noticed that in the console I had a "notification warning" that read as follows:

    "Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    Mesh has been leaked 2 times.
    Mesh Circle Fill has been leaked 1 times.
    Mesh Path Fill has been leaked 1 times."

    Again, I thought this was related to the file I just exported, so I went and checked the settings, etc., all looked good, tried again, same thing. THEN I tried with one of the (original) files I had already imported before (currently sitting comfortably as assets on the project) and the SAME thing happened again: the preview looks "lighter colored", and the "error/notification" appears. And when you double-click the warning on the console, a different "object" (according to the imported file) appears on the Inspector - in one case, for example, it showed as a "Path Fill" with some weirdly distorted version of the icon that is part of the asset. Of course, the referred item does NOT appear on the hierarchy, and there is no way to erase it, apparently.

    I then deleted the recently imported asset, but the error kept showing up every time I saved the scene. Tried again, same behavior. Weirder: I then closed the editor, without erasing the asset, and when I opened the project again, there was the asset (with the weird color on preview) and the error was gone! Even weirder: when placing the asset on the hierarchy, it renders perfectly, good color, and in general behaves exactly as expected - save for the weird preview. And even on a clean, new project, with JUST the SVGImporter package added, this behavior still happens.

    This was tested both on Windows (10) and Mac OS (10.11), with Unity 5.2.2f1 (Personal) and the current version of SVGImporter (reported by the Asset Store as 1.1.0).

    Any ideas? It is not "bad" per se, since everything seems to be working OK, but it is VERY annoying for me at this point in the project, and it certainly gives me a little apprehension - I fear whatever is causing this "warning" comes later to bite me in the behind, so to speak.

    Thanks in advance for any help. If there is any information missing that might help you help me, please let me know, I'll try to provide it ASAP.
     
  9. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Contact me please on my Skype, so we could look at the problem together.
    Thanks for the detailed post I really appreciate that!

    Please contact me on my email.
    http://svgimporter.com/contact/
     
  10. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    113
    Hi Jaroslav, in 3.1 "Keep svg file" does not explain why I would want to do this, do you not want to always exclude the svg file?

    Another perhaps silly question, but for the mesh AA would it be possible to add the faded geometry within the original geometry so that the size does not change?

    Great asset allround though, thanks!

    Bas
     
    Jaroslav-Stehlik likes this.
  11. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    Thanks for the hint!
    If you don't need the original SVG text file then definitely turn of the option so you can decrease the file size.

    This is a good point, right now I don't know how to implement it because the center and pivot point
    is calculated based on the mesh bounding box, but there is an option called
    "ignore canvas" and if you turn off this option, the SVG will respect the original canvas size and
    ignore the mesh bounding box, which can help.
     
  12. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    113
    Yeah, I am wondering what I would gain from including the svg text file, are there uses cases for doing this?

    Im not quite sure I understand, would it not be possible to maintain the exact mesh shape? So instead of adding a small layer on the outside, add it on the inside?
     
  13. Sampl819

    Sampl819

    Joined:
    Dec 11, 2015
    Posts:
    4
    UGUI mode are all displayed in pink
     
  14. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Could you please elaborate which version of Unity and OS are you using? Thanks!
     
  15. Sampl819

    Sampl819

    Joined:
    Dec 11, 2015
    Posts:
    4
    4.6.9f1 and Windows 7 x 64
     
    Last edited: Dec 11, 2015
  16. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thanks! I will check that. This version of Unity I did not tested yet.
     
  17. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi, I am not able to reproduce the problem. I just installed Unity 4.6.9f1 on Mac and it works.
    Does this happen in the editor or only on the device?
    Thanks. Please try to remove the plugin and reimport it if that helps.
     
  18. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    128
    Just bought the asset and seems to work well out of the box which is great. I am though getting errors when building: Shader error in 'SVG Importer/Standard SVG': Program 'fragForwardBase_SVG', error X4506: ps_4_0_level_9_1 input limit (8) exceeded, shader uses 9 inputs. (on d3d11_9x). It does not seem to stop the build from completing running though is a bit of a worry.
     
    ibyte likes this.
  19. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    which version of Unity do you run and what is your build target? Thanks!
     
  20. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    128
    I'm on 5.2 building for desktop 32bit.
     
  21. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thanks, for the info!
    If you see any problems please report them to me. But this message should not be basically harmful.
     
  22. ThatVectorGuy

    ThatVectorGuy

    Joined:
    Mar 15, 2015
    Posts:
    7
    Hi Jaroslav!
    I was just looking at your asset, and man it does look good!
    I'm on the edge to buy it but have one question. Have you any plans on supporting: filter 'blur, bevel, drop shadow, glow and texture images in the future? thanks!

    Kenneth
     
  23. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi!

    Thanks! Unfortunately not, these effects are hungry for performance especially in real-time.
    I would highly suggest using prerendered sprite with the effect which is far more efficient
    than doing anything like this in real-time.
     
    ThatVectorGuy likes this.
  24. ThatVectorGuy

    ThatVectorGuy

    Joined:
    Mar 15, 2015
    Posts:
    7
    Okay, thanks for the insanely fast answer! Still gonna buy you asset ;-)
     
    Jaroslav-Stehlik likes this.
  25. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,
    This assets really sounds great ! I was wondering if it works when re-scaling assets in-game ? Will it keep the assets crisp ?

    Thanks
     
  26. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    It depends on what is meant by definition of crisp.
    If you scale any of the vector graphics made by SVG Importer it will always stay sharp.
    But you have to turn on antialiasing for that purpose because it behaves more like a 3D model.

    If we are talking about rounded objects, like bezier curves then it depends on the chosen quality.
    Lower quality means fewer points "more performance" but less smooth curves and
    higher quality means more points and smoother curves "less performant". It is always about your needs.

    But in most use cases in which we ended up, most games do not need drastic zoom changes.
    Cheers!
     
  27. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I mean svg file that represent characters or props in my games. Looks like SVG Importer it's a really great plugin and could be a must have - especially for Apple TV apps which have to be less than 200 MB !

    Thanks
     
    Jaroslav-Stehlik likes this.
  28. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Is there any way that I can setup SVG Importer to generate an SVG Asset that can be used in Puppet2D to do what is being done to the dragon's eye between 2:00 and 2:40 in THIS VIDEO? I tried and nothing works.

    It'd be great and of value to SVG Importer if you could work with the Puppet2D developers to add this functionality.
     
    Last edited: Dec 19, 2015
  29. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi!

    The video link seems broken.
     
  30. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Sorry. This is the video:
     
  31. Jaroslav-Stehlik

    Jaroslav-Stehlik

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

    I would have to investigate this because on sprites FFD it is much easier because you can
    generate the sprite mesh as you wish. In vector graphics the mesh has to copy the shape and features of the graphics
    so it will produce more artefacts simply because it is more complicated. But I am looking for animation tools on vector graphics.
     
  32. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Puppet2D might be the best choice to work with because I think it has the most users compared to similar assets. And the developer is very active with his support.
     
  33. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
  34. Javy

    Javy

    Joined:
    Mar 18, 2012
    Posts:
    20
    I understand the desire for Puppet2D but there are other animations packages to consider, such as Spine which is also very popular. If you make SVG Importer compatible with animation tools, I recommend you to consider how it works with multiple animation tools. Might help to think about the problem more abstractly as well.
     
  35. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Because SVG Asset wraps the mesh so it can contain all the important information for rendering the vector graphics correctly in one nice file. If you want to export the mesh and change it manually, you can export it on the SVG Asset it self. There is a button "Save Mesh File" for this reason.

    I personally uninstalled puppet2D after a half day when I created a rig and when the rig was not working as intended
    I could not go back to redo the rig. I had to throw everything and create it from scratch which is By my opinion a really bad design. Also the editor script creates a lot of garbage in the scene and the game object hierarchy becomes easily bloated which I really hate. Spine, on the other hand is really intuitive and professional tool, but it would require working closely with the developer to support the plugin inside SVG Importer. I would rather support spine than Puppet2D
     
  36. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I see. I didn't know this. Spine is very expensive. Would I need the professional version? It is required for meshes. But I can't afford $290. Now I am sorry that I bought both SVG Importer and Puppet2D. I should have bought Simply SVG because at least they are willing to work with the Puppet2D developer. Dammit. Even after 6 months of research I screw up and spend money on the wrong tools.
     
    Last edited: Dec 21, 2015
  37. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    You did not screw up, sorry if it sounded a little bit harsh.
    You can always refund the plugin if you want, I don't want to drain anyone.

    My actual plan was to create custom animation tools which would fit the SVG Importer better,
    because the SVG Importer right now is in a stable state, so I can start to create animation tools
    in this next year.

    Cheers!
     
  38. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Have you tried with Anima2D which is within my price range?
     
  39. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    I will take a look at it!
     
  40. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Thanks. But maybe even Anime2D won't do what I want because I don't think it has that FFD (Mesh deformation) function. Can you recommend anything else beside Spine. I'll never buy that as it is just way too expensive for me.
     
  41. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    1
    Thank you. I just DMed you.
     
  42. pabu

    pabu

    Joined:
    Mar 17, 2010
    Posts:
    30
    Hi Jaroslav,

    Would appreciate if you can get rid of all console/compiler warnings before next release.

    Cheers,
    Patrik
     
    Jaroslav-Stehlik likes this.
  43. etto-bubu

    etto-bubu

    Joined:
    Nov 16, 2012
    Posts:
    4
    Hello Jaroslav,

    I have this error after updating Unity to 5.3.1
    "error CS1061: Type `System.IO.FileInfo' does not contain a definition for `Length' and no extension method `Length' of type `System.IO.FileInfo' could be found (are you missing a using directive or an assembly reference?)"
    I updated SVG Importer too, but the error is still showing.

    Chrs,
    M
     
  44. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi, could you please try to remove the SVG Importer and reimport it from the Asset Store?
    Also, please backup your svgImporterSettings file, so you can retain your original settings.
    Thanks!
     
  45. etto-bubu

    etto-bubu

    Joined:
    Nov 16, 2012
    Posts:
    4
    Hi, I did that but nothing changed. the error is still there.
     
  46. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Strange, still thanks for the info!
     
  47. etto-bubu

    etto-bubu

    Joined:
    Nov 16, 2012
    Posts:
    4
    any update?
     
  48. omrip32

    omrip32

    Joined:
    Jan 4, 2016
    Posts:
    105
    Hi :)
    A small question: Do you support svg text elements?
     
  49. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi,

    Unfortunately not, it is much easier to convert text to curves directly in your vector graphics editor.
    But I can imagine that you are asking because of Realtime import?
     
  50. BoraD

    BoraD

    Joined:
    Jan 3, 2016
    Posts:
    41
    Im thinking of using your svg importer for my games but I'm not sure if what I want to do will work with it. I want to use animations like this one:


    The problem I have is: if I animate it in toon boom I can only export it to a swf or tvg image sequence. I either need to find a good batch converter to convert tvg in svg or animate the assets in unity which will probably be very tiresome and unpractical. Maybe something like a svg spritesheet would work but I've never seen anyone use something like a svg spritesheet.