Author Topic: Export final SVG without clipping-information in the svg file  (Read 5742 times)

January 14, 2017, 07:35:31 AM
Read 5742 times

electrocnic

  • Sr. Newbie

  • Offline
  • **

  • 3
Hi,

I hope someone can help me with this:

I currently make 2D sprites for a game, and the game will be made in Unity. I want to use vector graphics, so the game can be played not just on Smart Phones, but also on Tablets or even Desktops.
(Therefore I use a Plugin for Unity, called SVG Assets).

However, the mentioned plugin does not support every little detail of the svg-standard. My problem now is, that my sprite will show up fine in Unity except for clipped areas.
The clipped areas are not clipped when loaded in Unity. Therefore, the whole clipped object will be visible in Unity, even the hidden regions which should be invisible due to the clip.

My question is:  Can I somehow export my artwork AS SVG, so that clipped areas are first converted into vector paths or meshes? I mean to convert clipped regions into "As seen" paths?

Similar to what Inskape already does when I add nodes between other nodes on a curve, it will add them like nothing has changed. Can I tell Inkscape it should resolve my clipped regions, so like I would have painted curves manually like they are visible on screen?

Thanks!


January 14, 2017, 12:35:01 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Wouldn't that be nice!?  It would eliminate all those complaints about clipping not removing the unwanted parts, like true cropping does.  And wow!  Clipping is a pretty big feature not to support.  Hopefully they can get it working soon.

The only way I can think that you can do it, is to use path operations instead of clipping.  (mostly Difference, Intersection and/or Cut Path, probably)  There is a Multi-Boolean extension which allows you to perform many operations over many paths at a time, instead of only 2 paths at a time.  That could help significantly.  Let me find that link.....

https://inkscape.org/en/~Moini/%E2%98%85multi-bool-extension-cut-difference-division

Clones could come in handy too.

Have you confirmed that it officially doesn't support clipping?  Or did you just surmise it, because of what you observe?  After further thought, you might investigate whether it is clipping that isn't supported.  Because if you have groups which are clipped, and the Unity plugin didn't support groups, then the forced ungrouping would result in unclipping. 

(That little beauty of an aggravation was introduced with 0.91, iirc.  Before that, you could ungroup, and everything remained clipped.  I don't think it's actually a bug, but it bugs me (haha).)

Hhmm, if it doesn't support clipping, it probably doesn't support masking either.  But if it does, you can probably find a way to use masking instead of clipping.

Sorry, I wish I had a better answer for you.

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 14, 2017, 02:34:08 PM
Reply #2

electrocnic

  • Sr. Newbie

  • Offline
  • **

  • 3
wooooooaaaaaa  :f5:

thanks for those hints, they seem pretty promising to me  :2tu: :2tu: :2tu:

I indeed just saw that it did not work, by testing it... did not investigate into reading all of the manuals of the plugin.
Aaaaand I indeed have groups over every clipped object.

Thus, when I have got time, probably Monday, I will first try it without groups and then with the boolean workaround...


It is just a necessary tool (clipping), which I need to be able to make animations (single frames of my sprites) in (actually) PonyScape  :lol:
But for the exported individual frames (still in svg) it is ok if there is something like no groups or no clipping...

For now, thanks a LOT for the quick and promising answer  :ur:

I will come back on Monday or Tuesday with my results  :ty1:

January 14, 2017, 06:04:06 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ok, well I really have no idea about the Unity plugin.  I'm just thinking "what if....."

Maybe the Unity plugin has a forum or mailing list or part of a forum, where you can ask about it?  You might not have to so do much work, if you know exactly what the problem is.  Not so much troubleshooting.

Good luck  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 17, 2017, 02:44:25 AM
Reply #4

electrocnic

  • Sr. Newbie

  • Offline
  • **

  • 3
Ok, the Unity-Plugin indeed does not yet support clipPaths. They said, they will implement it asap, but that is 2 years ago, so I guess it won't come...

However, the boolean workaround does the job.

I will write a plugin which resolves every clipped path in a layer by one execution, because that would be too much work if done by hand.

Thanks!

January 17, 2017, 06:10:19 PM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Wow, that would be awesome to have an extension like that!  I could solve the problem I mentioned before, where people don't like clipping because it's not the same a cropping.  It would make clipping more like cropping!

Whenver you finish, you can post to the website:  https://inkscape.org/en/gallery/=extension/?order=-edited
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann