Copy link to clipboard
Copied
Hi !
I got an expression, to align my Social Medial logo to a Solid, but when I do it, After effects say :
and, as I'm a complete beginner, I don't understant how to resolve my problem
Here is my expression :
s=thisComp.layer("Background").sourceRectAtTime();
hauteur=s.height/2;
thisComp.layer("Background").transform.yPosition-hauteur+thisComp.layer("Control").effect("Icon_width")("Slider")
Thanks by advance !
Copy link to clipboard
Copied
Maybe on the Background layer, the dimensions are not separated (right-click on Position and choose Separate Dimensions), so Y Position is not accessible.
Try replacing yPosition with position[1]
s = thisComp.layer("Background").sourceRectAtTime();
hauteur = s.height / 2;
thisComp.layer("Background").transform.position[1] - hauteur + thisComp.layer("Control").effect("Icon_width")(1)
Copy link to clipboard
Copied
Effectivly, after separate x & y on my Background, i don't have an error message anymore when I let my expression (So it's still the one I'll put on my first message)
But, now that's not a problem anymore, I'll see a new one
My logo is not align on the way I want, and the expression is from a video tutorial, so idk what to do
I want my anchor point stay always at the top-left of my Background, but i just don't know where it goes with this :
s=thisComp.layer("Background").sourceRectAtTime();
hauteur=s.height+thisComp.layer("Control").effect("Zoom_Icon")("Slider");
[960+hauteur/2,540-hauteur/2]
Again, thanks for your help ! 🙂
Copy link to clipboard
Copied
I would do something like this:
text anchor point:
[sourceRectAtTime().left, sourceRectAtTime().top + sourceRectAtTime().height / 2];
text position:
margin = thisComp.layer("Control").effect("margin")(1);
logo = thisComp.layer("logo");
logo.transform.position + [logo.sourceRectAtTime().width / 2] + margin
Copy link to clipboard
Copied
Hi again !
Thanks for the answer, and the small video, but I'm probably dumb, I don't understand where to put it.
There's a chance that I was not clear with my problem, idk so I'll try to explain more precisly
I got 3 differents things on my animation : A solid (My Background), A text, and a picture (That's my logo)
and, my background and text are already align by expression, and now I want to align my logo by the left of the background, and, even if I expend my background, that my logo stay stuck at the left (like a responsive design)
Maybe that's better, if not sorry ^^'
Copy link to clipboard
Copied
Sorry for double posting, but when thinking about it, it'll be probably better if you see what I want to do precisly, and maybe my files
So, Here is what I want about my logo ( https://youtu.be/xz24OhuMM_8?si=OlMDffowqTiHr5AB&t=116 ). That's the tutorial I'll use for my animation, so all my expressions are the same (except if I made mistakes) the only differences is the logos. The expressions are not on the tutorial, but on the file which is given on the video description. So I copy/paste it, but it don't works ...
Again, thanks for your help, and sorry for double post
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi !
I managed to make the expressions work, thanks to you @Airweb_AE !
I need an other help, if your ok to ^^'
I'm still wanted to improve my animation, and need to add the platform name under my animation.
If possible, i want to block the platform name at the complete right point of my background, so with an expression. But, i still want to do an animation before, but if I do it, I can't made my expression ?
I first try to put the anchor point of my 2nd text on the middle right of my block, but don't have any ideas if it's ok, and, if yes, what to do after ...
And, because I think I'm not clear, here a fast demonstration of what I want if possible.
Again, big thanks for your help !