Controlling animation presets programmatically Is there a way to control whether or not an animation preset it applied to an item programmatically through After Effects?


Let's say, for example, I have some sample text, that just says "hello world".
I then go and drag &amp; drop a "slide &amp; swoop" onto the hello world text.
I then add another transition, say a 'slide straight' from the effects &amp; presets
I then want to add a 'slider' control to the essential graphics panel, so if slider is set 0, none of the effects are applied. If it is to 1, it applies animation effect #1, and if it is set to to 2, it shows animation #2?
Yes, that's perfectly possible, though it might be more work than just doing the animation yourself. 

You'll have to find all of the changes that the presets apply to the layer and adapt them with expressions that respond to the value of the slider. To find all of the changed properties of a layer use uu (double tap the u key). You'll have to apply preset 1, find all of the changes it makes, and write an expression that mimics them, then revert the layer and apply preset 2 and do the same thing. Then in your expression for each changed property you'd have:

var ctrl = effect("Slider Control")("Slider");
if (ctrl === 0){
    value; //use the current value of the property
} else if( ctrl === 1){
    // the expression that mimics preset 1
} else {
    // the expression that mimics preset2
}