Discussion in 'Assets and Asset Store' started by Jaroslav-Stehlik, May 4, 2015.
There is a patch fix for this (I can confirm works with Unity 5.5.2) posted a few pages back.
Is there any way to tell the renderer to show only the first path, the first and the second path, etc. for all path id's mentioned in the SVG DOM file? I need to build up my meshes one by one (this is to show stroke animations for Japanese characters). I assume it's too late once the whole SVG has been converted to a mesh after import, but building up to dozens of separate SVG files (one for each stroke, and that for thousands of characters) for one asset seems a bit overkill. There's a layer box I can tick and I'm not sure whether that's the same thing (I'm pretty new to Unity and programming in general), but even then I have no idea how to control these layers.
I don't see a reason why it wouldn't work, as long as the source doesn't have a lot of elements that this plugin doesn't support... even then you could likely just strip them out.
Sidenote: I haven't had any problems with Illustrator since I started using this plugin to export the svgs.
Thanks for the tip. Just tested this, and looks interesting! I'll probably use it for quick exports of layers.
I'm currently using a script in AI called "Multi Exporter" which also exports layers into a separate SVG files, but gives you options like adding suffixes to the resulting files (which is useful for my purposes).
My pipeline thus looks like this:
Work in the AI master only. Never touch any SVG.
Keep relevant items together in one master file as far as useful. For example, different trees, rocks, ground parts that belong into a "forest" stage can be kept in "Forest.ai". Each character has one file etc.
In Illustrator, pick File > Scripts > MultiExporter and export into a temp folder as SVGs.
The exporter allows to export either one layer, or all layers, but sometimes I changed a few. I then export all, then pick what I need from the temp folder and move it to the asset folder proper. Another benefit of the temp folder is that you can double check naming conventions and such.
After having moved the filesto the relevant folders in assets, I destroy the temp (the point is not to get attached to the SVGs, but always have the process flow from the master file).
I believe I got the Multi Exporter from here, but you might want to search for other/newer versions.
Using Unity 5.6.0f3 (64 bit) for PC Standalone <DX11> with SVG Importer 1.1.3 I get a couple of obsolete errors for Mesh.Optimize() and a shader error:
Shader error in 'SVG Importer/Standard SVG': invalid subscript 'tangentToWorldAndPackedData' at Assets/SVG Importer/Plugins/Shaders/Standard/UnitySVG.cginc(120) (on d3d11)
Any chance of a fix?
This asset has been amazing in the past. Unity has pulled the rug from under you on this one.
In 5.6.0f3 I'm getting some serious issues with creating new UI, everything looks all cut up and half transparent. Old UI elements created before 5.6 don't have any issues, even when removing and replacing SVGAssets from SVGImages. Not sure how to resolve it...
This is a flat white rounded rectangle SVG that works totally fine with prefabs made before 5.6, and totally jank in prefabs made in 5.6
Ah, of course I figure it out immediately after posting.
Make sure your newly created canvases have their "Additional Shader Channels" to include TexCoord1, Normal, and Tangent!
Ah right on. I can't remember if I tried that one before, although it looks familiar.
Before I found the plugin that I made note of, I constantly had problems with all exporting methods (even native illustrator export), as they were all generating certain decimal numbers in the svg that svg importer couldn't parse. As long as you're not getting 'corrupted svg' errors on every svg, then it's probably safe to say your plugin works.
Has anyone had issues with svg assets looking poor / not anti-aliased on iOS devices?
The assets look mint on Android, but on iOS they're pretty rough around the edges... My first thought was that it had something to do with the retina display, but it's hard to tell.
I am stuck at the same error, any ideas?
Has anyone an idea. I want my SVG sprites to use the SVG Importer/SolidColor/SolidColorDiffuseOpaque shader. I am setting this currently in the inspector on any sprite object and it works. But when I load the project again, this is always set to SVG Importer/SolidColor/SolidColorOpaque again. I am probably not setting this at the correct place, can anyone give me a pointer?
Regarding this error, manually declaring what is missing seems to work so far. In the script SVGImporterSettings.cs:
public static SVGImporterSettings Get
if(_instance == null)
_instance = Resources.Load<SVGImporterSettings>("svgImporterSettings");
if(_instance == null)
Debug.LogError("Cannot Load SVG Importer Settings! Please Move SVG Importer Settings in to Resource folder.");
_instance = ScriptableObject.CreateInstance<SVGImporterSettings> ();
_instance.defaultSVGFormat = SVGAssetFormat.Transparent;
_instance.defaultUseGradients = SVGUseGradients.Never;
_instance.defaultAntialiasing = true;
_instance.defaultAntialiasingWidth = 2f;
_instance.defaultMeshCompression = SVGMeshCompression.High;
_instance.defaultVerticesPerMeter = 1000;
_instance.defaultScale = 0.001f;
_instance.defaultDepthOffset = 0.01f;
_instance.defaultCompressDepth = true;
_instance.defaultCustomPivotPoint = false;
_instance.defaultPivotPoint = new Vector2 (0.5f,0.5f);
_instance.defaultGenerateCollider = false;
_instance.defaultKeepSVGFile = false;
_instance.defaultUseLayers = false;
_instance.defaultIgnoreSVGCanvas = true;
_instance.defaultOptimizeMesh = true;
_instance.defaultGenerateNormals = false;
_instance.defaultGenerateTangents = false;
_instance.defaultSVGIcon = null;
_instance.ignoreImportExceptions = true;
If you ever have to use this, keep in mind to write down your on settings!
Been having issues with antialising for months now, sometimes it is as random as that if you change the rotation or scale of an object it will stop processing Antialising properly.
Sometimes even it will go bananas and make a blurry mess when scaling down.
This happens both in iOS and Android, mobile and tablet. We have to go SVG per SVG checking their quality settings and such to try to work-around it. So far we manage, but it'd be great to have antialising working back again, as much as I love pixel art I do not think it goes well with SVG.
Hey y'all, noticed that the SVG Editor for setting pivots / sliced corners editor window broke in 5.6, you'll need to change some code to fix it.
Go to SVGEditorHandles.cs and change this line:
typeof(HandleUtility).GetMethod("ApplyWireMaterial", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null);
//top of file
//fix for above code
typeof(HandleUtility).GetMethods(BindingFlags.Static | BindingFlags.NonPublic)
.First(m => m.Name == "ApplyWireMaterial" && m.GetParameters().Length == 0)
(Or something like it). Not used to reflection, so I'm not sure if there's a better way to handle an AmbiguousMatchException. Haven't tested outside of Unity 5.6 but theoretically would work on earlier versions of Unity.
Doesn't seem to work at all with Unity 2017.1.0b1.
Ugh, this is a real shame. This asset is amazing and I feel for the developer, I hope he makes a recovery soon. For now I've had to switch back to using sprites for my project as can't rely on using a 3rd party asset that isn't supported anymore
Maybe someone could compile a Google Doc of all the changes/fixes that are needed from the currently released 1.1.3 version of this asset to help the developer out, save time and hopefully get an update? That way everything is on one page and you don't have to dig through pages of forum posts to find fixes.
So I reached out to Jaroslav on Twitter, he looks busy working on some vr projects at the moment. He said he is open to the idea of selling his asset to another developer, so that they could keep up the development:
Anyone interested? Such a great asset, shame to see it go away.
Maybe Unity team ? ;-)
Here's a git patch file to update SVG importer 1.1.3 shaders for Unity 5.6 compatibility:
Make sure you've already applied the earlier patch file for Unity 5.5:
Hi there folks, Alive again.
Could I help you with fixing the bugs?
Great to have you back! I think the most important bugs are with Unity 5.6 compatibility (see above) and from a personal point of view would be great if there could be some draw call batching, as I'm getting a lot of draw calls - not sure it's possible but would be great.
Draw Call batching is a problem,
because vector graphics contains a lot of triangles it is highly not recommended
as it can really slow down the CPU.
I would recommend using static batching as the main optimization for this case.
you can use at runtime this command which has a root.
That means that root can move but children cannot which can save a lot of draw calls.
Thanks very much. I'll give this a go. It looks like it should reduce the calls.
Hello, just to bump it
I am having issues with Antialising turning off in assets that go through some kind of transformation, some SVGs apply Antialising just fine but when they get some rotation or scaling going on the antialising just disappears and goes back to being pixely, going back to the transform in which Antialising worked brings it back. Its really confusing
I explained further another antialising issue in a previous post in page 20: https://forum.unity3d.com/threads/s...upported-released.323618/page-20#post-2917731
and in this very same page a quick fix to that issue about undeclared stuff that broke SVGs in some Android versions
Could you please send me an example?
I MADE A STATEMENT IN THE DESCRIPTION OF THIS FORUM.
PLEASE DO READ. I KNOW THAT THE WORST THING IN WORLD IS
I was quite disappointed when this plugin seems to have no future. Because there is not even a single alterantive to it. So losing it was not easy. Now your new message changes everything.
I fully support you and your decision to focus on latest unity versions. Its Better than having a latest version supported only plugin THAN not having at all.
Thank you for coming back
I thank you for understanding my situation.
I feel ashamed a lot by these circumstances because I fell in these problems by myself.
Hey @Jaroslav-Stehlik , we are glad to see you back i support your decision to work on new unity versions one quick question... my company is making coloring apps and we would like to fill areas of an image with gradients, but i am unable to change solid color fill to gradient. Additionally i see that there is support for FILL_TYPE.TEXTURE but i am not sure how to use these options. Any suggestion would make my life so much easier, thank you. And welcome back!
I vote for 5.6+ support at the cost of older versions
I was wondering, is it possible to bake a light map for SVG assets ?
Jaroslav-Stehlik, absolutely make sure you take care of yourself! We totally understand. As for prioritizing versions, I think Unity 5.6+ (or simply just the most recent release of Unity at any given point) is totally acceptable. Thanks for all your hard work!
In my current project I suddenly have a new error :
Some assets have their SGRenderer and Mesh Renderer deactivated and no materials at all. Even if I re-activate and re-assign material, as soon as I hit the Play button scripts are deactivated and materials removed. I tried to delete and re-import the plugin but the error remains.
Any idea why ?
Ok, just for let you know, by activating normals and tangents on all SVGAssets the error is gone. Not sure why, but at least is fixed.
Thank you for your report.
I never baked light in SVG Importer, so that is quite interesting behavior!
Thank you! I will submit an update for 5.6 soon!
I have an issue with layer and sorting order. In my current projet I have for example 3 SVGs which have the same z position value, the same layer but different sorting order. But layer and sorting order seems to not be used correctly and the SVG that should be in front of the other is behind. Even if I set a very big sorting order and set the most front layer nothing change. The only thing that made this asset to be displayed in front of the other is tho change it's z position value.
Is that normal ? How can I fix that ?
This is a really useful plugin and I really appreciate your efforts in putting together such high quality work, I hope you're able to continue working on it and I'm looking forward to checking out your VR, I know how demanding such projects can be!
I just went to install SVG Importer into a project in Unity 5.6 and I'm seeing a lot of errors related to the Editor namespace, is that part of what you're working on for the 5.6 update? I just want to make sure this isn't being caused by other issues.
When I export to svg as indicated in Svg Importer's documentation, if the misbehavior of the object is small by importing into unity the result is bad. Why is this happening? Thanks in advance. Frank
Hi, I'm interested in this tool but the lack of updates on the last several months makes me worried. Any updates planned?
I just read the rest of the thread and found out about the developer situation. Wish you all the best and hope you find the strength to get back in full health. Best regards!
Yes, I have already a version which does not produce any error, I have to just let testers to try it before submitting on asset store. Want to become a tester? Send me your invoice on my email with your request.
SVG Importer tries to optimize your graphics as well as possible. The quality of the result is dependent on the size of the vector graphics in pixels. If you want to increase the quality of the tesselation just increase the quality number on the asset by large numbers. Hope this helps.
Would it be possible for someone who has already applied patches to share patched shader directly ? Would be very helpful because shader errors make the project unable to build correctly using Unity Cloud.
Very good, posted invoice info on the form on your website, thanks!
Jaroslav let me know if I'm violating something here and I'll remove it!
Any ETA on the new patch? Looking forward to buying the product when it releases.
No, You made a patch and that's completely ok!
I just submitted the new version on Asset Store,
I hope it will propagate fast and that it will solve the most critical issues.
Other issues will be solved one by one in the next time.
Thank you for your support.
I am a little bit slow after my medical treatment and I do understand
things a little bit slower, so I will probably ask you stupid questions
during debugging. But I want to fix the issues.
Have a great day!