4792 posts
  • Elite Author
  • Community Moderator
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips Volunteer moderator says


Not quite sure what you mean. You say a box is limited between 0 and 100 pixels. What is limited? It’s size? It’s x position? The intensity of its red channel?

I’ll assume you’re talking about the position. Once you have an expression on a property, the value displayed in the switches panel of the timeline will display red instead of yellow and the value displayed will be the post-expression value. If you click to edit the number, you will be editing the pre-expression value.

If you disable the expression, the value will turn yellow again and display the pre-expression value.

Remember, when you edit a value, you’re editing the original value. You’ll notice that it turns yellow if you scrub the value, then turns back to red when you release. So if you have an xPosition clamped to between 0 and 100, sure you can scrub the number to -400 (it’ll turn yellow while you do this) because you’re scrubbing the pre-expression value which can’t be clamped, but the moment you release, the expression will come into effect, the number will turn red and will display 0 (-400 clamped to a minimum of 0).
Thank you ! & Yeah you are right I’m talking about the xPosition value.
The thing is, let’s say the object is at x-position 0 pre-expression. Then, I limit the xPosition from 0 to 100.
If I drag the object to the left and go below 0 to -400 for example, the post-expression value will jump back to 0, However when I’ll drag the object to the right, it won’t move immediately since I’m not really at 0, I’m at -400..so the pre-expression value will go from -400 to 0, and just then the object will move. kinda like a delay…sorry for my bad explanation I hope I explained it a little better this time.
Thanks Felt !

Got it this time….!

Yeah, there’s no way round that. It’s just how it is, I’m afraid. :-)

404 posts
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Referred between 100 and 199 users
  • Bought between 1 and 9 items
  • United States
GhosTeam says

Oh expressions betray us sometimes :) but thanks again!
I really liked david’s idea of graphic controls driven by expressions so I adopted it.. it has its limitations..but soo cool !
Btw you can see his control panel inside the video preview in VH- it’s in the featured items

502 posts
  • Europe
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Exclusive Author
5p1r17 says

Is there any way to find&replace a piece of expression in current active comp?

I’ve got a huge amount of layers and comps with different expressions and i need to change only 1 string in all expressions…

pt_ExpressEdit isn’t helped me. This script replacing whole expressions, but i’m looking more like a notepad find&replace tool :)

4792 posts
  • Elite Author
  • Community Moderator
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips Volunteer moderator says

Is there any way to find&replace a piece of expression in current active comp?

I’ve got a huge amount of layers and comps with different expressions and i need to change only 1 string in all expressions…

pt_ExpressEdit isn’t helped me. This script replacing whole expressions, but i’m looking more like a notepad find&replace tool :)

It’s a scripting issue that one. I have a script that I use for this, and have been intending to publish for a while, but unfortunately it’s rather a chore to get a simple script into a state where it’s tested, polished and publishable.

That said, all you have to do is cycle through the layers of the comp. For each layer, cycle recursively through all properties until you find one that is propertyType PROPERTY, not PROPERTY_GROUP. Check you can set the expression. If you can, check the expression is not an empty string.

Then you can use regex to do a find and replace on whatever you’re searching for and put that back into the expression.

You should also suppress errors and write the expression in and test if there’s an error. If there is, set it back to how it was.

6 posts
  • Exclusive Author
  • Has been a member for 1-2 years
rinspeed says

Hi. Here is the problem: I need one property to react to the changes of the other property. Specifically:

If property X decreases by an increment of 0.1, property Y should increase by an increment of 2.5. Similarly if X increases by 0.1, Y should decrease by 2.5.

I could probably find an easier solution, but really interested to know how it’s done. Have been trying to google this but with no luck :) Hope it’s not very hard to do.

Thanks.

4792 posts
  • Elite Author
  • Community Moderator
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips Volunteer moderator says

Hope it’s not very hard to do.

Hard it isn’t. On property Y:

propX = thisComp.layer("some layer").effect("some effect")(1).value;
-25*propX;
6 posts
  • Exclusive Author
  • Has been a member for 1-2 years
rinspeed says


Hope it’s not very hard to do.

Hard it isn’t. On property Y:

propX = thisComp.layer("some layer").effect("some effect")(1).value;
-25*propX;

Thank you :)

404 posts
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Referred between 100 and 199 users
  • Bought between 1 and 9 items
  • United States
GhosTeam says

Dear Felt,
I have a questions about expressions & keyframes. :)

Is there a way to tell (with expressions) a null object with keyframes , to ignore keyframes after a curtain point in time ?

Ofcourse you can delete the keyframes but I’m thinking about a way to make a duplication process easier so you can go back & forth.

For example, I define a null object with position keyframes that moves from 1 holder to another, 20 times. I want to build a system that lets the buyer enter a “title number” , so if he wants only 10 titles, after the 10th title the null should not move to the next title, therefore – ignoring the keyframes. Then, if he changes his mind to 15, he doesn’t need to restore the keyframes.

*I had an idea for this :

connect the how-many-titles variable to a point-in-time list:
if howmanytitles=1, then point in time = 50 frames ..and so on
Then make a condition if time >= pointInTime, then – the locked position values , else – transform.position[]

BUT—- I’m not sure I’m know what i’m talking about :)
so
Thanks Felt :) !

4792 posts
  • Elite Author
  • Community Moderator
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips Volunteer moderator says

Freezing Animation At A Layer Marker

@Ghost…
Something along these lines on the null’s position property should do the trick…

timeToFreezeAt = thisComp.layer("controller").effect("freeze time")("Slider").value;
if(time < timeToFreezeAt) value; else valueAtTime(timeToFreezeAt);

That’s the basic version. You might put markers on the null layer and it then freezes at the marker before or after the time you set on controller. Or you could use the slider on controller to designate at which marker number it should freeze. It’s all possible. You need to think how you want it to work.

I don’t have Ae in front of me, so I’m not entirely sure of the marker syntax, I think it’s like this…

markerToFreezeAt = thisComp.layer("controller").effect("freeze at marker")("Slider").value;
//make sure it's an integer greater than zero
markerToFreezeAt = Math.max(0,parseInt(markerToFreezeAt)); 
// clamp to the highest marker index
markerToFreezeAt = Math.min(markerToFreezeAt, thisLayer.marker.numKeys); 
timeToFreezeAt = thisLayer.marker.key(markerToFreezeAt).time;
if(time < timeToFreezeAt) value; else valueAtTime(timeToFreezeAt);
404 posts
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Referred between 100 and 199 users
  • Bought between 1 and 9 items
  • United States
GhosTeam says

@Ghost…
Something along these lines on the null’s position property should do the trick…
timeToFreezeAt = thisComp.layer("controller").effect("freeze time")("Slider").value;
if(time < timeToFreezeAt) value; else valueAtTime(timeToFreezeAt);

Thank you !! :) I’ll check it right away

by
by
by
by
by
by