Point Control Position Based on Mask Spline Percentage.

What type of scripts do you need?

Moderator: byronnash

Post Reply
lilsmokie
Posts: 10
Joined: May 7th, 2008, 9:24 am

June 23rd, 2011, 2:47 pm

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
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

June 24th, 2011, 3:17 am

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:

Code: Select all

a = effect("Slider Control")("Slider");
thisComp.layer("Null 1").transform.position.valueAtTime(a);
Then when you animate the Slider Control between 0 and 2 the Point Control will animate along the path.
lilsmokie
Posts: 10
Joined: May 7th, 2008, 9:24 am

June 24th, 2011, 6:28 am

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
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

June 24th, 2011, 6:47 am

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
Post Reply