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

Support separated x and y values for points #36

Closed
madsbf opened this issue Feb 2, 2017 · 9 comments
Closed

Support separated x and y values for points #36

madsbf opened this issue Feb 2, 2017 · 9 comments
Assignees
Milestone

Comments

@madsbf
Copy link

madsbf commented Feb 2, 2017

Currently, Lottie searches for "k" as a direct child of "p". However, in some cases, After Effects animations will have separated keyframes for x and y, resulting in a structure like this:

"p": {
    "x": {
        "k": {
        }
    }
    "y": {
        "k": {
        }
    }
}

LottieComposition will throw an IllegalArgumentException with the message "Point values have no keyframes", when trying to load the above JSON.

It would be nice if Lottie could support this structure as it seems to be a common approach to use.
Fixing this will also require changes further down the chain, as JsonUtils.pointFromJsonArray will throw an exception as well as it expects at least two values, but the point may now be 1-dimensional and therefore only contain one value.

Let me know, what your thoughts on this are - I might try to fix this myself, but won't waste time on it, if you are already aware of this limitation and are already working on it f.x..

@bodymovin
Copy link

In case it helps, it gets exported as

"px": {
        "k": {
        },
"py": {
        "k": {
        }

@madsbf
Copy link
Author

madsbf commented Feb 2, 2017

Thanks for the input. As far as I can tell from the source code, this structure would not be supported by Lottie either.

Slightly unrelated to the original issue, but do you know if my designer is on an older version of Bodymovin or possibly After Effects if the file he exports has the structure in my original comment @bodymovin ?

@bodymovin
Copy link

Hmm I don't remember having created it with that structure. Can you send me the exported json to my email?

@gpeal
Copy link
Collaborator

gpeal commented Feb 2, 2017

Yes! This is a feature I've looked in to supporting! I'll add it to my shortlist :)

In the meantime, you should be able to turn off separate dimensions to work around this.

@gpeal gpeal self-assigned this Feb 2, 2017
@pdenise708
Copy link

K

@gpeal
Copy link
Collaborator

gpeal commented Feb 4, 2017

@madsbf @pdenise708 @bodymovin I've added support for this in 1.0.2 which I plan to release next week. iOS may take a little longer though.

@gpeal
Copy link
Collaborator

gpeal commented Feb 4, 2017

Fixed by 0bace80

@gpeal gpeal closed this as completed Feb 4, 2017
@gpeal gpeal added this to the 1.0.2 milestone Feb 8, 2017
@gpeal
Copy link
Collaborator

gpeal commented Feb 10, 2017

@madsbf @pdenise708 1.0.2 is now live. Can you try split dimensions?

@madsbf
Copy link
Author

madsbf commented Feb 13, 2017

I have verified this is working with 1.0.2 @gpeal ! Thanks for the swift response 👍

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

No branches or pull requests

4 participants