Giter Site home page Giter Site logo

Comments (26)

bodymovin avatar bodymovin commented on July 17, 2024

Hi, can you share the json file?

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

Thanks for your reply!

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

Also, do you know if there is a way to use svg files instead of .json data with lottie?

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

@bodymovin can you please advise? I can pay you for your time

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

weird, ok let me see if I can make something public for you to try

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

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.

bodymovin avatar bodymovin commented on July 17, 2024

Yes, I'm seeing the yellow box resize together with the text dimensions.

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

Interesting, what implementation are you using to play the animation?

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

nothing out of the ordinary

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

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.

bodymovin avatar bodymovin commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

Maybe It could have something to do with how webpack is loading the json?

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

I am using react server side so that could be

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

I need to work on removing that dependency to measure text layers, but unfortunately it's not ready yet.

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

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.

taylorjames avatar taylorjames commented on July 17, 2024

Thanks for your help @bodymovin

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

nice! glad it works

from lottie-api.

taylorjames avatar taylorjames commented on July 17, 2024

@bodymovin would it be possible to create an after effects file from the exported json file?

from lottie-api.

bodymovin avatar bodymovin commented on July 17, 2024

It should be possible to a certain extent, but I haven't worked on it yet.

from lottie-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.