Answers.Body: <p>Yes, that's perfectly possible, though it might be more work than just doing the animation yourself. </p>
  
  <p>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 <kbd>u</kbd><kbd>u</kbd> (double tap the <kbd>u</kbd> 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:</p>
  
  <pre class="lang-js prettyprint-override"><code>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
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-16T14:50:22.200Z
Answers.Text: hmm, I 'think' I understand what you are saying (I do programming, but new to 'adobe' programming)... you mean - there isn't just an easy way to say to use the, let's say "stretch wipe" preset, and just say
  
  if (ctrl == 1) {jump to preset 1}
  if (ctrl == 2) ... etc
  
  but rather, I'd have to figure out the coding/logic for each individual preset, and put *that* into my parantheses?
Answers.UserDisplayName: user6262902
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-16T21:39:08.127Z
Answers.Text: Presents are a way of applying pre configured changes to properties, animation and effects, so they change different things. So yes, you'd have to reverse engineer the preset and use expressions for each parameter the preset affects
Answers.UserDisplayName: stib
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-16T00:15:07.757Z
Answers.LastActivityDate: 2018-04-16T00:15:07.757Z
Answers.UserDisplayName: stib
Body: <p>Is there a way to control whether or not an animation preset it applied to an item programmatically through After Effects?</p>
  
  <ol>
  <li>Let's say, for example, I have some sample text, that just says "hello world".</li>
  <li>I then go and drag &amp; drop a "slide &amp; swoop" onto the hello world text.</li>
  <li>I then add another transition, say a 'slide straight' from the effects &amp; presets</li>
  <li>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?</li>
  </ol>
  
Tags: <after-effects>
Title: Controlling animation presets programmatically
UserDisplayName: user6262902
ThreadText: # Controlling animation presets programmatically
  
  (Asked by: username_0 on 2018-04-15)
  
  Is there a way to control whether or not an animation preset it applied to an item programmatically through After Effects?
  
  1. Let's say, for example, I have some sample text, that just says "hello world".
  2. I then go and drag & drop a "slide & swoop" onto the hello world text.
  3. I then add another transition, say a 'slide straight' from the effects & presets
  4. 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?
  
  **Tags:** after-effects
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-04-16. Score: 0
  
  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 `u``u` (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:
  
  ```js
  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
  }
  
  ```
  
  > **Comments:**
  > **username_0**: hmm, I 'think' I understand what you are saying (I do programming, but new to 'adobe' programming)... you mean - there isn't just an easy way to say to use the, let's say "stretch wipe" preset, and just say  if (ctrl == 1) {jump to preset 1} if (ctrl == 2) ... etc  but rather, I'd have to figure out the coding/logic for each individual preset, and put *that* into my parantheses?  
  > **username_1**: Presents are a way of applying pre configured changes to properties, animation and effects, so they change different things. So yes, you'd have to reverse engineer the preset and use expressions for each parameter the preset affects  
  
  ---
  
  