facebookarchive / Keyframes

A library for converting Adobe AE shape based animations to a data format and playing it back on Android and iOS devices.
https://facebookincubator.github.io/Keyframes/
Other
5.33k stars 302 forks source link

Exporter: Support for OPACITY on images, not just layers #104

Open wang9262 opened 7 years ago

wang9262 commented 7 years ago

Here I faced a curious problem: I made an alpha animation for a png image in AE, but after exporting,the OPACITY attribute of that animation didn't appear in the json file.However.If I made this just for layer(not image Layer), OPACITY appeared as expected. Any ideas?

subtleGradient commented 7 years ago

Probably an unsupported feature. The exporter currently only supports a subset of After Effects properties and stuff

wang9262 commented 7 years ago

@subtleGradient uhh,It seems a supported feature,when I add the OPACITY configuration to the json file,the animation is perfect as expected.Tested on iOS platform.What I added is as below:

...

"feature_animations": [
        // here is added manually
        {
          "property": "OPACITY",
          "key_values": [
            {
              "start_frame": 29,
              "data": [
                100
              ]
            },
            {
              "start_frame": 33,
              "data": [
                0
              ]
            }
          ],
          "timing_curves": [
            [
              [
                0.33333333333333,
                0.33333333333333
              ],
              [
                0.66666666666667,
                0.66666666666667
              ]
            ]
          ]
        }
        ...
]

...