Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

SVG Importer

Discussion in '2018.2 Beta' started by BeeBop1, Apr 23, 2018.

  1. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    19
    At the 2018 Unity GDC Keynote they mentioned a SVG importer was coming to 2018.2 yet I cannot find any information on it, any info available yet?
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    rakkarage likes this.
  3. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    19
    Thanks.
     
  4. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    19
    I've loaded the project up and can see it running. It's very interesting. Can I ask if anyone knows whether the SVG asset is being converted to a raster file? I want to know if it's being treated more like a mesh where we could scale up as high as we want without pixelation and also keep a really small SVG file size?
     
  5. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    It's a tessellated mesh - You can see it in action here

    Roadmap video for 2018 cycle
     
    Arkade and MechEthan like this.
  6. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    19
    Great thanks for the link.
     
  7. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Hi, thank you for your interest in the SVG importer! The SVG feature is still in development, but a preview release should be available quite soon. The SVG importer will be released as a package and we will make a forum post with more information once it's ready.
     
  8. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    19
    Great, it's a really exciting feature.
    Will assets file size be the same as the SVGs file size or will the conversion process add some extra size?
     
  9. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    The SVG will be tessellated into triangles, so the final asset size will be based on the number of vertices/indices that was generated. If there are gradients and/or textures in the SVG file, these will be packed in a texture atlas, which will add to the size of the asset as well.
     
    andreimcristof, khaled24 and elbows like this.
  10. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Can there be an option to render to a texture like NoesisGUI does?
     
  11. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    The SVG importer will not have this option in its first version, but it will be possible to render the imported SVG sprite to a texture in an editor script. We will certainly consider adding this feature in the importer itself since it seems like a basic feature.
     
    Elecman and Lars-Steenhoff like this.
  12. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    19
    In the current svg importer posted above on Github is it possible to view the generated size of the converted asset?
     
  13. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    I don't see a direct way to get that size at this time. We will have to consider providing this kind of information right in the inspector, at least for the number of triangles that was generated.
     
  14. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Will it support xaml as well?
     
  15. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    I assume you are referring to the WPF markup? The SVG importer doesn't support that, but we have a new (still experimental) UIElements framework that has something similar called UXML. Note that this is still in development and documentation is still lean:

    https://docs.unity3d.com/Manual/UIElements.html

    Hope this helps!
     
  16. Eidoboy

    Eidoboy

    Joined:
    Jul 3, 2012
    Posts:
    29
    Is the svg generated sprite supposed to work also in UI elements? Thanks
     
  17. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    SVG will eventually become a "first-class citizen" of UIElements, but it's not yet ready at this time. A workaround would be to render the sprite in a texture, then draw the texture in UIElements. But that's a bit cumbersome and quite slow, unfortunately.

    SVG is also not compatible with Unity's runtime UI at this time. We're still investigating how we can enable this.
     
  18. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi, we have IntegratorTool2D that is capable to export svg items from Illustrator CC file ( even complex scenes ) and recreate them with one click in Unity. Right now we do this with PNG files but as I understand we will be able to do it soon with SVG files. Can I talk privately with anyone from unity and see how can we help you with our feedback and integration. Thank you, Marek.
     
  19. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Sure thing! We'll get in contact with you soon. Thank you!
     
  20. charlesb_rm

    charlesb_rm

    Joined:
    Jan 18, 2017
    Posts:
    485
    andreimcristof and sonofbryce like this.