Francesco Bona
Forum Replies Created
-
Francesco Bona
September 2, 2018 at 5:19 pm in reply to: How to freeze an expression at a specific timeI’m sorry I waited so long to answer but I wanted to study deeply your suggestions. Finally I understood that I was wrong and you were right! I thought the expression did not work because I was trying to move layer “B” with my mouse and not with keyframes! With keyframes everything works perfectly !!
So.. Thank you all again. Thanks to you I’m making huge steps forward … Regarding my project: I have uploaded a very simplified scene of my current situation.
12685_creativecow01.aep.zip
As you will notice the expression applied to the second object is now a bit different – but congruent to your suggestions – because I wanted to be able to change the anchor points without changing the result.
I also wanted to use a marker as a stop frame.D=30;
Stop = thisLayer.marker.key(1).time;
Duration=Math.min(time,Stop);
A=thisComp.layer("A");
AS=A.transform.scale.valueAtTime(Duration)[1];
AY=A.transform.position.valueAtTime(Duration)[1];
AH=A.sourceRectAtTime(Duration).height/2;AAncorY=thisComp.layer("A").transform.anchorPoint[1];
ThisAncorY=transform.anchorPoint[1];ThisS=transform.scale.valueAtTime(Duration)[1];
ThisH=thisLayer.sourceRectAtTime(Duration).height/2;value-valueAtTime(0)+[value[0] , AY+((AH-AAncorY)*AS/100)+((ThisH+ThisAncorY)*ThisS/100)+D]
Thanks again!
-
Francesco Bona
August 24, 2018 at 11:52 pm in reply to: How to freeze an expression at a specific timeI really thank you but it’s clear that I’m not getting through.
The expression still doesn’t allow me after frame 250 to move the object on the y axis and as I said the scale property still fells the restriction of the bottom margin of the firt object.I definitely need a simpler case to understand each other so forget my “bottom margin link” expression. Really. I think the best possible example which sums up my needs is “unparent a child layer from the parent at a specific time”.
Yes my needs are substantially similar to a “layers parenting” because when a layer is parented to another it follows its movements and changes but – this is the thing – if you unparent the child from the parent, the child keeps is own actual state.
It doesen’t return to its native state and even if it’s free to be moved or changed its new “0 state” or “native state” has become that in which the last parenting instant has left it.This is exacty what I’m tryng to acheave. I have a more complicated situation than this but the gist is the same so I repeat: forget about my previus expression. What I’m asking to you all is this:
How can I write an expression to unparent a child layer from its parent – for example – at frame 250?
Once again, thank you all for your patience.. -
Francesco Bona
August 24, 2018 at 9:11 am in reply to: How to freeze an expression at a specific timeHi guys, could you just tell me if there’s not a solution because of my chaotic explanation or just because this operation must be done without expressions? I’m sorry but I’m really in trouble. I don’t want to bother you, I’m just trying to find – at least – a path to the solution.
Thank you
-
Francesco Bona
August 22, 2018 at 1:29 pm in reply to: How to freeze an expression at a specific timeNow that I’m really late I’ll proceed with a workaround that I’d rather not use: baking the second object position and keeping just the keyframe at frame 250 that is my stop. The result is exacty what I was trying to get directly into the expression but it makes my composition very chaotic. Infact here I’m talking about 2 objects but in reality I’m workin on more than 20 layers.
In any case, I would like very much to find out how to solve with an expression. -
Francesco Bona
August 22, 2018 at 12:15 pm in reply to: How to freeze an expression at a specific timeThanks but I can’t reposition the object manualy. The expression is made specifically to link the second object to the bottom margin of the first object. And the firts object is wiggled or moved by other expressions. So as I said it is impossible to manually reset the position to the right place.
If you want to test or study my specific situation you need just to:
– create 2 shapes
– put a “heavy” wiggle expression to position and scale of the first object
– put this expression to the position of the second object
stop = 250;
t = Math.min(time,framesToTime(stop));
a=thisComp.layer("01"); // Key object
d=30; // Distance
s=a.transform.scale.valueAtTime(t)[1];
apos=a.transform.position.valueAtTime(t)[1];
ah=a.sourceRectAtTime(t).height/2;
s1=transform.scale.valueAtTime(t)[1];
h=thisLayer.sourceRectAtTime(t).height/2;[value[0] , apos+(ah*s/100)+(h*s1/100)+d]
As you can see at frame 250 the second object stops exactly in the position it was at that frame – and this is ok – but now you can’t move the y position anymore cause it’s locked. And if you change the scale it changes as if its upper margin and position where locked.
So… the problem remains the same: to obtain an object that, after frame 250 is unlinked from the expression, still in the exact position that it had under the control of the expression at frame 50, but free to be moved.
I understand this case this case is becoming a mess and it’s my fault.. But seriously, I did not imagine it could be such a complicated thing..
I really don’t know how to solve this problem -
Francesco Bona
August 22, 2018 at 9:34 am in reply to: How to freeze an expression at a specific timeI add only one thing to clarify:
Perhaps my biggest mistake was to talk about “freezing” because this makes think of an object that from a certain moment on remains blocked as it is. I need it stops as it is not to be blocked forever with the properties it has in that moment.It is better to say that I’m looking a way to stop an expression to operate at a specific time, leaving the object as it is at that specific moment and free from its control.
The problem with last expression infact is that the object, from frame 50 on, seems to keep its properties forever linked to the conditionings it had in that frame. So what I get is not an object that I can control freely.
– position is locked as it was at frame 50
– scale anchor point is locked as it was at frame 50
So expression is not “off” as I need from frame 50 to on. Expreesion is frozen at frame 50.
I really need to find a way to make the expression stops to work after frame 50 but at the same time I need the object not simply to return as if it was without its control.I need the object to stops as it was at last frame the expression was active but without being conditioned by it from then on.
-
Francesco Bona
August 22, 2018 at 8:28 am in reply to: How to freeze an expression at a specific timeWAIT WAIT!!!! YOUR EXPRESSION WORKS!!! I WAS WRONG!
What made me think that it did not work is the “scale” of the second object.
It scale as its “anchor point” was still linked to the bottom margin of the first object.I’m understanding.. It’s my fault, I’m explaining very badly.
I need the second object to stop in that moment. But I also need, from that moment on, to be free to modify its property without being conditioned by the expression.The meaning is:
– Before frame 50 the second object remains linked to the bottom edge of the first object
– At frame 50 it stops with the exact dimension and position it has at that moment and if I do nothing it remains as it is and no longer follows the first object.
– After frame 50, If I change its parameters, such as position and scale, I must be free to do so without being bound by the expression that acted before. So from this moment I need it to behave as if it were created with these characteristics and position
Is this clearer? Sorry but as you can see my english depends on google and it’s really difficult for me to explain these things. -
Francesco Bona
August 22, 2018 at 7:32 am in reply to: How to freeze an expression at a specific timeAh ok but how can I have setup something different from you? The code is the same
In general which are the possible codes that block or freeze an expression? -
Francesco Bona
August 22, 2018 at 5:45 am in reply to: How to freeze an expression at a specific timeNo, only the expression
-
Francesco Bona
August 21, 2018 at 11:08 pm in reply to: How to freeze an expression at a specific timeI’m sorry but It doesn’t seem to work …
The expression continues to operate even after frame 50 and keeps the second object anchored to the bottom of the first.
What I need instead is the second object to remains frozen in the position it has at frame 50 even if the first object continues to move.