Page 1 of 1

reading the lenght of a mask !

Posted: April 21st, 2006, 1:47 am
by sebastien
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

Posted: April 21st, 2006, 10:07 pm
by nab
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

-

Posted: April 24th, 2006, 3:24 am
by sebastien
Thanks !
I'll post feedback as soon as possible.

What about my way ? :idea: have you downloaded my project ?

Posted: May 1st, 2006, 12:56 pm
by nab
(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"