I am looking for an expression or script that will create.
A Point Control who slides along a mask spline based on a percentage slider.
For example if I had a Slider Control at 0% the position of the Point Control would be at the beginning of the spline. If I had a Slider Control at 100% the position of the Point Control would be at the beginning of the spline. If I keyframed the Slider control from 0% to 100% the Point Control would travel along the length of the spline.
Anyone know how to do this?
Thanks for reading.
Josh
Point Control Position Based on Mask Spline Percentage.
Moderator: byronnash
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Is the mask animated? If not, you can copy the mask path, add a null and select its Position property before pasting, which turns the spline into a position path over 2 seconds. Then apply a Slider Control and Point Control to another layer and use this expression on the Point Control property:
Then when you animate the Slider Control between 0 and 2 the Point Control will animate along the path.
Code: Select all
a = effect("Slider Control")("Slider");
thisComp.layer("Null 1").transform.position.valueAtTime(a);
I am trying to build a larger script that automatically creates a moving arrow and this is totally what I need to continue.
Thanks.
But is there really no way to access the mask shape information beyond copying and pasting the mask into the position channel?
Would there be a solution if the mask were animating?
Thanks again for looking.
-Josh
Thanks.
But is there really no way to access the mask shape information beyond copying and pasting the mask into the position channel?
Would there be a solution if the mask were animating?
Thanks again for looking.
-Josh
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Scripts can access the vertices and tangent information for mask shapes, but expressions can't.
But even with a script, I imagine you'd have to somehow use that information to calculate the path to Point Control keyframe conversion, which doesn't sound like fun.
I can't think of another solution, besides not trying to link to a mask shape in the first place.
Paul
But even with a script, I imagine you'd have to somehow use that information to calculate the path to Point Control keyframe conversion, which doesn't sound like fun.
I can't think of another solution, besides not trying to link to a mask shape in the first place.
Paul