UnityGLTF icon indicating copy to clipboard operation
UnityGLTF copied to clipboard

Optimize animation import

Open ashikns opened this issue 5 years ago • 3 comments

Improves upon three things:

  1. Do tangent calculation operations on keyframe cached array rather than AnimationCurve. This is the most important change. Unity profiler shows that accessing AnimationCurve.keys is a costly operation.
  2. Optimizes branching by moving if..else outside loop. The compiler probably already does this but it's nice to do it ourselves.
  3. Fixes a bug when two incoming animation keys have the same time value. I don't know if this is valid per gltf specs but I faced this using some models downloaded from Sketchfab.

ashikns avatar Oct 07 '19 19:10 ashikns

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 07 '19 19:10 CLAassistant

Just saw that there's another PR that includes first point from this: #479

ashikns avatar Oct 07 '19 19:10 ashikns

Thank you for contributing the change! @AdamMitchell-ms can you review?

blgrossMS avatar Oct 07 '19 21:10 blgrossMS