Kevin Camp
Forum Replies Created
-
i would start by pulling the pref file to the desktop (or anywhere, but i don’t think i’d throw it out yet).
what opertating system are you using? and have you installed any updates or other software/hardware recently?
there are several older codecs that cause ae to crash. older plugins may also give you problems.
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
try searching the ae forums, particularly the expressions forum… i think i remember somebody asking about this about a month ago.
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
ok, i think this will work for the light direction:
pos = thisLayer.transform.position;
d = sub(pos.key(2).value, pos.key(1).value);
value – radiansToDegrees(Math.atan2(d[1], d[0]))this would have been easier if i had paid more attention in trig… and if i had a book on java and ae expressions.
dan, when are you writing a book?
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
here’s a better version, still seems a bit wordy, but now keyframe interpolation is accounted for. i also fixed an initial ‘slip’ in the rotation, so now rotation begins at 0. and i added the ‘value +’ to allow setting of an initial start angle for the ball (ie. 30 degrees + the roll simulation).
pos = thisLayer.transform.position;
if (pos.numKeys < 2){ value; }else{ t = pos.key(2).time - pos.key(1).time; startPos = pos.key(1).value; endPos = pos.key(2).value; d1 = length(startPos, endPos) / t; d2 = length(startPos, pos.valueAtTime(time)) / (time - pos.key(1).time); if (time - pos.key(1).time > 0){
if (time – pos.key(2).time >= 0){
value + (360 * d1 * t / (2 * Math.PI * effect(“CC Sphere”)(“Radius”)));
}else{
value + (360 * d2 * (time – pos.key(1).time) / (2 * Math.PI * effect(“CC Sphere”)(“Radius”)));
}
}else{
value;
}
}anybody know how to get a position vector to degrees??? then we could link the light direction to the layer position. if i have a little time tomorrow, i’ll look into it…
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
thanks… my fingers know the right keys, my brain just doesn’t know the names of those keys. i’m the same way with phone numbers, i often have to pretend to dial a number to recite the number…
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
ok,
you don’t need a null (you didn’t earlier, that was my oversight).enable the auto orient function for the sphere layer. paste this into the y rotation property of cc sphere:
pos = thisLayer.transform.position;
if (pos.numKeys < 2){ value; }else{ t = pos.key(2).time - pos.key(1).time; rate = length(pos.key(1).value, pos.key(2).value) / t; if (time - pos.key(1).time > 0){
if (time – pos.key(2).time >= 0){
360 * rate * t / (2 * Math.PI * effect(“CC Sphere”)(“Radius”));
}else{
360 * rate * (time – t) / (2 * Math.PI * effect(“CC Sphere”)(“Radius”));
}
}else{
value;
}
}the expression looks at the length or distance that the layer moves rather than just the x or y component, this helped to keep the ‘roll’ consistent regardless of angle. it also compares the current time to the time between the position key frames to allow the ‘roll’ to start and stop with the position.
this is a work around.. it doesn’t actually produce a realistic mult-dimensional roll, it just allows the direction and speed of the ‘roll’ to seem natural. and currently it won’t work coorectly with non-linear position keyframes.
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
sorry, i didn’t fully test this… there does seem to be a problem using only the x pos as the variable for rotation when the diagonals are extreme, also the rotation reverses if the x pos value is descending.
i have an idea to fix this, i’ll get back to you soon.
can you work with only two postion key frames?
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
there are a couple ways, you can right click the keyframe (or multiple keyframes) and choose keyframe interpolation and set the options to linear. you can also find keyframe interpolation in the animation menu in the menu bar.
the easy way is to just command-click on mac (alt-click maybe on pc) the key frame once to change the interploation back to linear.
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
cc page turn would be the first effect that comes to mind…
search the cow for page turn and you should find a few tutorials that use the effect.
Kevin Camp
Designer – KCPQ, KMYQ & KRCW -
elsewhere
Kevin Camp
Designer – KCPQ, KMYQ & KRCW