Jump to content
GreenSock

gotaquestion

why is this morph flipping the line?

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

 Take a look at this codepen

 It morphs the two shapes by flipping and growing one of the lines when all it needs to do is tween outward.

Is there something wrong with my svg paths?

 

See the Pen NdNmPg by anon (@anon) on CodePen

Link to comment
Share on other sites

Looks like you've got some strangeness with your paths. You may have to address those issues in your vector software and re-export.

 

To see what I mean please try setting a temporary fill color on your #December_2004 path and watch the morph. You'll see that some of the points are crossing over each other and the fill isn't contained to the outline. Hopefully that makes sense.

 

Happy morphing.

:)

  • Like 1
Link to comment
Share on other sites

wow, I made that change and I see it! so strange. I inherited these paths and I don't work with vector files but I seems I'm going to have to learn. What vector program would you recommend in this situation?

Link to comment
Share on other sites

I personally use Adobe Illustrator for all my vector work. If you have Adobe's Creative Suite, it's what I'd recommend. If you don't have access to that suite, I know quite a few people use Inkscape. It's free and open source.

 

https://inkscape.org/en/

 

Happy tweening.

:)

  • Like 1
Link to comment
Share on other sites

I personally use Adobe Illustrator for all my vector work. If you have Adobe's Creative Suite, it's what I'd recommend. If you don't have access to that suite, I know quite a few people use Inkscape. It's free and open source.

 

https://inkscape.org/en/

 

Happy tweening.

:)

@Pointc, thanks for telling me about inkscape!

I've fixed my path problems and now the morph works way better! but is it now possible to force morphsvg not to cross lines? Take a look at the new codepen below with my new paths.

See the Pen KagZXy by anon (@anon) on CodePen

notice how the loop at the bottom tip crosses over itself during the morph? so I'm wondering if there is a command that could prevent behavior from occurring?

Link to comment
Share on other sites

You'll probably have to play with the shape index a bit to get that right. Fortunately you can use the findShapeIndex() utility. Please check out the docs here:

 

https://greensock.com/morphSVG

 

This thread should prove helpful too:

 

https://greensock.com/forums/topic/13089-morphsvg-and-shape-index/

 

Happy tweening.

:)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×