Jump to content


Morph SVG Plug In

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

I am having problems getting the SVG code when saving out SVG files from illustrator.  I am not getting any paths.  I tried replicating exactly the tutorial where a square morphs into a star.  I set up my illustrator file with a background and a start sublayer and an end sublayer just like the tutorial but i got this code.


<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="300px" height="250px" viewBox="0 0 300 250" style="enable-background:new 0 0 300 250;" xml:space="preserve">
<style type="text/css">
<g id="background">
<rect width="300" height="250"/>
<g id="start">
<rect class="st0" width="300" height="250"/>
<g id="end">
<polygon class="st1" points="23,88 109.463,80.133 152,4.447 186.2,84.248 271.326,101.314 206,158.5 216.074,244.732 
141.5,200.275 62.6,236.505 81.837,151.843 "/>
Might anyone know what I am doing wrong.
Link to comment
Share on other sites

It looks like you have your ids on <g> elements instead of the shapes that need morphing


<g id="start">

<g id="end">


But it should be


<rect id="start" ... >

<polygon id="end" ...>


here is your svg in one of our demos: http://codepen.io/GreenSock/pen/Vvyyoo?editors=100


In the future, please provide a demo so that we can better see what is happening. Thanks

  • 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.