lottie/parser: Fix crash issue when interpolation string is not present in lottie... 93/189093/2
authorsubhransu mohanty <sub.mohanty@samsung.com>
Thu, 13 Sep 2018 09:08:21 +0000 (18:08 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 13 Sep 2018 09:31:08 +0000 (18:31 +0900)
For some version of bodymovin file interpolation string is not part of the keyframe
in those case create one and add it to the cache.

Change-Id: I5853bd7a6f46140d16191c2b79622cfa1f6fb074

example/resource/loading_rectangles.json [new file with mode: 0644]
src/lottie/lottieparser.cpp

diff --git a/example/resource/loading_rectangles.json b/example/resource/loading_rectangles.json
new file mode 100644 (file)
index 0000000..eeb2235
--- /dev/null
@@ -0,0 +1 @@
+{"ip":0,"fr":60,"v":"5.1.20","assets":[],"layers":[{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":16,"hix":10,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[35],"e":[42],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[42],"e":[42],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[42],"e":[35],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173,"s":[35],"e":[35],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":179}]},"y":{"a":0,"k":12}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":15,"hix":14,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[34.961],"e":[42],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[42],"e":[42],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[42],"e":[35],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"y":{"a":0,"k":20.509}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":14,"hix":3,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[35],"e":[42],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[42],"e":[42],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[42],"e":[35],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"y":{"a":0,"k":30}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":13,"hix":6,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[35],"e":[42],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[42],"e":[42],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[42],"e":[35],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"y":{"a":0,"k":39}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":20,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":153,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":173}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":12,"hix":9,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[26],"e":[26],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[26],"e":[33],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[33],"e":[33],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[33],"e":[26],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"y":{"a":0,"k":12}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":11,"hix":13,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[26],"e":[26],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[26],"e":[33],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[33],"e":[33],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[33],"e":[26],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"y":{"a":0,"k":21}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":10,"hix":4,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[26],"e":[26],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[26],"e":[33],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[33],"e":[33],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[33],"e":[26],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"y":{"a":0,"k":30}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":9,"hix":5,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[26],"e":[26],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[26],"e":[33],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[33],"e":[33],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[33],"e":[26],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"y":{"a":0,"k":39}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":21,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":41,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":132,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":152}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":8,"hix":16,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[17],"e":[17],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[17],"e":[24],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[24],"e":[24],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[24],"e":[17],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"y":{"a":0,"k":12}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":7,"hix":12,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[17],"e":[17],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[17],"e":[24],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[24],"e":[24],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[24],"e":[17],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"y":{"a":0,"k":21}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":6,"hix":8,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[17],"e":[17],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[17],"e":[24],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[24],"e":[24],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[24],"e":[17],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"y":{"a":0,"k":30}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":5,"hix":1,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[17],"e":[17],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[17],"e":[24],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[24],"e":[24],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[24],"e":[17],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"y":{"a":0,"k":39}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":63,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":111,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":131}]},"s":{"a":0,"k":[100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":4,"hix":11,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[8],"e":[8],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[8],"e":[15],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[15],"e":[15],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[15],"e":[8],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"y":{"a":0,"k":12}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":3,"hix":15,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[8],"e":[8],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[8],"e":[15],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[15],"e":[15],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[15],"e":[8],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"y":{"a":0,"k":21}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":2,"hix":2,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[8],"e":[8],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[8],"e":[15],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[15],"e":[15],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[15],"e":[8],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"y":{"a":0,"k":30}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179},{"ty":4,"nm":"Rectangle","ip":0,"st":0,"ind":1,"hix":7,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[3.5,3.5,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[8],"e":[8],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[8],"e":[15],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[15],"e":[15],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[15],"e":[8],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"y":{"a":0,"k":39}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":1,"k":[{"t":0,"s":[0],"e":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":64,"s":[0],"e":[89.95437383553926],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":84,"s":[89.95437383553926],"e":[89.95437383553926],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":90,"s":[89.95437383553926],"e":[0],"i":{"x":[0.165],"y":[1]},"o":{"x":[0.075],"y":[0.82]}},{"t":110}]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"gr","it":[{"ty":"rc","s":{"a":0,"k":[7,7]},"r":{"a":0,"k":0},"p":{"a":0,"k":[103.5,203.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.07450980392156863,0.6941176470588235,0.8235294117647058,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-100,-200]},"r":{"a":0,"k":0}}]}],"op":179}],"op":179,"w":50,"h":50}
\ No newline at end of file
index 59b76f2..5f29093 100644 (file)
@@ -1714,6 +1714,7 @@ void LottieParserImpl::parseKeyFrame(LOTAnimInfo<T> &obj)
     VPointF        outTangent;
     const char *   interpolatorKey = nullptr;
     bool           hold = false;
+    bool           lastFrame = true;
     while (const char *key = NextObjectKey()) {
         if (0 == strcmp(key, "i")) {
             inTangent = parseInperpolatorPoint();
@@ -1734,6 +1735,7 @@ void LottieParserImpl::parseKeyFrame(LOTAnimInfo<T> &obj)
         } else if (0 == strcmp(key, "t")) {
             keyframe.mStartFrame = GetDouble();
         } else if (parseKeyFrameValue(key, keyframe.mValue)) {
+            lastFrame = false;
             continue;
         } else if (0 == strcmp(key, "h")) {
             hold = GetInt();
@@ -1759,6 +1761,13 @@ void LottieParserImpl::parseKeyFrame(LOTAnimInfo<T> &obj)
         keyframe.mEndFrame = keyframe.mStartFrame;
     }
 
+    char charArray[20];
+    if (!(lastFrame || interpolatorKey)) {
+        snprintf(charArray, 20, "%.2f_%.2f_%.2f_%.2f",
+                 inTangent.x(), inTangent.y(), outTangent.x(), outTangent.y());
+        interpolatorKey = charArray;
+    }
+
     // Try to find the interpolator from cache
     if (interpolatorKey) {
         auto search = compRef->mInterpolatorCache.find(interpolatorKey);