Search Unity

Unity Vector Graphics Preview Package

Discussion in '2D Experimental Preview' started by rustum, May 4, 2018.

  1. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    55
    Ahhh... I see. Sorry I disregarded the warnings because I thought they were from TMP. I accept guilt on this one, but as a usability request perhaps you could check this in the `SvgImage` inspector and draw one of those warning info boxes?

    Thanks as always for my favourite unity plugin.
     
  2. ynuteminnof

    ynuteminnof

    Joined:
    Apr 1, 2018
    Posts:
    7
    Hello, I am having trouble installing it this way. I paste the string into the "Add package from git URL dialog, click add button, the dialog disappears and nothing happens (no error is shown, no progressbar, nothing). I still cannot see the package anywhere :(.
     
  3. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    206
    one issue we have was introduced in preview.15,

    In preview. 14 if you drag and drop an SVG assets into the inspector hierarchy, it would have the correct width and height

    In preview.15,16,17 the size of that default asset is always 100, 100 - which breaks all of our UI that references those "built-in" prefabs
     
  4. atomikm

    atomikm

    Joined:
    Feb 8, 2020
    Posts:
    1
    @mcote3d Hi, I'm currently downloading an SVG from a URL and importing it at runtime using SVGParser.ImportSVG(). For some reason, some SVGs work correctly and others throw errors like the one below. It seems certain attributes are missing from the SVG? Can I just ignore the attributes that are missing instead of throwing an error?

    Here's a link to the SVG I'm downloading: https://e3izy-jiaaa-aaaah-qacbq-cai.raw.ic0.app/?tokenid=yjrbs-jakor-uwiaa-aaaaa-b4aaq-maqca-aabso-a

    And the error:

    Code (CSharp):
    1. SVGFormatException: SVG Error (line 1, character 2684): Input string was not in a correct format.
    2. Unity.VectorGraphics.SVGAttribParser.ParseFill (Unity.VectorGraphics.XmlReaderIterator+Node node, Unity.VectorGraphics.SVGDictionary dict, Unity.VectorGraphics.SVGPostponedFills postponedFills, Unity.VectorGraphics.SVGStyleResolver styles, Unity.VectorGraphics.Inheritance inheritance, System.Boolean& isDefaultFill) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:2634)
    3. Unity.VectorGraphics.SVGAttribParser.ParseFill (Unity.VectorGraphics.XmlReaderIterator+Node node, Unity.VectorGraphics.SVGDictionary dict, Unity.VectorGraphics.SVGPostponedFills postponedFills, Unity.VectorGraphics.SVGStyleResolver styles, Unity.VectorGraphics.Inheritance inheritance) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:2608)
    4. Unity.VectorGraphics.SVGDocument.path () (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:647)
    5. Unity.VectorGraphics.SVGDocument.ParseChildren (Unity.VectorGraphics.XmlReaderIterator+Node node, System.String nodeName) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:319)
    6. Unity.VectorGraphics.SVGDocument.clipPath () (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:916)
    7. Unity.VectorGraphics.SVGDocument.ParseChildren (Unity.VectorGraphics.XmlReaderIterator+Node node, System.String nodeName) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:319)
    8. Unity.VectorGraphics.SVGDocument.defs () (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:374)
    9. Unity.VectorGraphics.SVGDocument.ParseChildren (Unity.VectorGraphics.XmlReaderIterator+Node node, System.String nodeName) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:319)
    10. Unity.VectorGraphics.SVGDocument.svg () (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:1195)
    11. Unity.VectorGraphics.SVGDocument.Import () (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:264)
    12. Unity.VectorGraphics.SVGParser.ImportSVG (System.IO.TextReader textReader, Unity.VectorGraphics.ViewportOptions viewportOptions, System.Single dpi, System.Single pixelsPerUnit, System.Int32 windowWidth, System.Int32 windowHeight) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:110)
    13. Unity.VectorGraphics.SVGParser.ImportSVG (System.IO.TextReader textReader, System.Single dpi, System.Single pixelsPerUnit, System.Int32 windowWidth, System.Int32 windowHeight, System.Boolean clipViewport) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:68)
    14. LoadSVGFromURL.LoadSVGToTexture (System.String url, Resolution finalResolution) (at Assets/Scripts/LoadSVGFromURL.cs:73)
    15. LoadSVGFromURL+<DownloadSVGs>d__2.MoveNext () (at Assets/Scripts/LoadSVGFromURL.cs:42)
    16. UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
     
  5. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    55
    I've also had trouble importing a whole class of SVG. Basically anything that Figma outputs that has a nested "Frame" object in it causes a null reference exception during import (preventing mesh generation). This could be the same issue. Does it import okay if you drop the SVG straight into your project?
     
  6. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,428
    Hi there,

    Apologies if this is mentioned elsewhere, this is SVG and as you can see edges are terrible, they are even terrible on mobile.
    What settings should i change to make them smooth for mobile without hurting battery performance?

    Please advise

    upload_2021-10-7_1-39-59.png
     
  7. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    55
    You'll need to enable some sort of anti-aliasing for your Sprites, you can do this in the project quality settings for your mobile platform. Here's an example of a game I made without anti-aliasing, and it looks similarly bad. This might affect your performance though.

    For overlay canvas I've found that the simplest way to fix the problem is to not use SVGImage and instead use raster images where possible. You can also use the camera anti-alias by setting the canvas to "screen space - camera" but this adds double anti-aliasing to TextMeshProGUI objects (and I believe is less performant than overlay, although not certain on that).
     
    mcoted3d and jGate99 like this.
  8. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,428
    Really appreciate detailed reply, yes im using canvas overlay and i dont want to hurt performance so i guess i use raster images based on your advice.
     
  9. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    55
    Yeah, another reason why this is a good idea is that you can't 9-slice vector sprites (yet?).

    I am curious whether overlay anti-aliasing or 9-slicing is planned, @mcoted3d
     
    jGate99 likes this.
  10. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    55
    I've been trying to figure this out by myself by reading shaders and doing some research, but haven't quite got my head around it. Why is it that the `_RendererColor` is not used when instancing is disabled? One of the projects I'm working on has many many sprites rendering at once. Disabling instancing decreases batches from 150 to 20, which seems desirable, but it removes the color property.

    I'm looking to get a good understanding of how it all works so I can work out how best to optimize rendering.

    Thanks.
     
    Last edited: Oct 11, 2021
  11. simeer

    simeer

    Joined:
    Oct 4, 2017
    Posts:
    1
    An interesting issue we've run into is that the rasterized versions of SVGs turn out completely butchered when built by the Unity Cloud Build.

    E.g. a rounded rectangle will turn out like this:
    upload_2021-10-11_18-11-0.png
    Code (CSharp):
    1.  
    2. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0.0017999999999977739 -0.0020000000000004754 23.998199999999997 24.00019999999999">
    3.   <path d="m 1.999 0 l 20.002 0 q 0.098 0 0.196 0.0096 q 0.098 0.0096 0.194 0.0288 q 0.096 0.0192 0.19 0.0477 q 0.094 0.0285 0.185 0.0661 q 0.091 0.0376 0.177 0.0839 q 0.087 0.0463 0.169 0.1009 q 0.081 0.0546 0.157 0.1169 q 0.076 0.0623 0.145 0.1317 q 0.07 0.0694 0.132 0.1454 q 0.063 0.0759 0.117 0.1576 q 0.055 0.0817 0.101 0.1683 q 0.046 0.0866 0.084 0.1773 q 0.037 0.0907 0.066 0.1847 q 0.028 0.094 0.048 0.1903 q 0.019 0.0963 0.028 0.1941 q 0.01 0.0977 0.01 0.1959 l 0 20 q 0 0.0982 -0.01 0.1959 q -0.009 0.0978 -0.028 0.1941 q -0.02 0.0963 -0.048 0.1903 q -0.029 0.0939 -0.066 0.1847 q -0.038 0.0907 -0.084 0.1773 q -0.046 0.0866 -0.101 0.1683 q -0.054 0.0816 -0.117 0.1576 q -0.062 0.0759 -0.132 0.1453 q -0.069 0.0694 -0.145 0.1317 q -0.076 0.0623 -0.157 0.1169 q -0.082 0.0546 -0.169 0.1009 q -0.086 0.0462 -0.177 0.0838 q -0.091 0.0376 -0.185 0.0661 q -0.094 0.0285 -0.19 0.0477 q -0.096 0.0191 -0.194 0.0288 q -0.098 0.0096 -0.196 0.0096 l -20 0 q -0.0982 0 -0.1959 -0.0096 q -0.0977 -0.0097 -0.1941 -0.0288 q -0.0963 -0.0192 -0.1903 -0.0477 q -0.094 -0.0285 -0.1847 -0.0661 q -0.0907 -0.0376 -0.1773 -0.0838 q -0.0866 -0.0463 -0.1683 -0.1009 q -0.0817 -0.0546 -0.1576 -0.1169 q -0.0759 -0.0623 -0.1454 -0.1317 q -0.0694 -0.0694 -0.1317 -0.1454 q -0.0623 -0.0759 -0.1169 -0.1575 q -0.0546 -0.0817 -0.1009 -0.1683 q -0.0463 -0.0866 -0.0839 -0.1773 q -0.0376 -0.0908 -0.0661 -0.1847 q -0.0285 -0.094 -0.0477 -0.1903 q -0.0192 -0.0963 -0.0288 -0.1941 q -0.0096 -0.0977 -0.0096 -0.1959 l 0 -20.002 q 0 -0.0982 0.0096 -0.1959 q 0.0096 -0.0977 0.0288 -0.1941 q 0.0192 -0.0963 0.0477 -0.1903 q 0.0285 -0.094 0.0661 -0.1847 q 0.0376 -0.0907 0.0839 -0.1773 q 0.0463 -0.0866 0.1009 -0.1683 q 0.0546 -0.0817 0.1169 -0.1576 q 0.0623 -0.0759 0.1317 -0.1454 q 0.0694 -0.0694 0.1454 -0.1317 q 0.0759 -0.0623 0.1576 -0.1169 q 0.0817 -0.0546 0.1683 -0.1009 q 0.0866 -0.0463 0.1773 -0.0839 q 0.0907 -0.0376 0.1847 -0.0661 q 0.094 -0.0285 0.1903 -0.0477 q 0.0963 -0.0192 0.1941 -0.0288 q 0.0977 -0.0096 0.1959 -0.0096 l 0 0 z" fill="#FFF"/>
    4. </svg>
    5.  
    You can also see that the circle is rendered in a strange way -- there's not supposed to be a fill effect. (The dark part is the shadow; they're essentially two circles stacked on top.)

    I suspect that there might be an issue with the graphics device used by the Cloud Build (i.e. the Apple Software Renderer).
    For the time being, I worked around it by saving the resulting textures / sprites alongside the SVGs (although the redundancy hurts my heart a little) -- would be nice if those could be made compatible in the future.
     
  12. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    747
    If my memory serves me well, when instancing is disabled, the _RendererColor ends up in the color channel of the Vector Sprite vertices. Since this channel is used by the Vector Sprite to store the shapes colors, the _RendererColor won't work. Enabling instancing stores the color channel somewhere else, hence fixing this issue.

    There are probably things we can do on our side to fix this. I'll try to investigate.
     
  13. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    747
    You're not the first one to report this kind of issue using Cloud Builds. We're still not sure what's going on, but we're keeping an eye on it.
     
  14. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    55
    Thanks, that makes sense. I'll have to spend more time familiarising myself with the shader code.

    FYI the same thing happens when using Sprites/Default as using the vector shader that comes with this package.

    Would appreciate an upstream fix but I expect I'll end up writing my own shader once I understand it better.
     
  15. naruto93

    naruto93

    Joined:
    May 6, 2015
    Posts:
    15
    Hi guys,

    How can I detect touch in shape with SVG?

    I try to convert Path to closed Polygon and check point inside or not, but I have a problem with complex Bezier Paths like this

    Or How to get triangles of the shape?

    Code (CSharp):
    1. <path d="M266.75,87.25a1.34,1.34,0,0,0-1.2.45,5.88,5.88,0,0,0-1,2.35h0c0,.06.05.13.08.2.1.23.27.57.5,1A5.48,5.48,0,0,1,261.6,99a10.09,10.09,0,0,1,1.2.93c0,2.72-.68,4.44-1.9,5.17a3.36,3.36,0,0,1-3.55.15,4.84,4.84,0,0,0-1.25-.65,2.45,2.45,0,0,0-1.5.75,4,4,0,0,1-2.65.5,3.81,3.81,0,0,1-2.35-1.1,17.78,17.78,0,0,1-1.9-2.75,4.19,4.19,0,0,0-2.35-2,3.28,3.28,0,0,0-2.75.85A24.88,24.88,0,0,1,240,103a7.41,7.41,0,0,1-5.15,1.85,8,8,0,0,0-2.6.25,2.88,2.88,0,0,0-1.25,2.75q0,.65.15,2.25a13.75,13.75,0,0,1,.1,2.15,3.87,3.87,0,0,1-.8,2.1,6.59,6.59,0,0,1-2.8,1.8,41.81,41.81,0,0,1-5.3,1.85,7.47,7.47,0,0,1-6-.75,9.31,9.31,0,0,1-2.75-2.9,33.5,33.5,0,0,0-2.25-3.5,5.77,5.77,0,0,0-3.25-2.6,6.42,6.42,0,0,0-2.85,0c-1.23.37-2.15.63-2.75.8a6.75,6.75,0,0,1-3,.4,3.36,3.36,0,0,1-2.4-1.25,3.73,3.73,0,0,1-.6-2.35c0-.23.12-1.08.35-2.55a6.51,6.51,0,0,0-.1-2.55,7.6,7.6,0,0,0-2.4-3.3q-3.34-1.45-5-.15l-1.25,1a2.52,2.52,0,0,1-1.35.45,3.82,3.82,0,0,1-.9-.2,1.49,1.49,0,0,0-.85,0,1.32,1.32,0,0,0-.8.5l-.7.75a2.4,2.4,0,0,1-2,.25,11.07,11.07,0,0,1-2-1,4.23,4.23,0,0,1-3,2.8,4.11,4.11,0,0,1-4-.55,20.26,20.26,0,0,1-2.05-2.3,4.93,4.93,0,0,0-2.35-1.7c-1-.37-2.25-.08-3.65.85-2.13,1.3-3.37,2-3.7,2.15a5.11,5.11,0,0,1-4-.35A5,5,0,0,1,154.1,97a36.29,36.29,0,0,1-2-4,2.59,2.59,0,0,1,.25-2.75,5,5,0,0,1,1.9-1,4.92,4.92,0,0,0,1.85-1,3.8,3.8,0,0,0,.6-1.45q.2-1.09.3-1.65a5.6,5.6,0,0,1,1.68-3.6,20.36,20.36,0,0,1,4.12-2.85,9.94,9.94,0,0,0,4-4,8.61,8.61,0,0,1,2.25-3,18.2,18.2,0,0,1,2.35-.9,2.34,2.34,0,0,0,1.65-1.35,2.59,2.59,0,0,0-.5-2.15c-.7-1.23-1.23-2.17-1.6-2.8a20.81,20.81,0,0,1-1.4-2.95,8.12,8.12,0,0,1-.1-6.25,6.43,6.43,0,0,0,.6-1.6,1.25,1.25,0,0,0,.1-.85,1.26,1.26,0,0,0-.35-.8,1.4,1.4,0,0,0-.9-.2.71.71,0,0,0-.6.45,1.13,1.13,0,0,0-1.1-.7c-.57-.07-1.32.47-2.25,1.6a4.72,4.72,0,0,0-.65-1.55l-.2-.3-.8-1.15a3.17,3.17,0,0,1-.1-3.25A2.79,2.79,0,0,1,165,46a14.11,14.11,0,0,1,2.25-.25,8.31,8.31,0,0,0,3.25-1.15,8.43,8.43,0,0,0,2.6-2.35,20.87,20.87,0,0,0,1-3,2.32,2.32,0,0,1,.8-1.4c.27-.23.68-.57,1.25-1a3.21,3.21,0,0,0-.1-2.6c-.43-1.27-.48-2.15-.15-2.65.4-.77,1.48-1.05,3.25-.85a1.69,1.69,0,0,1,.65-1.9,3,3,0,0,1,2.1-.85q1.5.11,4,2.1a5.25,5.25,0,0,1,2.5-1.25,4.58,4.58,0,0,1,2.75.15l1.25.55a3.53,3.53,0,0,0,1.25.3,8.33,8.33,0,0,0,3.3-.85,3.87,3.87,0,0,1,3.1-.25,7.71,7.71,0,0,1,0-3.9.3.3,0,0,0,0-.1A3.69,3.69,0,0,1,201,23.2a2.76,2.76,0,0,1,1.65-.85,13.73,13.73,0,0,1,1.6,0,1.79,1.79,0,0,0,1.3-.5,1.64,1.64,0,0,0,.4-.9c0-.47.07-.83.1-1.1a2.29,2.29,0,0,1,.4-.9L208.35,17a2.58,2.58,0,0,0,2-.25c.43-.2,1.07-.53,1.9-1a4.69,4.69,0,0,1,3.25-.35,4.87,4.87,0,0,1,2.75,1.7,2.18,2.18,0,0,1,2.15-.5,3.41,3.41,0,0,1,2.1,1.25,3.81,3.81,0,0,1,.45.7,9.39,9.39,0,0,1,.9,3.8c.2,1.33.33,2.17.4,2.5a5.58,5.58,0,0,0,1,2.15,4.9,4.9,0,0,1,3.7-1.15,8.61,8.61,0,0,1,3-2.2,3.34,3.34,0,0,1,2.35,0q4-1.2,5.25-2.85.19-.34.75-1.5a6.05,6.05,0,0,1,.85-1.4,3.21,3.21,0,0,1,2.65-.7,29.3,29.3,0,0,1,2.85.7,9.72,9.72,0,0,0,6.65-.75c.7-.33,1.75-.92,3.15-1.75a6.47,6.47,0,0,1,3.35-.85q2.7.15,5.1,3.5c.4.63.93,1.57,1.6,2.8a13.79,13.79,0,0,0,1.9,2.55,5.64,5.64,0,0,0,2.8,1.75,14.66,14.66,0,0,0,5.3.1q4.56-1.07,8.05,7.9a23.16,23.16,0,0,1,11.1-.85,7.17,7.17,0,0,1,4.4,2,6,6,0,0,1,1.4,4.1,36.55,36.55,0,0,1-.3,4.65,9.08,9.08,0,0,0,1,5,10.3,10.3,0,0,0,2.2,2.25,30.38,30.38,0,0,1,2.3,2.1,5.28,5.28,0,0,1,1.5,2.85,5,5,0,0,1-1.4,3.9c-1.1,1.5-2.12,2.32-3.05,2.45a22.27,22.27,0,0,0-2.3.3,3.23,3.23,0,0,0-2.25,3,5.38,5.38,0,0,0,.2,1.65q.26,1.2.3,1.5a3.66,3.66,0,0,1-.8,2.25,3.49,3.49,0,0,1-2.05,1.35,8.66,8.66,0,0,0-1,.2,2.47,2.47,0,0,0-.9.3c-.37.33-.5,1.08-.4,2.25a3.47,3.47,0,0,1-.45,2.4,1.36,1.36,0,0,1-1.05.5,2.26,2.26,0,0,1-1.2-.25,10.1,10.1,0,0,1-2-1.4,7.3,7.3,0,0,0-3.4-1.65,7,7,0,0,0-4.35.8,7.55,7.55,0,0,0-3.9,4.1c-.17.47-.42,1.18-.75,2.15a4.82,4.82,0,0,1-1.25,1.85c-1.1,1.17-2.93,1.58-5.5,1.25a4.85,4.85,0,0,0-1.6.15c-.77.13-1.15.5-1.15,1.1a8.8,8.8,0,0,0,.25,1.15.7.7,0,0,1-.25,1,1.12,1.12,0,0,1-.55,0A3.54,3.54,0,0,0,266.75,87.25Zm25.35-36c.33-.33.42-.63.25-.9,0-.33-.25-.5-.75-.5a9.18,9.18,0,0,0-3.9.15,11.45,11.45,0,0,0-4.2,2.5,8.22,8.22,0,0,1-2.8,2.6,13.32,13.32,0,0,0-2.95,2.5.92.92,0,0,0-.25,1,1.85,1.85,0,0,0,.5.4,5.73,5.73,0,0,0,3.35-.25A25.39,25.39,0,0,0,292.1,51.25ZM271,41.35c.7-.47,1-1,.85-1.5s-.52-.8-1.35-1a10.71,10.71,0,0,0-4.1.1,10.21,10.21,0,0,0-3.8,1.65c-.37.37-.65.63-.85.8a3.34,3.34,0,0,1-1,.6,5.85,5.85,0,0,1-1.4.3,11.93,11.93,0,0,0-1.5.2,14,14,0,0,0-4.05,2.55,20.62,20.62,0,0,1-4.6,2.8,16.79,16.79,0,0,1-2.55.9c-.5,0-.88.07-1.15.1a2.19,2.19,0,0,0-1.15.3,1,1,0,0,0-.6.85c.07.6.68,1,1.85,1.1q8.29.7,13.75-3.35l2.75-2.25a12.75,12.75,0,0,1,2.9-2,28.69,28.69,0,0,1,3.1-1A10.23,10.23,0,0,0,271,41.35ZM268.1,62.1c-2-.7-4.57-.2-7.6,1.5-2,1.27-3.17,2-3.4,2.1a14.8,14.8,0,0,1-3.75,1.55,27.57,27.57,0,0,1-3.55.3,12.1,12.1,0,0,0-3.45.45l-3.55,2a5.27,5.27,0,0,1-3.55.85A37.84,37.84,0,0,0,231,72.4a32,32,0,0,1-4,1.1q-5.1.94-8.15-1.15c-1.17-1-2-1.77-2.65-2.3a5.92,5.92,0,0,0-3.1-1.55,7.57,7.57,0,0,0-2,.35,18.92,18.92,0,0,1-2,.5,6.52,6.52,0,0,1-3.5-.15,7.37,7.37,0,0,1-3.1-1.85l-1.2-1.5A6.42,6.42,0,0,0,200,64.6a5.08,5.08,0,0,0-1.65-.75c-.8-.2-1.42-.37-1.85-.5a7.11,7.11,0,0,1-4-3.6A8.89,8.89,0,0,0,189,56a3.08,3.08,0,0,0-1.35-.35,1,1,0,0,0-1.05.6q-.6,1,1.65,2.25,4,2.66,5,9.6c.1.73.22,1.82.35,3.25a13.51,13.51,0,0,0,.75,3.15,7.18,7.18,0,0,0,1.75,2.65,5.17,5.17,0,0,0,2.75,1.45c1.77.37,3.6-.42,5.5-2.35a20.55,20.55,0,0,0,7.35,2.65,7.8,7.8,0,0,0,5.4-1.3,42.51,42.51,0,0,0,3.65,3.85,14.12,14.12,0,0,0,4.35,2.8,9.11,9.11,0,0,0,5.15.6,6.5,6.5,0,0,0,4.25-2.6,11.37,11.37,0,0,0,1-1.6,3.64,3.64,0,0,1,1.25-1.3,6,6,0,0,1,2.2-.3,6,6,0,0,0,2.15-.2,3.89,3.89,0,0,0,1.65-1,14.76,14.76,0,0,0,1.5-1.5A7,7,0,0,1,248,74.62l.77-.07a6.34,6.34,0,0,0,1.68-.6,19.47,19.47,0,0,0,3.23-2.1,22.32,22.32,0,0,1,2.92-2,49.61,49.61,0,0,1,4.75-1.5A11.76,11.76,0,0,0,268.1,62.1Z" fill="#d1bd06"/>
    Have a good day!
     
    Last edited: Oct 15, 2021
  16. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,011
    Two years down the road, will we ever see slicing in the Sprite editor for SVG graphics? I am concerned Unity seems to have abandoned all SVG progress?
     
  17. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    747
    Slicing of vector sprites is very tricky and often involves moving a lot of vertices when resizing a sprite.

    Progress on SVG is slow at this time as we are consolidating the vector graphics work on multiple fronts at the same time (UI Toolkit, 2D Sprites, etc.).
     
  18. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,011
    Thank you for the update @mcoted3d
     
  19. walaber_entertainment

    walaber_entertainment

    Joined:
    Jul 10, 2017
    Posts:
    27
    I looked through this entire thread, and I'm surprised no one else is having the problem I'm having. I'm just trying to import some SVGs to evaluate using vector instead of PNGs for some assets in a project. On the latest version of the vector package (Version 2.0.0-preview.17) and Unity 2021.2.23, I'm getting an error on every single SVG that our artists exported:

    Code (CSharp):
    1. KeyNotFoundException: The given key was not present in the dictionary.
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    3. Unity.VectorGraphics.SVGDocument.ResolveReferencedNode (Unity.VectorGraphics.SceneNode referencedNode, Unity.VectorGraphics.SVGDocument+NodeReferenceData refData, System.Boolean isDeferred) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.17/Runtime/SVGParser.cs:1326)
    The code in question is this:
    Code (CSharp):
    1. // Activate the styles of the referenced node
    2. var styleLayer = nodeStyleLayers[referencedNode];
    3. if (styleLayer != null)
    4.      styles.PushLayer(styleLayer);
    clearly the "referencedNode" doesn't exist in the nodeStyleLayers dictionary, and this code expects it to. anyone elase having trouble importing SVG files like this?
     
  20. walaber_entertainment

    walaber_entertainment

    Joined:
    Jul 10, 2017
    Posts:
    27
    update: this appears to be happening when the SVG is referencing an external image file (not an embedded one). for reference, this came from a file exported from Adobe Animate, which had some reference images as part of the file (but not needed for the exported SVG). copying the desired object into a new document and exporting from there fixed the issue.
     
unityunity