在 SVG 中创建 Illustrator 顶层
当我将分层 SVG 文件加载到 Illustrator 中时,所有图层都按其应有的方式工作,但它们始终位于新图层下;我没有指定“第 1 层”。
如何创建 SVG,使我的顶层最终也成为 Illustrator 中的顶层?
When I load my layered SVG files into Illustrator all the layers works just as they should but they are always positioned under a new layer; "Layer 1" that I did not specify.
How do I create a SVG where my top layers end up as the top layer in Illustrator as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿,我的所有图层都在第 1 层下重新组合!
是的,图层被保留了!
a.svg
和b.svg
以查看 Illustrator 保存了哪些额外元数据。在您自己的文件中模仿此数据。当您意识到该解决方案是一个巨大的专有 blob(
元素)时,您会哭。Hey, all my layers got regrouped under Layer 1!
Yay, the Layers were preserved!
a.svg
andb.svg
to see what extra metadata Illustrator is saving.Mimic this data in your own file.Cry when you realize that the solution is an enormous proprietary blob (the
<i:pgf>
element).这确实对我来说很重要,所以我停止哭泣,花了几个小时编写了这个解决方案的脚本:
C:\Program Files\Adobe\Adobe Illustrator CS6(64 位)\Presets\de_DE\Skripten
更多信息:
打开 SVG 时,所有实际图层都分组在新的“图层 1”中。这些可以毫不含糊地转换回来。不过,子层是有问题的,因为没有信息可以区分实际的组和应该是子层的组(如果有,请告诉我!)。作为解决方法,我的脚本提示输入递归深度并将所有组转换为该深度内的(子)层。
就我而言,我有三层,其中一层只是更多子层的容器。为了恢复原始图层结构,我执行了深度为 0 的 FixSvgLayers,然后选择容器层并执行深度为 0 的“GroupsToLayers”。
如果所有三个层都是“容器”层,则执行深度为 1 的 FixSvgLayers 将已经足以恢复正确的结构。
如果您不需要任何组并且每个组都应转换为(子)层,只需输入足够高的数字作为递归深度。
It indeed does really matter to me so I stopped crying, spent a few hours and scripted this solution:
C:\Program Files\Adobe\Adobe Illustrator CS6 (64 Bit)\Presets\de_DE\Skripten
A bit more information:
When opening the SVG all the actual layers are groups within a new "Layer 1". These can be converted back without ambiguity. Sub-layers are problematic though, because there is no information to distinguish actual groups from groups which should be sub-layers (if there is please let me know!). As a workaround my script prompts for a recursion depth and converts all groups to (sub-)layers within that depth.
In my case I had three layers, where one of them was just a container for more sub-layers. To get back the original layer-structure I executed FixSvgLayers with a depth of 0, then selected the container layer and executed "GroupsToLayers" with depth of 0.
If all three layers were "container"-layers executing FixSvgLayers with a depth of 1 would have been enough to get back the correct structure.
If you don't want any groups and every group should be converted to a (sub-)layer just enter a high enough number as the recursion depth.