Hi
http://www.vertigo.co.uk/cow/expressionHelp.jpg
As you can see from the image I have a letter 'O' being animated to keyframes from an audio layer via a couple of effects; Warp and Transform. My aim is; at a certain point I want the influence from the effects to fade down so that the letter appears in its normal state, whereupon the rest of the word will animate in.
To this end I have created some expression control sliders linked to some variables so that I can simply animate the sliders to zero when I want to remove the effect. However, it does not work with Transform. The neutral state of Transform/scale height is 100. I can't work out the code to return 100 when I want to fade out this effect. I know I probably don't have the most elegant solution, but any help would be appreciated, and if you can suggest better code that would be even better!
Antony
turning 'off' an expression
Antony,
Try adding to your scale expression something like:
This will make sure that when SldTransf reaches 0, you will get your scale (100% or any other value you have given you layer scale).
p.s.: If the maximum value of your SldTransf is some "MAX" value, and not 1, use something like:
Koby.
Try adding to your scale expression something like:
Code: Select all
... + (1 - SldTransf)*scale
p.s.: If the maximum value of your SldTransf is some "MAX" value, and not 1, use something like:
Code: Select all
... + (1 - SldTransf/MAX)*scale
By the way, another way to do it is to use the "linear" function in order to interpolate between your "expression" value and the "non expression" value: scale
in something like:
Koby.
p.s.: The above expression assumes that your slider takes values between 0..1
in something like:
Code: Select all
exp = (put your audio expression here, WITHOUT the slider);
nonexp = scale;
linear(SldTransf, 0, 1, nonexp, exp)
p.s.: The above expression assumes that your slider takes values between 0..1
-
- Posts: 4
- Joined: September 22nd, 2009, 10:39 am
Thanks for replying Koby
My expression now looks like this but returns an error:
Audio = linear(thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider"), 0, 30, 1, 4)
SldTransf = thisComp.layer("control").effect("SldTransf")("Slider")
thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider")*(Audio*SldTransf) + (1 - SldTransf)*scale
I know I am being stupid somehow...
A
PS. I am not familiar with MAX, where do I find reference for that?
My expression now looks like this but returns an error:
Audio = linear(thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider"), 0, 30, 1, 4)
SldTransf = thisComp.layer("control").effect("SldTransf")("Slider")
thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider")*(Audio*SldTransf) + (1 - SldTransf)*scale
I know I am being stupid somehow...
A
PS. I am not familiar with MAX, where do I find reference for that?
-
- Posts: 4
- Joined: September 22nd, 2009, 10:39 am
This is the error:
[attachment=0]expressionError.jpg[/attachment]
[attachment=0]expressionError.jpg[/attachment]
- Attachments
-
- expressionError.jpg (216.31 KiB) Viewed 18219 times
Ah, that's simple:
change the last line to:
or this (using the linear function):
Koby
change the last line to:
Code: Select all
thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider")*(Audio*SldTransf) + (1 - SldTransf)*scale[1]
Code: Select all
tmp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider")*(Audio);
linear(SldTransf, 0, 1, scale[1], tmp)
-
- Posts: 4
- Joined: September 22nd, 2009, 10:39 am
Thanks Koby, I will give it a try. So the principle is: if you want to turn 'off' an expression you set it up so you can do the 'opposite'?
Yes, something like that...
You actually prepare 2 expressions: one as your desired expression, and the second as the "opposite"/"base"/"unexpressioned" value, and then you use the linear function to change between them according to a slider.
Koby.
You actually prepare 2 expressions: one as your desired expression, and the second as the "opposite"/"base"/"unexpressioned" value, and then you use the linear function to change between them according to a slider.
Koby.