Jump to content
Search Community

type 'rotational' error on MorpSVG

bromel test
Moderator Tag

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 

 

bromel

Screenshot 2019-11-04 at 01.44.29.png

Link to comment
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
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.
×
×
  • Create New...