Jump to content
GreenSock

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

Nisanez

Members
  • Posts

    3
  • Joined

  • Last visited

Nisanez's Achievements

0

Reputation

  1. Thanks, the code was just an example of the code I am using. The real class name is not 'Animation' . Thank you all, what I will do is manually clean the objects from the undefined values, just to make things work. And later think of a way to refactor the logic when using GSAP.
  2. Thank you for the responses! I learned from you suggestions, However they still neglect the undefined values. While using GSAP 2 I used classes to store the animation information. For example: class Animation { x: number y: number rotation: number duration: number constructor(...) {} } const createAnimation = (tl: gsap.core.Timelime, animData: Animation[]) => { for( let i = 0; i < animData.length ; i++ ) { tl.to(someElement, {...animData[i]}) // Doesn't work if the Animation object containes undefined value. } } Once the animation has some undefined value, (because it is not needed) the animation stops. Before changing the logic to work with GSAP 3, I wanted to be sure I am not missing something. Thanks again!
  3. Hi GreenSock forum! I am working on migrating some code-base to GSAP 3. However, I noticed a difference in behaviour that makes my life a little difficult and maybe there is a solution I am not aware of. While using GSAP 2, I used the assumption that undefined values are ignored and does not effect the animation. As can be seen in this codepen I created: So some of the code has objects that part of the time contains 'undefined' values in case they does not interest me. When trying to migrate to GSAP 3 I noticed that when an undefined value is encountered the timelines just stops or behaves undefined. Forcing me to create 'clean' object for every scenario and make sure there are no undefined values. As can be seen in this codepen: https://codepen.io/Nisanez/pen/yLeqBJq Is there a way I can migrate without the huge change of code? Thanks! Nissim
×