Controlling Rotational speed from a control layer?

Moderators: Disciple, zlovatt

Post Reply
jayse
Posts: 12
Joined: November 22nd, 2004, 5:45 pm
Location: vegas
Contact:

Hey guys! I'm setting up a large comp where about 40 different 3d layers rotate on the x axis from -90 degrees to 0.

Currently it's keyframed over 6 frames - and the 'intertia bounce' expression is added to each.


I thought I was smart by tying the inertia bounce 'amp, freg and decay' to a control layer so that I can change all of them from one place.

BUT ONE MORE thing I'd like to add to the control layer:

The time it takes to rotate from -90 to 0?

Let's say i'm finished and I need the rotations all to happen in 4 frames rather than 6. That's a lot of keyframe moving especially since they're all offset!

Any suggestions!??

Thanks so much!

// jayse
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

jayse,
One way to do it is to put your composition in a new comp and use Time Remapping or speed change (Stretch) to change the duration of the animation. (for example, if you want the animation to take 4 frames instead of 6 frames you could change the Stretch to 66.6667%).
jayse
Posts: 12
Joined: November 22nd, 2004, 5:45 pm
Location: vegas
Contact:

hey kobyg - thanks for the response!

I didn't even think of that since i'm using expressions for the rest...

It could work... controlling the time stretch via a control layer...

I'd need this since I'd be changing a set of 'big-objects' and a set of 'small-objects' - each with a different speed.

Still curious whether it could be done directly tied to rotation.

But thank you! I will try this out!

// jayse
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

I didn't understand completely what you're trying to do,
but if the problem is that the rotation is done with keyframes which makes a constant rotation time,
and you want to be able to change the rotation time later, you could use an expression to do the rotation instead of the keyframes,
this way the rotation time could be controlled by a slider.

You could use something like:
linear(time, inPoint, inPoint+T, -90,0);

Where T is the rotation time, which could be linked to a slider.
In this expression above the rotation will start at the inPoint time of the layer (with -90 deg), and will end after T seconds (at 0 deg).

Koby.
jayse
Posts: 12
Joined: November 22nd, 2004, 5:45 pm
Location: vegas
Contact:

oh wow - I think that's it - I will try this. Thanks so much!
jayse
Posts: 12
Joined: November 22nd, 2004, 5:45 pm
Location: vegas
Contact:

it works perfect!!!

by itself...

Any idea why it doesn't work with the inertia bounce expression after it?

like so:

Code: Select all

linear(time, inPoint, inPoint+.5, -90,0);

// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time;
}

if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .07;
freq = 2.0;
decay = 2.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
I'm assuming the bounce is looking for keyframes - and there are none?
Or is there a work around?

If not, no worries - I will try the other method too - Really appreciate the help!
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

Yes, the inertial expression looks for keyframes.
But if you are only looking for a bounce at the end of the motion, and don't want more bounces at in-between points,
you could try that expression:

damp = 1.2;
decay = 2.0;
vf = 90;
t = time - inPoint;
vf*(1 - Math.cos(2*Math.PI*damp*t)/Math.exp(decay*t)) - vf

Play with the damp & decay parameters in order to achieve the desired bounce and rotation time.

Koby.
jayse
Posts: 12
Joined: November 22nd, 2004, 5:45 pm
Location: vegas
Contact:

what can I say? koby you RAWK! absolutely - this is perfect!
Post Reply