Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

type 'rotational' error on MorpSVG

Recommended Posts

hi guys


I keep getting this warning in my console in regards to this piece of code


.to(verifier.dom.container.find('#left-eye'), 3.32, {morphSVG:'#left-wink', type:'rotational', origin:'0% 50%', ease: Power2.easeIn}, 'time+=17.4')

now i am not quite sure why, have i done something wrong?


many thanks 



Screenshot 2019-11-04 at 01.44.29.png

Share this post

Link to post
Share on other sites

Yep, you just formatted your stuff incorrectly - you need to tuck all your morphSVG-related stuff into an object:


// BAD:
...{morphSVG:'#left-wink', type:'rotational', origin:'0% 50%', ease: Power2.easeIn}...

// GOOD:
...{morphSVG:{shape:'#left-wink', type:'rotational', origin:'0% 50%'}, ease: Power2.easeIn}...

As a convenience, if you're ONLY passing a shape in, there's no need to wrap stuff in an object. But once you start needing to define additional morph-related settings, you've gotta wrap it in an object so that it's properly scoped/grouped. 


The way you've got it formatted now makes GSAP think you're literally trying to animate "type" and "origin" properties of your target (which don't exist, of course, hence the warnings).


Does that clear things up for you? 

  • Like 3

Share this post

Link to post
Share on other sites

Hi @GreenSock


many many thanks, yes it makes complete sense to me




  • Like 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.