Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with simple scale and translation animation with v3.1.6 #1129

Closed
4 tasks done
tanvinabar opened this issue Feb 20, 2020 · 2 comments
Closed
4 tasks done

Issue with simple scale and translation animation with v3.1.6 #1129

tanvinabar opened this issue Feb 20, 2020 · 2 comments

Comments

@tanvinabar
Copy link

tanvinabar commented Feb 20, 2020

Hi! We are trying to integrate a simple scale and translate animation using Lottie. However, even with 24fps, the animation jitters quite a bit. A different, more complex animation works pretty smoothly.

Is it because of the translation?

My app is a basic new Single View App project from Xcode, with Cocoapods. Testing on iPhone 7.

Can you please advise on what could be wrong?
This works very well on Android, with the latest SDK

Check these before submitting:

  • [] The issue doesn't involve an Unsupported Feature
  • This issue isn't related to another open issue

This issue is a:

  • Non-Crashing Bug (Visual or otherwise)
  • [] Crashing Bug
  • [] Feature Request
  • [] Regression (Something that once worked, but doesn't work anymore)

Which Version of Lottie are you using?

Lottie 3.1.6

What Platform are you on?

  • [] MacOS
  • iOS

What Language are you in?

  • Swift
  • [] Objective-C

Expected Behavior

Actual Behavior

Code Example

`class ViewController: UIViewController {
var animationView: AnimationView?

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    
    let animationModel: Animation? = Animation.named("ratingsHeartAnimation1")
    let animationView: AnimationView = AnimationView(animation: animationModel)
    self.view.addSubview(animationView)
    animationView.respectAnimationFrameRate = true
    animationView.loopMode = .loop
    self.animationView = animationView
}

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    
    self.animationView?.frame = self.view.frame
    self.animationView?.layoutIfNeeded()
}

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    
    self.animationView?.play(completion: { (success) in
    })
}

}`

Animation JSON

{"v":"5.6.3","fr":24,"ip":0,"op":104,"w":720,"h":1440,"nm":"Single Heart fly ","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"heart Outlines 14","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.537,"y":1},"o":{"x":0.333,"y":0},"t":5.606,"s":[231,1256,0],"to":[0,-312.667,0],"ti":[0,312.667,0]},{"t":95.0001368556056,"s":[231,-620,0]}],"ix":2},"a":{"a":0,"k":[100,100,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":5.606,"s":[0,0,100]},{"t":15.2149806056056,"s":[70,70,100]}],"ix":6,"x":"var $bm_rt;\nvar freq, decay, n, n, t, amp, w;\nfreq = effect('Scale - Frequency')('ADBE Slider Control-0001');\ndecay = effect('Scale - Decay')('ADBE Slider Control-0001');\n$bm_rt = n = 0;\nif (numKeys > 0) {\n $bm_rt = n = nearestKey(time).index;\n if (key(n).time > time)\n n--;\n}\nif (n > 0) {\n t = $bm_sub(time, key(n).time);\n amp = velocityAtTime($bm_sub(key(n).time, 0.001));\n w = $bm_mul($bm_mul(freq, Math.PI), 2);\n $bm_rt = $bm_sum(value, $bm_mul(amp, $bm_div($bm_div(Math.sin($bm_mul(t, w)), Math.exp($bm_mul(decay, t))), w)));\n} else {\n $bm_rt = value;\n}"}},"ao":0,"ef":[{"ty":5,"nm":"Scale - Frequency","np":3,"mn":"ADBE Slider Control","ix":1,"en":1,"ef":[{"ty":0,"nm":"Slider","mn":"ADBE Slider Control-0001","ix":1,"v":{"a":0,"k":3,"ix":1}}]},{"ty":5,"nm":"Scale - Decay","np":3,"mn":"ADBE Slider Control","ix":2,"en":1,"ef":[{"ty":0,"nm":"Slider","mn":"ADBE Slider Control-0001","ix":1,"v":{"a":0,"k":5,"ix":1}}]}],"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-3.875,35.935],[29.064,0],[0,0],[32.658,-12.081],[-3.415,-23.522],[0,0]],"o":[[4.521,-41.923],[-29.066,0],[0,0],[-32.657,12.082],[5.936,40.896],[0,0]],"v":[[192.813,86.946],[142.999,18.926],[100.04,45.023],[47.216,20.79],[7.268,86.946],[100.04,181.673]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.894117706897,0.20000001496,0.294117647059,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":5.60560560560561,"op":104,"st":5.60560560560561,"bm":0}],"markers":[]}

@calda
Copy link
Member

calda commented Aug 4, 2022

This animation seems to play with good performance when I test it on master / 3.4.1. Are you still experiencing performance issues with this animation?

@github-actions
Copy link

This issue is stale because it is marked "can't reproduce" and has had no activity in the past week. Please comment with additional information, or this issue will be closed due to inactivity in one week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants