PDA

View Full Version : how to rotate a mask shape keeping its scale?


FonteBoa
03-06-2006, 09:01 PM
AE 6.5, under WindowsXP.

The problem come up when i created a circular mask to use as path at Render/Audio Spectrum effect. I wanted to animate the mask rotation. I set a keyframe at Mask/Mask Shape and rotated the shape (by Ctrl+T)(free transform mask) to create another keyframe some seconds after the first one. The mask rotated, but its scale varied: it scaled down and then scaled up to the original aspect. :D How can i avoid it?

ps: it is not necessary to apply any effect to see the problem: if you animate the mask shape rotation, the scale will be animated too...

AAAron
03-06-2006, 09:38 PM
Rotate the layer instead?
If you want to use the mask as a mask you could always make two layers; one black solid and the layer with the mask a white solid. Then precompose them and then use the precomp as a track matte.

FonteBoa
03-06-2006, 09:44 PM
Tks, AAAron: it is a good workaround.

But why the mask shape Scale changes if i just rotated it?

suztv
03-06-2006, 09:50 PM
I just tried your problem and I can see why it is frustrating. I looked it up and AfterEffects has this to say:

"Note: When you animate rotation using Free Transform Points, the vertices of the mask are interpolated in a straight line from keyframe to keyframe. Because of this, the results may be different than you expect."

i.e. - the size of the mask may change because of vertex interpolation, when you rotate the mask you are moving vertices and AE has to create the inbetweens with a formula. Apparently it scales it down to do it.

I think that maybe pre-composing the mask/layer and then rotating the comp should do what you need.

Mylenium
03-07-2006, 05:38 AM
Tks, AAAron: it is a good workaround.

But why the mask shape Scale changes if i just rotated it?

You're using the wrong approach. Just like AAARon and suztv say, pre-compose (which in this case is no "workaround", it's the proper thing to do). Mask interpolation is calculated on a per-vertex level, not for the mask in its entirety. You could minimize the problem by using a circle with mor subdivisions then the standard 4 knots the elliptical mask tool creates, but the "pumping" will never go away completely with a Bčzier mask because not only the positions of the points are interpolated but also their tangents.

Mylenium

FonteBoa
03-07-2006, 10:52 AM
Thanks for the explanation, Suztv.
Thanks, Mylenium, but no news at your answer. :shrug:

Mylenium
03-07-2006, 11:48 AM
Thanks, Mylenium, but no news at your answer. :shrug:

No sweat. just wanted to confirm the others and maybe provide a more explicit explanation ;O).

Mylenium

avinashlobo
03-07-2006, 12:19 PM
Heh. It's a pretty quirky scenario all right. Never faced it personally, but it does make a certain amount of sense.

I've attached a crude attempt at a diagram explaining exactly what's happening.

Since the points are animated linearly, your circular mask is not really rotating at all. Instead, the vertices are traveling in a straight line from their original destination to their final destination. This causes the mask to 'shrink' along the way.

Vympel
03-07-2006, 02:47 PM
You're using the wrong approach. Just like AAARon and suztv say, pre-compose (which in this case is no "workaround", it's the proper thing to do). Mask interpolation is calculated on a per-vertex level, not for the mask in its entirety. You could minimize the problem by using a circle with mor subdivisions then the standard 4 knots the elliptical mask tool creates, but the "pumping" will never go away completely with a Bčzier mask because not only the positions of the points are interpolated but also their tangents.

Mylenium

The mask of AE is shape calculated (smart mask interpolation) If it will be for pixel is really sucks you canīt control in vertex level

Mylenium
03-07-2006, 04:51 PM
The mask of AE is shape calculated (smart mask interpolation) If it will be for pixel is really sucks you canīt control in vertex level

Huh? I don't quite get what you mean, but it seems what you wanna say is wrong.

a) Smart Mask Interpolation is a Keyframe Assistant, not a native mask function and it does not change the interpolation as such, it will change the weighting of the keyframes and create additional ones.

b) Masks are calculated as simple geometric transforms of vector shapes (and the vertices they are made of) with full float precision relative to the layer they are attached to (which, as I would like to remind you is calcualted with 32x sub-pixel oversampling). The rasterization only takes place once the position of the shape boundary has been calculated.

c) Not being able to acces vertex data directly does not mean it is not used internally. There's nothing wrong with compound keyframes storing them as arrays, it only becomes a problem when you are trying to attach tracking data or expression to mask points. At the moment that is only possible by using scripts as a workaround or third party plugins.

Mylenium

Vympel
03-07-2006, 08:18 PM
Have a this type of script in the web? ( to acess the vertex)?

Mylenium
03-08-2006, 05:33 AM
Have a this type of script in the web? ( to acess the vertex)?

Yes, there is. http://www.crgreen.com/aescripts Be warned, though, it's a bit quirky to use and due to being a script rather slow.

Mylenium

Vympel
03-08-2006, 02:56 PM
function, but it functions, more isnt practise. Have any motives to the AE donīt offer control in a per vertex level without scripts?

Mylenium
03-08-2006, 05:12 PM
function, but it functions, more isnt practise. Have any motives to the AE donīt offer control in a per vertex level without scripts?

You'd have to ask that the Adobe AE dev team. ;o) Many users have been wanting this for ages, but it requires some major reworking of the masking mechanism. I'm sure it's on top of their list and one of these days we will see it in AE...

Mylenium

AAAron
03-08-2006, 05:40 PM
Didnīt adobe buy a technology licence curious gfx? That is interesting cause gfx have per vertex mask controll and have beziers to controll the motion path of each vertex. Another way is to buy the great silhouette roto plug for Afx from http://www.silhouettefx.com/, it have a really good motion tracker and you can assign maskpoints to tracker data.

Mylenium
03-08-2006, 06:56 PM
Didnīt adobe buy a technology licence curious gfx? That is interesting cause gfx have per vertex mask controll and have beziers to controll the motion path of each vertex.

That could be, but then again it could mean nothing. They could just leave the Curious package as it is and sell it as "After Effects Roto Edition" ;o). They certainly have their reasons for the acquisition, but what those are is anybody's guess.

Mylenium

AAAron
03-08-2006, 10:56 PM
They certainly have their reasons for the acquisition, but what those are is anybody's guess.

yep they really a quiet gigant

CGTalk Moderation
03-08-2006, 10:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.