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
    - Added, Virtual Reality Support
    - Fixed, Shader compatibility for VR
    - Fixed, SVG Editor
    - Fixed, SVGImporterSettings
    - Updated, About screen

    And removed all warnings
     
    overthere, ibyte and Naxite like this.
  2. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Thanks !
     
  3. grimmdeveloper

    grimmdeveloper

    Joined:
    May 22, 2013
    Posts:
    5
    I emailed you, but given your situation I understand. I was looking to buying the plugin source. If you can get touch with me grimmdev(at)gmail(dot)com. I would appreciate it
     
    Jaroslav-Stehlik likes this.
  4. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    50
    I'm routinely getting this when building for iOS:

    18871: [Unity] NullReferenceException: Object reference not set to an instance of an object
    18872: [Unity] at SVGImporter.SVGAtlas.RebuildAtlas () [0x000f1] in /BUILD_PATH/rarebyte-og/src/client/Assets/Standard Assets/SVG Importer/Plugins/Core/SVGAtlas.cs:739
    18873: [Unity] at SVGImporter.SVGAtlas.OnAtlasPreRender (UnityEngine.Camera camera) [0x0002f] in /BUILD_PATH/rarebyte-og/src/client/Assets/Standard Assets/SVG Importer/Plugins/Core/SVGAtlas.cs:434
    18874: [Unity] at SVGImporter.Utils.SVGCamera.UpdateCameras () [0x00075] in /BUILD_PATH/rarebyte-og/src/client/Assets/Standard Assets/SVG Importer/Plugins/Utils/SVGCamera.cs:41
    18875: [Unity] at SVGImporter.SVGAtlas.Update () [0x00041] in /BUILD_PATH/rarebyte-og/src/client/Assets/Standard Assets/SVG Importer/Plugins/Core/SVGAtlas.cs:415

    Used to fix it myself in the old version of the asset, and with the latest update yesterday it appeared again. Please wrap the for loop with a if (atlasTextures != null) { or fix the root of this issue. Thanks.
     
    Last edited: Oct 17, 2017
    Jaroslav-Stehlik likes this.
  5. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    50
    Other than that: Thanks for the update and welcome back. Take care of your health ;)
     
  6. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    I still have this issue. I also noticed that sometimes, when playing the game from the editor on a Windows desktop, some SVG assets appears and disappears randomly when the camera is moving when they should be always visible. It's weird, because those assets are in a layer that is in front of the layer used by assets behind them.

    Anyone else experiencing sorting issues ?

    Thanks
     
  7. skillbow

    skillbow

    Joined:
    Dec 2, 2014
    Posts:
    7
    Just installed the new version and I'm getting a continuous stream of "Mesh doesn't have normals. Please create some for GI." in the console. The error message is for all imported meshes. Do the SVGs need to be imported again?
     
  8. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    Hi Jaroslav,

    Thank you so much for updating the package on the asset store! I hope your health is doing much better now and that you continue to do well!

    Quick comment, followed by a question: I noticed that the UI Antialiased shader doesn't appear to be applying antialiasing properties to the SVG UGUI elements anymore.

    Here is a quick way to test it:
    1. Open SVG Importer -> Example Projects -> Curves Demo -> "Curves Demo.Unity"
    2. In the Hierarchy view, select Canvas -> icon bar -> icon (doesn't matter which icon)
    3. In the game view, you will see that these icons are still heavily aliased, even though they are set to use the shader "SVG Importer/UI/UIAntialiased".
    I'm not sure which version of Unity caused this to be an issue, but I am currently on Unity 5.6.1f1 and have been noticing the aliasing in all my projects that use SVG Importer with UGUI elements. In case you were wondering, I did turn Anti-Aliasing up to 8x Multi Sampling in the Quality Settings for the Unity project, and it does not change the outcome.

    And here is my question: Is there any chance you would be able to fix this? Or at least tell me how I can get the antialiasing to apply again to UGUI SVG assets?

    Screen Shot 2017-06-06 at 13.28.00.png
    Screen Shot 2017-06-06 at 13.28.59.png
    Screen Shot 2017-06-06 at 13.43.04.png
     
  9. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thank you! I did miss that!
     
    TeamZero likes this.
  10. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello, That is strange, do you have your graphics somehow setup to rendering lighting on them?
     
  11. GS796

    GS796

    Joined:
    Dec 16, 2016
    Posts:
    18
    Hi Jaroslav,
    I am having the same issue with anti-aliasing. Is there a fix for this?
    Thanks,
     
    shaneparsons and TeamZero like this.
  12. skillbow

    skillbow

    Joined:
    Dec 2, 2014
    Posts:
    7
    Thanks for pointing me in the right direction. Don't know why but when I updated to Unity 5.6.1 it set the "Mesh Renderer -> Lightmap Static" check box on some of my assets. Strange but solved now. Thanks
     
    Jaroslav-Stehlik likes this.
  13. royvaneijndhoven

    royvaneijndhoven

    Joined:
    Jun 1, 2017
    Posts:
    65
    We're currently trying to make a Windows Store build of our project but it results in a compiler error related to the SmallXmlParser in the SVG Importer Core. Note: It only happens when making a Windows Store build, there are no problems when building a regular Windows build.

    Error message: Assets\Plugins\SVG Importer\Plugins\Core\Implementation\XML Parser\SmallXmlParser.cs(106,26): error CS0117: 'char' does not contain a definition for 'GetUnicodeCategory'

    Some extra information, we're using Unity 5.6.1f1 and SVG Importer 1.1.4.

    ------

    Edit: I'm able to build without a problem when I comment out the following code, but I have no idea what else this will impact.

    switch (Char.GetUnicodeCategory(c))
    {
    case UnicodeCategory.LowercaseLetter:
    case UnicodeCategory.UppercaseLetter:
    case UnicodeCategory.OtherLetter:
    case UnicodeCategory.TitlecaseLetter:
    case UnicodeCategory.LetterNumber:
    return true;
    case UnicodeCategory.SpacingCombiningMark:
    case UnicodeCategory.EnclosingMark:
    case UnicodeCategory.NonSpacingMark:
    case UnicodeCategory.ModifierLetter:
    case UnicodeCategory.DecimalDigitNumber:
    return !start;
    default:
    return false;
    }
     
    Last edited: Jun 12, 2017
    Jaroslav-Stehlik likes this.
  14. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    41
    I'm not sure if it's SVG Importer or the new version of Unity, but UI images look terrible (pixelated) in the game window.

    To replicate:

    - add a UI > Canvas to the scene
    - add a UI > SVG Image to the Canvas
    - add an SVG Asset to the SVG Image and notice the extremely poor quality

    I tried changing every possible setting in the SVG Asset, as well as every possible Unity setting, but nothing made it look any better.

    Also, the anti-aliasing seems to work differently in the new version of SVG Importer vs the previous version. The anti-aliased image is much blurrier than it should be.

    Any ideas?
     
    Jaroslav-Stehlik likes this.
  15. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    @shaneparsons This sounds like the same issue mentioned here. Could you confirm if it's the same issue or a new issue?
     
    shaneparsons likes this.
  16. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    41
    Ah yes, it very well might be the same issue.

    All this shader stuff is new to me, as my working app uses Unity 5.4.5 and SVG Importer 1.1.3, where shaders didn't seem to ever be mentioned.
     
  17. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,
    Yes this is only due to Windows Store.
    If you are not importing SVG graphics during runtime from SVG format
    The fastest fix is to set compile directive to the sections which throw these
    errors so you can easily get rid of it because it is only connected to real-time import.
     
  18. michelm

    michelm

    Joined:
    Jul 2, 2012
    Posts:
    9
    I believe there's a serious performance issue with MacOS Metal rendering.
    Image 1: Empty Scene
    Image 2: 40fps with a single SVG UI asset in the scene

    If I switch to OpenGL, it's fine, at the maximum 60fps again.

    SVGMetalEmpty.png SVGMetal.png
     
    Jaroslav-Stehlik likes this.
  19. DreamHarvestGames

    DreamHarvestGames

    Joined:
    Mar 1, 2014
    Posts:
    6
    Hello,


    We've been getting some shader errors when trying to build our game in Unity for a while now. It hasn't been a problem up until now (except being a bit annoying), since the build succeeds when built locally. However, we are trying to integrate Unity Cloud Build at the moment, and that fails to produce a build on any shader errors. Here is a snippet of the log where the errors happened:


    Code (CSharp):
    1. [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAdditive': failed to open source file: '../SVGImporterGradientCG.cginc' at line 39 (on d3d9)
    2. [Unity] Compiling Vertex program
    3. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    4. [Unity] (Filename: SVG Importer/GradientColor/GradientColorAdditive Line: 39)
    5. [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAdditive': failed to open source file: '../SVGImporterGradientCG.cginc' at line 39 (on d3d11)
    6. [Unity] Compiling Vertex program
    7. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    8. [Unity] (Filename: SVG Importer/GradientColor/GradientColorAdditive Line: 39)
    9. [Unity] Compressed shader 'Hidden/ScionDepthOfFieldDX11' on d3d9 from 0.00MB to 0.00MB
    10. [Unity] Compressed shader 'Hidden/ScionDepthOfFieldDX11' on d3d11 from 2.29MB to 0.23MB
    11. [Unity] Shader error in 'SVG Importer/SolidColor/SolidColorAdditive': failed to open source file: '../SVGImporterSolidCG.cginc' at line 27 (on d3d9)
    12. [Unity] Compiling Vertex program
    13. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    14. [Unity] (Filename: SVG Importer/SolidColor/SolidColorAdditive Line: 27)
    15. [Unity] Shader error in 'SVG Importer/SolidColor/SolidColorAdditive': failed to open source file: '../SVGImporterSolidCG.cginc' at line 27 (on d3d11)
    16. [Unity] Compiling Vertex program
    17. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    18. [Unity] (Filename: SVG Importer/SolidColor/SolidColorAdditive Line: 27)
    19. [Unity] Compiled shader 'SVG Importer/Standard SVG' in 5.43s
    20. [Unity]     d3d9 (total internal programs: 58, unique: 52)
    21. [Unity]     d3d11 (total internal programs: 58, unique: 48)
    22. [Unity] Shader error in 'SVG Importer/Standard SVG': invalid subscript 'tangentToWorldAndPackedData' at Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc(120) (on d3d9)
    23. [Unity] Compiling Vertex program with DIRECTIONAL
    24. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    25. [Unity] (Filename: Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc Line: 120)
    26. [Unity] Shader error in 'SVG Importer/Standard SVG': invalid subscript 'tangentToWorldAndPackedData' at Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc(120) (on d3d11)
    27. [Unity] Compiling Vertex program with DIRECTIONAL
    28. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    29. [Unity] (Filename: Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc Line: 120)
    30. [Unity] Compressed shader 'Shader Forge/Standard3' on d3d9 from 0.74MB to 0.06MB
    31. [Unity] Compressed shader 'Shader Forge/Standard3' on d3d11 from 1.12MB to 0.07MB
    32. [Unity] Compiled shader 'Hidden/Post FX/Uber Shader' in 9.01s
    33. [Unity]     d3d9 (total internal programs: 5184, unique: 5184)
    34. [Unity]     d3d11 (total internal programs: 5184, unique: 5184)
    35. [Unity] Compressed shader 'Hidden/Post FX/Uber Shader' on d3d9 from 10.80MB to 1.27MB
    36. [Unity] Compressed shader 'Hidden/Post FX/Uber Shader' on d3d11 from 14.30MB to 0.69MB
    37. [Unity] Compressed shader 'Shader Forge/Standard2' on d3d9 from 0.77MB to 0.06MB
    38. [Unity] Compressed shader 'Shader Forge/Standard2' on d3d11 from 1.16MB to 0.07MB
    39. [Unity] Shader error in 'Unlit/Distance': COLOR0 must be a four-component vector at line 39 (on d3d9)
    40. [Unity] Compiling Fragment program
    41. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    42. [Unity] (Filename: Unlit/Distance Line: 39)
    43. [Unity] Compressed shader 'Hidden/ScionDepthOfField' on d3d9 from 0.26MB to 0.04MB
    44. [Unity] Compressed shader 'Hidden/ScionDepthOfField' on d3d11 from 1.63MB to 0.18MB
    45. [Unity] Compressed shader 'Shader Forge/Standard4' on d3d9 from 0.68MB to 0.06MB
    46. [Unity] Compressed shader 'Shader Forge/Standard4' on d3d11 from 1.05MB to 0.06MB
    47. [Unity] Compiled shader 'SVG Importer/Standard SVG Specular' in 4.98s
    48. [Unity]     d3d9 (total internal programs: 58, unique: 52)
    49. [Unity]     d3d11 (total internal programs: 58, unique: 48)
    50. [Unity] Shader error in 'SVG Importer/Standard SVG Specular': invalid subscript 'tangentToWorldAndPackedData' at Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc(120) (on d3d9)
    51. [Unity] Compiling Vertex program with DIRECTIONAL
    52. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    53. [Unity] (Filename: Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc Line: 120)
    54. [Unity] Shader error in 'SVG Importer/Standard SVG Specular': invalid subscript 'tangentToWorldAndPackedData' at Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc(120) (on d3d11)
    55. [Unity] Compiling Vertex program with DIRECTIONAL
    56. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    57. [Unity] (Filename: Assets/SVG Importer/Plugins/Shaders/Resources/Standard/UnitySVG.cginc Line: 120)
    58. [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on d3d9)
    59. [Unity] Compiling Vertex program
    60. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    61. [Unity] (Filename: SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed Line: 0)
    62. [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on d3d11)
    63. [Unity] Compiling Vertex program
    64. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    65. [Unity] (Filename: SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed Line: 0)
    66. [Unity] Shader error in 'SVG Importer/SolidColor/SolidColorMultiply': failed to open source file: '../SVGImporterSolidCG.cginc' at line 27 (on d3d9)
    67. [Unity] Compiling Vertex program
    68. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    69. [Unity] (Filename: SVG Importer/SolidColor/SolidColorMultiply Line: 27)
    70. [Unity] Shader error in 'SVG Importer/SolidColor/SolidColorMultiply': failed to open source file: '../SVGImporterSolidCG.cginc' at line 27 (on d3d11)
    71. [Unity] Compiling Vertex program
    72. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    73. [Unity] (Filename: SVG Importer/SolidColor/SolidColorMultiply Line: 27)
    74. [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorMultiply': failed to open source file: '../SVGImporterGradientCG.cginc' at line 39 (on d3d9)
    75. [Unity] Compiling Vertex program
    76. [Unity] Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
    77. [Unity] (Filename: SVG Importer/GradientColor/GradientColorMultiply Line: 39)
    78. [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorMultiply': failed to open source file: '../SVGImporterGradientCG.cginc' at line 39 (on d3d11)
    79.  
    80.  

    We are using Unity 5.6.1p1. I've checked that some of the files that it's complaining about aren't in fact missing. I can confirm that 'SVGImporterGradientCG.cginc', 'SVGImporterSolidCG.cginc' and 'UnitySVG.cginc' exists in the project in the default location where the plugin importer put them.


    Help on the topic will be greatly appreciated. Tell me if you need more info.


    Regards,

    Milcho
     
    Jaroslav-Stehlik likes this.
  20. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    41
    Is there an ETA on a fix for this? Is there a temporary fix we could implement ourselves in the meantime?
     
    TeamZero likes this.
  21. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    @Jaroslav-Stehlik I was curious about the same thing. I've had a few projects that had short deadlines so I ended up replacing the SVGs with PNGs in the meantime, because the aliasing was so bad that it made the items unusable.
     
  22. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    I just added this fix to the new version, Thanks for pointing this out!
     
    royvaneijndhoven likes this.
  23. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thanks, I am just now investigating that issue.
    Will keep you updated on this.
     
    TeamZero likes this.
  24. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,
    Thanks for the screenshot. Did you also tried default Unity Sphere with a regular material,
    just to be sure that this is not an Unity issue on its own? Thanks!
    The regular shaders in SVG Importer are extremely simplistic so it should not
    affect any platform.
     
  25. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    I recommend to reimport these specific shaders.
    They are probably wrongly compiled by Unity.
    That happens a lot with the new Unity Shader Compilation system.
    Hope that helps!
     
  26. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    I just found out that antialiasing and gradients get corrupted only when there is any SVG Image presented in the project.
    Without it everything works as expected from my observation will do another check.
     
    TeamZero likes this.
  27. mrjohndoe

    mrjohndoe

    Joined:
    Jan 16, 2017
    Posts:
    1
    getting this error
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      34.8 KB
      Views:
      490
  28. michelm

    michelm

    Joined:
    Jul 2, 2012
    Posts:
    9
    Yes, it is definitely a problem with SVG.

    60fps in empty scene with an Image in UI canvas, sphere, and the FPS counter.
    As soon as I add SVGImage to the canvas, FPS drops. I don't even have to add an SVGAsset to it.
     
    Last edited: Jun 26, 2017
  29. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    That is probably due to old UI shader. I post an updated version.
    Thanks!
     
  30. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    So I just found the culprit of the UI problem
    and I am having troubles because Unity somehow Messes up with UV channels in UI
    even if I fully manually assign them, the data is different in shader.
    so.. Does anyone know about this problem? Because this breaks the UI for SVG Importer a lot.
     
    TeamZero likes this.
  31. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    So there is a manual hotfix for everyone having issues with unity UI.


    You have to enable on every canvas which uses SVG Importer
    Under additional shader channels TexCood1 and Texcoord2
    If you want to antialias you have to also enable Normal.
     
    TeamZero likes this.
  32. royvaneijndhoven

    royvaneijndhoven

    Joined:
    Jun 1, 2017
    Posts:
    65
    We're having some trouble. We exported a bowlingball image as SVG, the image itself has a transparent box around it to make sure we have a correct alignment. The problem is that when we import the actual image into Unity the transparent box is cut off, even when we check/uncheck the Ignore SVG Canvas setting.

    What is causing this behaviour?

    I've added the bowlingball image as PNG, so you can see the box. And the result in the Editor as a seperate image.

    bowlingbal.png
    resultineditor.png
     
    Jaroslav-Stehlik likes this.
  33. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Could you please send me your SVG File and the original source file?
    Thank you!
     
  34. royvaneijndhoven

    royvaneijndhoven

    Joined:
    Jun 1, 2017
    Posts:
    65
    I've sent you a download link for the files.
     
  35. BeeBop1

    BeeBop1

    Joined:
    Oct 5, 2013
    Posts:
    18
    Hey @Jaroslav-Stehlik would you consider releasing a "pro" edition of the svg importer with the source code included and charge a premium price for it? I've seen a few other devs on the store doing such thing and I find that I am more than happy to pay extra to get access to the source. The reason we would like the source is because if we are to utilise this tool to build a game it is a fair investment from our company. If for whatever reason you choose to stop support in the future this could jeopardise our game and company.
    Hopefully you will consider it as an option!
    Thanks very much!
     
  36. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    Since Unity 5.5 I'm unable to build my game using Unity Cloud. During Unite 2017 I asked one Unity staff member that was holding the Cloud Build booth to take a look at my project. According to that person SVG Importer is the reason why all builds failed. The errors are the following :

    Code (CSharp):
    1. [Unity] NullReferenceException: Object reference not set to an instance of an object
    2. [Unity]   at SVGImporter.SVGAtlas.RebuildAtlas () [0x000f1] in /Users/****/Downloads/MMFractions/Assets/Plugins/SVG Importer/Plugins/Core/SVGAtlas.cs:739
    3. [Unity]   at SVGImporter.SVGAtlas.OnAtlasPreRender (UnityEngine.Camera camera) [0x0002f] in /Users/****/Downloads/MMFractions/Assets/Plugins/SVG Importer/Plugins/Core/SVGAtlas.cs:434
    4. [Unity]   at SVGImporter.Utils.SVGCamera.UpdateCameras () [0x00075] in /Users/****/Downloads/MMFractions/Assets/Plugins/SVG Importer/Plugins/Utils/SVGCamera.cs:41
    5. [Unity]   at SVGImporter.SVGAtlas.Update () [0x00041] in /Users/****/Downloads/MMFractions/Assets/Plugins/SVG Importer/Plugins/Core/SVGAtlas.cs:415
    Any idea what can trigger those errors and how to fix those ?

    Thanks
     
    Jaroslav-Stehlik likes this.
  37. thinktoscore

    thinktoscore

    Joined:
    Jan 4, 2016
    Posts:
    1
    Hi,

    I'm playing around with flags in Sketch, however when I import them into Unity using SVG Importer something goes wrong. It seems like there is an issue with some overlapping paths.

    See the example here. First row from Sketch, second row from Unity 5.6.1f1.
    example-svg.png

    I've attached a zip file with the five svg's as well. If anyone can tell me how to fix this, it would be highly appreciated!

    Thanks in advance. And let me
     

    Attached Files:

  38. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    I don't know if my issue is directly related to SVGImporter but it happens when trying to work with SVGRenderers.

    I'm trying to reduce my scene build size by removing all reference to SVGAssets of all my SVGRenderers. I will re-assign those later dynamically. But after some tests it seems that set the Vector Graphics property to null by code is not the same as manually select "none" in the inspector.

    I made 4 tests to see what happens :

    1/ Export the scene as it is. Scene build size = 12 MB.
    2/ I select all the SVGRenderers, click on the Vector Graphics property, select none, export the scene. Scene build size : 1.2 MB.
    3/ Using a script with the PostProcessScene I retrieve all the SVGRenderers and set the VectorGraphics property to null. Scene build size = 12 MB.
    4/ Using the same script but in editor mode in order to set all the Vector Graphics to null, save the scene (another name) then export. Scene build size 12 MB.

    S the question is why in case 3 and 4 my scene build size does not change ? When I reload the case 4 scene I can see for a second all my scene assets visible and then disappear. It's weird because when I check any of SVGRenderer its VectorProperty is "none".

    I do not have any idea why removing all SVGAsset references hold by all the VectorGraphic properties using code does not lead to the same result as manually selected all and select "none".

    Any idea or advice would be very appreciate. Thanks.
     
    Jaroslav-Stehlik likes this.
  39. IzHard

    IzHard

    Joined:
    Oct 16, 2016
    Posts:
    1
    Hello. I use beta version of Unity (2017.1.0f1) and can't to set SVGAsset public field in Inspector for any script. Unity shows an error. Do you adapt the tool for new version of Unity?
    Screen Shot 2017-07-09 at 10.11.36 AM.png

    P.S. It make error only if use "Select SVGAsset" window for setting SVGAsset field in Inspector. I use drag'n'drop method, but deemed it necessary to point out the problem.
     
    Last edited: Jul 9, 2017
    Jaroslav-Stehlik likes this.
  40. JaimeAL

    JaimeAL

    Joined:
    Dec 4, 2015
    Posts:
    21
    The difference is that in case number 2 no SVGAsset is being loaded as they are not needed for the game to run, whether you put them manually or dynamically all your SVGAssets need to be loaded at some point and thus need to be put in the final build.

    Unity ignores assets that are not being used when compiling, in case 1, 3 and 4 you clearly use them and are added to the build, but in case 2 you do not.

    If what you refer to is the scene's size by itself and not the entire build of your project, then I have no clue how Unity handles that, but I hardly think this is what you are refering to.
     
    Jaroslav-Stehlik likes this.
  41. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    @JaimeAL I'm not sure why in case 3 & 4 assets should be added in the build, especially in case 4 where I remove all SVGAssets references before I make the build. So it should be like case 2. And yes, I'm referring to the scene size.

    Thanks for your answer.
     
  42. BrainAndBrain

    BrainAndBrain

    Joined:
    Nov 27, 2014
    Posts:
    100
    We use Sketch extensively with SVG Importer, and see this problem as well. It's an issue with Sketch-generated SVGs and how they're interpreted by SVG Importer. Apparently Sketch must save them in a somewhat non-standard format.

    Our solution is to open each SVG in Inkscape and re-save it, overwriting the SVG file. These files then import perfectly with SVG Importer. We also wrote a small script to do this efficiently on large batches of SVGs.

    Hope that helps!
     
  43. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    928
    @Jaroslav-Stehlik I have been away from my project where I was using SVG_Importer for some time now. Sorry to see you burned yourself out (Been there and done that - never worth it) Glad to see your back at supporting the package.

    I am using Unity 2017.1-f3 i removed and re-imported the latest asset store version of SVG-Importer (I went from 1.1.2 to 1.1.4). The svg imports look pretty good for the most part (see slight white gap below on top grape). But the objects on screen using iOS as a target i get these odd artifacts. Have not tested on an actual device yet.

    SVG Import
    upload_2017-7-16_10-4-47.png

    Ingame object in edit mode -see white spacing around grapes gets worse

    upload_2017-7-16_10-7-3.png

    ingame view @ IPhone5 wide UnIty screensize setting - not looking too good ;(

    upload_2017-7-16_10-7-58.png

    Any thought on what I might have have missed on upgrading SVG-Importer? I am pretty sure it looked a lot better before.

    Thanks
     
  44. moonmenlabs

    moonmenlabs

    Joined:
    Mar 27, 2017
    Posts:
    3
    We're also trying to make a Universal Windows Platform build of our project but it results in a compiler error related to the SmallXmlParser in the SVG Importer Core.

    Error message: Assets\Plugins\SVG Importer\Plugins\Core\Implementation\XML Parser\SmallXmlParser.cs(106,26): error CS0117: 'char' does not contain a definition for 'GetUnicodeCategory'

    Some extra information, we're using Unity 2017.1.0f3 and SVG Importer 1.1.4.

    Is there a workaround until you release the fix.
     
  45. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello, SVG Importer is no longer compatible with older versions of Unity than 5.6.1f1
    I would for sure try to upgrade your version of Unity.
     
  46. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    H
    Hello, the source code is already part of the basic version.
     
  47. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello!

    Sketch has a really awfull SVG Exporter.
    I do recommend to omptimize your SVGs from sketch via
    SVG Optimiser before importing in to unity.

    http://petercollingridge.appspot.com/svg-optimiser

     
  48. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi, I said since 5.5 so it meant alose later version. I'm using 5.6.1p4 and still have the issue.

    Thanks
     
  49. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Yes, I do adapt and I will take a look at this, thanks!
    Is there any more information about this from console?
     
  50. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Yes there is,

    in SmallXMLParser.cs
    comment the section from line 105 to line 123
    it should look like this

    #if !UNITY_WSA
    switch (Char.GetUnicodeCategory(c))
    {
    case UnicodeCategory.LowercaseLetter:
    case UnicodeCategory.UppercaseLetter:
    case UnicodeCategory.OtherLetter:
    case UnicodeCategory.TitlecaseLetter:
    case UnicodeCategory.LetterNumber:
    return true;
    case UnicodeCategory.SpacingCombiningMark:
    case UnicodeCategory.EnclosingMark:
    case UnicodeCategory.NonSpacingMark:
    case UnicodeCategory.ModifierLetter:
    case UnicodeCategory.DecimalDigitNumber:
    return !start;
    default:
    return false;
    }
    #endif
     
    moonmenlabs likes this.