Skip to content

Instantly share code, notes, and snippets.

@seblavoie
Last active October 11, 2015 13:28
Show Gist options
  • Save seblavoie/3865896 to your computer and use it in GitHub Desktop.
Save seblavoie/3865896 to your computer and use it in GitHub Desktop.
Switch texts or images with a slider
// Replace _slider by your own slider
// Parsing single string
// Paste this expression in Source Text attribute
// Source Text: "French | English | Spanish"
_slider = comp("# Animation").layer("CONTROLLER").effect("Language")("Slider");
value.split(" | ")[Math.floor(_slider)];
// Navigating through frames
// Time remap composition containing multiple single frames layers
(comp("# Animation").layer("Controller").effect("Language")("Slider") - 1) * thisComp.frameDuration
// Showing layers based on their index
// Layers(1) will be shown on CONTROLLER[Language=1]
// Paste onto each translated layer's opacity
_slider = comp("# Animation").layer("CONTROLLER").effect("Language")("Slider");
(index == Math.floor(_slider)) ? 100 : 0;
// Filtering layers according to their layer name
// Experimental, shouldn't use
lang = new RegExp("^" + comp("# Animation").layer("CONTROLLER").effect("Language")("Layer").name, "g");
(name.match(lang) ? value : 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment