reading the lenght of a mask !

What type of scripts do you need?

Moderator: byronnash

Post Reply
sebastien
Posts: 5
Joined: February 7th, 2006, 2:42 am

hye everyone,

I need to calculate the lenght (in pixel) of a complex mask and i think this can be very useful in a lot of other stuffs.
here is my original post on the cow:
http://forums.creativecow.net/cgi-bin/n ... tid=876431

I have only find this way:

(...My idea was to use the ability of AE to exchange data between mask and spatial position. Let me explain: with a spatial position, we can find a speed so a number of pixel by seconde... if we know the duration, we are able to know the lenght of the path, and the lenght of the mask !!!!!...)

The purpose of this post is now to find a way (probably a script) to automatically convert the mask to the spatial position... to avoid a borring copy/paste everytime !

Let's have a look on http://www.apt-a.com/cow/dotted_lines_AE7.aep
nab
Posts: 203
Joined: November 29th, 2005, 3:00 am
Location: Royan
Contact:

Hi sebastien,

it's not generally easy to determine the length of a bezier mask (formed by multiple bezier curves), but you can achieve it by decomposing all curves in infinitesimal segments. Then you simply have to compute the sum of the length of each segment to obtain the approximated total length of the mask.

I wrote a script that displays the length of the selected mask (in pixels)...not much tested but seems to work well.
Select your mask and run the script below.

Feedback is welcome :wink:
http://www.nabscripts.com/Forum/Scripts ... Length.jsx

-
sebastien
Posts: 5
Joined: February 7th, 2006, 2:42 am

Thanks !
I'll post feedback as soon as possible.

What about my way ? :idea: have you downloaded my project ?
nab
Posts: 203
Joined: November 29th, 2005, 3:00 am
Location: Royan
Contact:

(sorry i wasn't at home...)
nope, i didn't download your project since i don't have v7.0
but the math behind your idea is similar to that used in the script : when you talk about "speed" the script deals with "derivatives"
Post Reply