- April 22, 2009 at 4:07 pm
there probably is a way to have an expression do it, but you should be able to select your mask path (hit ‘mm’ on the keyboard, select the ‘mask path’ property), copy it, then select you position property and paste the path into the position.
you should get as many keyframes as you have points on the mask, with the first and last keyframes being locke to time and any in between being roving. so as you drag the first or last keyframes the roving keyframes will distribute accordingly…
does that help you out…?
KCPQ, KMYQ & KRCW
- April 22, 2009 at 11:12 pm
I don’t think you can pull the mask point values straight out of a mask path. I’ve never heard of it anyway.
What you can do though is copy the mask path, paste it into the position attribute of a null layer (or any layer with visibility turned off). It doesn’t matter where the keyframes fall in time.
Then add an expression slider to the layer you want to move along the path. I called my slider “percentage”, then paste the following code into the position attribute of the same layer.
tPath = thisComp.layer("null").transform.position; //change this to the null layer you just created!
tLastFrame = tPath.key(tPath.numKeys).time;//get the time of the last keyframe
tFirstFrame = tPath.key(1).time; //get the time of the first keyframe
tPercentage = effect("percentage")("Slider")/100; //read in the value from the percentage slider
//the next line converts that percentage into a point in time between the first and last keyframe.
tPercentageAsATime = (tPercentage*(tLastFrame-tFirstFrame)) + tFirstFrame;
myPos = tPath.valueAtTime(tPercentageAsATime); //read the position at that point in time and put it into this layer's current position. Hey presto!
Now you can have multiple layers all referencing the same path, but moving along it at different times, courtesy of their percentage slider.
Hope that helps.
- June 23, 2009 at 8:26 pm
I used the copy mask shape properties and past into the position property technique, but it made the path much larger upon pasting than the path I actually drew. Is there a way to make it either not do that from the start, or to shrink the position keyframes down to a smaller version of the path?
The path is a spiral and I want the spiral to be tighter. Right now the spiral goes way off the composition screen.
- May 4, 2020 at 10:07 am
Love ya man!
Log in to reply.