Copy link to clipboard
Copied
Hello. im trying to lock a layers property from moving on Y axis. I want it to move only on X and not on Y. Not even by accident and not even if it is lincked to another layer. I cant find any informatin anyware. Can someone help?
Thank you.
For simple position animation with no parent layer all you have to do is enter the desired value of the Y position in a simple array. If you wanted the Y value to always be 300 the expression would look like this:
[value[0], 300];
If the layer is the child of another layer (Parented), then you subtract the toComp(anchorPoint) of the anchor point from your desired Y position like this:
tPos = parent.toComp(anchorPoint);
[value[0], 300 - tPos[1]]
That will make the X position follow the Null and
...Copy link to clipboard
Copied
For simple position animation with no parent layer all you have to do is enter the desired value of the Y position in a simple array. If you wanted the Y value to always be 300 the expression would look like this:
[value[0], 300];
If the layer is the child of another layer (Parented), then you subtract the toComp(anchorPoint) of the anchor point from your desired Y position like this:
tPos = parent.toComp(anchorPoint);
[value[0], 300 - tPos[1]]
That will make the X position follow the Null and hold the Y position at 300.
You can throw in an if/else statement that looks for a parent layer like this:
if(thisLayer.hasParent){
tPos = parent.toComp(anchorPoint);
[value[0], 300 - tPos[1]];
}
else{
[value[0], 300]
}
That way you only have to write one expression. You could also tie the Y position to an expression control slider.
If those two solutions don't solve your problem then we need a screenshot showing exactly what you need and a detailed workflow and design description.
Copy link to clipboard
Copied
Hi and thank you for your respoce.
I tried the first example and it gives me this message. What am i doing wrong?
Copy link to clipboard
Copied
Do not separate values. It is almost always a bad idea to do so.
Copy link to clipboard
Copied
Thank you. If not separated, it worked!