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

sourceRectAtTime to adjust rectangles #2779

Open
frosttho opened this issue May 8, 2022 · 0 comments · May be fixed by #3134
Open

sourceRectAtTime to adjust rectangles #2779

frosttho opened this issue May 8, 2022 · 0 comments · May be fixed by #3134

Comments

@frosttho
Copy link

frosttho commented May 8, 2022

Hi,
first of all thanks a lot for this project. I'm sure I didn't use its full potential yet, but what I saw is great already.

I'm trying to build a graphic that contains text that is programmatically changed in a web project. Updating the text works perfectly. This text is supposed to be placed on top of a rectangle which should be as wide as the text. I tried sourceRectAtTime to achieve this, which worked great in AE but I couldn't get a working version through Bodymovin.
I looked into issue #300 and was happy to see that it is supposed to be working with text layers in svg as this is exactly my usecase but I couldn't find a mistake, yet.

I applied the following expression to the rectangle's size property (not the shape layer but the object inside it), referencing the text layer called "name":
obj = thisComp.layer("name");
x = obj.sourceRectAtTime().width + 25;
[x,value[1]]

My embed code in the html file looks like this:
json = {....}
animation = bodymovin.loadAnimation({
container: document.getElementById('anim'),
animationData: json,
renderer: 'svg',
loop: true,
autoplay: false,
name: "intro",
});
animation.play();

I uploaded the aep (Komp 3) and html files here for reference, if needed: https://www.dropbox.com/sh/4uok4dtrds7zioe/AAAPqxVLloDS4XKwc_wI-jsya?dl=0

I'd be happy to receive any hint that could lead to the resolution of this.
Thanks a lot!

@frosttho frosttho changed the title sourceReactAtTime to adjust rectangles sourceRectAtTime to adjust rectangles May 8, 2022
@Dan-Shields Dan-Shields linked a pull request Nov 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant