Comments (26)
Hi, can you share the json file?
from lottie-api.
Here is a link to the .json file
https://github.com/taylorjames/lottie-test/blob/master/animation-test-01.json
I am able to play the animation fine with lottie-web
from lottie-api.
Thanks for your reply!
from lottie-api.
getLayersByName
is not part of the API yet.
Still working on it and it might not be implemented in the end.
Not sure exactly what you want to do, but you probably want to do:
var layers = animationAPI.getKeyPath('text-layer'); layers.getPropertyAtIndex(0).setDocumentData({t:'test'})
from lottie-api.
Thanks, I am building a web video editor in which you can add animated text layers to a video. Is there a way to easily scale/transform a layer or group of layers from the api?
from lottie-api.
Also, do you know if there is a way to use svg files instead of .json data with lottie?
from lottie-api.
Not really, the main difficulty is to animate them without javascript.
Regarding the scale layer, you can traverse the property model to the scale and pass a value to it.
I can give you an example later if you need.
from lottie-api.
As I am getting deeper into this project I have more questions. Would you be kind enough to jump on a google hangout sometime?
from lottie-api.
I found that the solution to a lot of my questions is to create expressions in AE that are then exported with your plugin. I have a few questions about the fonts. I do not want to export the characters to svg because the text in the animation is just a placeholder for user specified text. My issue is that when I do not convert the characters, my expression that gets the size of the text does not work.
Basically, I am trying to use an expression to make a background rect the same size as the text rect and add a little padding.
Here you can see my ae file and the exported json.
https://github.com/taylorjames/lottie-test
Can you tell me why the background box does not resize when played with the lottie web svg player?
from lottie-api.
@bodymovin can you please advise? I can pay you for your time
from lottie-api.
Hi, sorry I've been busy and I missed this email.
Do you have a link with the implementation?
I've just tried it and it seems to work fine
from lottie-api.
weird, ok let me see if I can make something public for you to try
from lottie-api.
In after effects the yellow box behind the text is as wide as the text plus a little padding. When lottie plays it, it looks as though it is only the padding dimensions. The animation works however the yellow box is not sized correctly according to the text. Are you seeing the same result as in after effects?
Thanks bodymovin!
from lottie-api.
Yes, I'm seeing the yellow box resize together with the text dimensions.
from lottie-api.
Interesting, what implementation are you using to play the animation?
from lottie-api.
nothing out of the ordinary
from lottie-api.
I found the issue.
This works.
var animData = {
container: state.element,
renderer: 'svg',
loop: false,
autoplay: false,
path: '/static/assets/test/animation-test-01.json',
rendererSettings: {
className:'svg-layer-'+idx
}
};
this doesnt work
var animData = {
container: state.element,
renderer: 'svg',
loop: false,
autoplay: false,
animationData: layer.svg.json,
rendererSettings: {
className:'svg-layer-'+idx
}
};
The json in the second one is imported via webpack and passed as a key/value to the layer
from lottie-api.
I just tried it with animationData too, and it works on my side too.
Is it possible that the element is not added to the DOM when started?
getSourceRectAtTime relies on getBBox and it probably doesn't measure correctly the element if it's not yet drawn.
from lottie-api.
Maybe It could have something to do with how webpack is loading the json?
from lottie-api.
I am using react server side so that could be
from lottie-api.
I need to work on removing that dependency to measure text layers, but unfortunately it's not ready yet.
from lottie-api.
Ok, I got it working.
The issue was the I was hiding all the layers with display: "none"
soon as they were created.
from lottie-api.
Thanks for your help @bodymovin
from lottie-api.
nice! glad it works
from lottie-api.
@bodymovin would it be possible to create an after effects file from the exported json file?
from lottie-api.
It should be possible to a certain extent, but I haven't worked on it yet.
from lottie-api.
Related Issues (20)
- Documentation lacking and/or unclear
- Multiple dependency vulnerabilities in npm module HOT 3
- Typescript Definitions
- KeyPathList function has logic bugs on iteration
- Change color dynamically in lottie json HOT 3
- t
- addValueCallback() doesn't work unless animData.loop = true HOT 2
- [bug]Can't directly modify colors in animation
- Smooth transition within a value callback HOT 1
- How to use lottie-api with Angular HOT 1
- How to change position of layers? HOT 4
- Get Animation Data after the API has changed something. HOT 1
- Fails to find Keypath
- How to retrieve the value of a property? HOT 3
- Declaration types
- Accessing layers HOT 1
- Animation not following instruction in local svelte build HOT 4
- Dfh
- parent is not defined
- How to use other methods, is there a manual?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lottie-api.