Activity › Forums › Adobe After Effects Expressions › Radar Detection
-
Dan Ebberts
April 1, 2007 at 8:26 pmHey – I’ts always great fun to use dot() and cross() in the same expression. Maybe I need to get out more. 8^)
Dan
-
Julio Crespo
April 1, 2007 at 10:25 pmGood Work!!. I this case I dont need to animate the dot, but I could save this expresion for later use. THANKS
-
Julio Crespo
April 1, 2007 at 11:01 pmIs unbeleaveable the great resource the COW’s forums are. Many people beleave that sharing they knowledge, Is feed its competitors. But for me, sharing the knowledge is feed the industry, because more people with good technics and polished talent, is better than have many middling artist and only few good ones.
THANKS GUYS
-
Kathlyn Lindeboom
April 2, 2007 at 11:36 pm[Filip Vandueren] “The fora should IMO not only be about solving problems, but also about discussing strategies and Modus Operandi…
Of course, most people will only come to the forum when they have a problem…Perhaps we should think of a ‘tag’ in the Subject when it’s brainstorming time ?”
That’s a great idea Filip. It has always been my hope that people would use the forums to share ideas – like the mini-tutorials that you used to put in the main AE forum.
Have you added your blog url to your sig file?
Kathlyn Lindeboom
The Mistress of Mmmooooo! -
Julian Sixx
April 8, 2007 at 12:06 pmHi
great expressions guys!!
I also would like to add a sound effect to this animation.
Everything is build up and i’ve also got an appropriate audio file.A Target layer’s opacity is driven by Filip’s great expression.
What i want to achieve now is,whenever the target’s opacity is 90% i want the audio layer to be enabled.I applied this expression to the Audio layer’s Audio level:
driver=thisComp.layer(“Target”).opacity;
if(driver=90){
thisLayer.enabled
}else{
0
}However,it gives me a 2 dimensional error message,why? As both options only have one dimension.
-
Filip Vandueren
April 8, 2007 at 3:48 pmhello Julian,
first off: After Effects treats all audio as stereo audio, and uses two values in a 2-dimensional array for L and R volumes.
But, It doesn’t show you those two values in the interface if they are the same.So as a default, a layer’s volume is 0 dB (left and right) and that shows up in the timeline as +0.00 dB
the actual value (and the one that should be set with motionscript) is this: [0,0]now on to your expression…
I see what you’re trying to do;driver=thisComp.layer(“Target”).opacity;
if(driver=90){
thisLayer.enabled
}else{
0
}Alas, there are quite a few errors, besides not producing two dimensional values the volume expects:
if(driver=90) // = means, “assign this value”
you’re saying: give driver the value of 90 , then, “if” asks: is this true ? Yes it is, After Effects says: I’ve been succesful in setting driver to 90
So this will always be true, and you’re not checking the opacityfor checking a variables value always use this:
if (driver==90) // == means: “is it equal to ?”
thisLayer.enabled
with this you’re not enabling the layer: you’re asking for the value of it’s “enabled status” (this a read-only property in motionscript), it will return 1 for “yes”
so even if you change this to
[thisLayer.enabled,thisLayer.enabled]
(two dimensions for left and right), you will set the sound-volume to +1dBelse{
[0,0] // 2dim
}Setting the volume to 0dB does not shut it off, 0 dB is the original volume, -infinity dB is silence (not possible in AE)
Apart from this, even if we change the expression to this:driver=thisComp.layer(“Target”).opacity;
if(driver==90){
[0,0]
}else{
[-192,-192] // the most quiet volume possible in AE
}the sound will only be heard for the exact moment the opacity is 90, which will probably be even less than a frameduration.
So how would we tackle this ?
I would use timeremapping to continously play a ping-sound, and rewind back to zero everytime the neelde hits the blip, so:
import a Ping sound, place it on your timeline and enable timeremapping, drag the end of the layer so it’s as long as your comp.
then give timeremapping this expression:
blip=thisComp.layer("Blip");fd=thisComp.frameDuration;
nextBlipTime=10000;
for (t=0; t<=time; t+=fd) { // does a blip occur at time t ? if (blip.opacity.valueAtTime(t)-blip.opacity.valueAtTime(t-fd) > 50) {
nextBlipTime=t;
}
}time-nextBlipTime
The mechanism is based on Dan’s (old) tutorial on using layermakers to retrigger animations. The one with the drummer.
-
Julian Sixx
April 8, 2007 at 4:54 pmHi Filip
thank you very much for your detailed explanation.I really appreciate it!!
I’ll give it a try 🙂
Reply to this Discussion! Login or Sign Up