Render.ru

как заставить слои двигаться по кругу ?

#2
На каком-нибудь промежуточном слое рисуешь маску-траекторию движения. Делаешь ему кейфрейм в shape. Выделяешь кейфрейм. Затем Ctrl-C. Выделяешь "позишн" в движимом слое. Ctrl-V. И типа усё. Афтер автоматически расставляет на протяжении слоя кейфреймы позишна. И...
"пони бегает по кругу". Не сильно удобный способ. Но для траекторий типа правильного круга не заменим! Удачи!
 

mazzza

Знаток
Рейтинг
22
#3
Можно использовать Expression для position движущегося слоя.

center=this_comp.layer("Center").position;
radius=80;
angle=time*2;
x=radius*Math.cos(angle);
y=radius*Math.sin(angle);
add(center, [x, y]);

("Center" - вспомогательный слой с центром в центре вращения. Радиус и период соответственно меняешь как нужно.).

Или можно использовать motion math:

// Eliptical motion

// This script applies a circular or elliptical motion to a
// target layer. It uses a secondary 'construction' layer
// to determine both the bounds and center of the
// circular/elliptical motion. The construction layer's
// position and scale can animate over time, creating
// some fairly elaborate motion paths.

// LAYER PROPERTY CHANNEL
// ------ ---------- --------
// 1: Target layer doesn't matter doesn't matter
// 2: Construction layer doesn't matter doesn't matter

target = pop_layer(1);
construct_layer = pop_layer(2);

// # of seconds per full revolution
period = 2;

// The secondary layer's scale * its dimensions = the ellipse's radii.
// Note: motion will be counter-clockwise if both x&y scales are positive or negative;
// motion will be clockwise if one scale is positive and the other negative.

xradius = (layer_size(construct_layer)[X] /2) * (value(construct_layer, scale)[x]/100);
yradius = (layer_size(construct_layer)[Y] /2) * (value(construct_layer, scale)[y]/100);

// Calculate basic elliptical motion
xposition = sin(deg_to_rad(360 * time()/period)) * xradius;
yposition = cos(deg_to_rad(360 * time()/period)) * yradius;

// find construction layer's center
xcenter = value(construct_layer, position) [X];
ycenter = value(construct_layer, position) [Y];

// Assign the elliptical motion to the target layer
value(target, position) [X] = xposition + xcenter;
value(target, position) [Y] = yposition + ycenter;

Сохрани с расширением mm и пользуйся.
 
Симпатии: G_O

derby

Пользователь сайта
Рейтинг
2
#4
Ставишь Anchor нужного слоя в требуемый центр вращения (кнопочка Y), потом просто крутишь его на нужный угол (кнопочка R). Вуаля.

Сергей.
 
#8
Желательно чтобы объект не крутился , а перемещался по кругу или овалу..
 
Сверху