├── .DS_Store ├── LICENSE ├── NO_TOC_README.md ├── README.md ├── TOC.md ├── loop_path.jsx ├── parent_delay.jsx ├── parent_temporary.jsx ├── reverse-animation.jsx └── timeline.jsx /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ae-scripting/Expressions/2599b55b44e3b55fdcff121d18e675f4ced06104/.DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Nik Ska, Fabian Morón Zirfas 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /NO_TOC_README.md: -------------------------------------------------------------------------------- 1 | Expressions 2 | =========== 3 | 4 | a loose collection of After Effects expressions 5 | 6 | They may not be universalized. To do this check out these tools: 7 | 8 | universalization helper tools 9 | ---- 10 | - [rd: Gimme Prop Path](http://www.redefinery.com/ae/view.php?item=rd_GimmePropPath) 11 | - [ExpressionUniversalizer](http://aescripts.com/expressionuniversalizer/) 12 | 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Expressions 2 | =========== 3 | 4 | a loose collection of After Effects expressions 5 | 6 | They may not be universalized. To do this check out these tools: 7 | 8 | universalization helper tools 9 | ---- 10 | - [rd: Gimme Prop Path](http://www.redefinery.com/ae/view.php?item=rd_GimmePropPath) 11 | - [ExpressionUniversalizer](http://aescripts.com/expressionuniversalizer/) 12 | 13 | 14 | ##Autogenerated TOC 15 | ###[loop_path.jsx](https://raw.github.com/ae-scripting/Expressions/master/loop_path.jsx) 16 | /** 17 | * @author [author] 18 | * @description allows for temp parenting you need 19 | * one layer control and one checkbox control for this 20 | * 21 | * @todo [description] 22 | */ 23 | 24 | -------------- 25 | 26 | ###[parent_delay.jsx](https://raw.github.com/ae-scripting/Expressions/master/parent_delay.jsx) 27 | /** 28 | * @author [author] 29 | * @description just a simple expression to delay parenting selected property 30 | * 31 | * 32 | * @todo [description] 33 | */ 34 | 35 | -------------- 36 | 37 | ###[parent_temporary.jsx](https://raw.github.com/ae-scripting/Expressions/master/parent_temporary.jsx) 38 | /** 39 | * @author [author] 40 | * @description allows for temp parenting 41 | * you need one layer control and one checkbox control for this 42 | * 43 | * @todo [description] 44 | */ 45 | 46 | -------------- 47 | 48 | ###[reverse-animation.jsx](https://raw.github.com/ae-scripting/Expressions/master/reverse-animation.jsx) 49 | /** 50 | * @author [author] 51 | * @description reverse animation after marker You may add a compMarker checkbox control to the layer 52 | * which will make the expression to take markers from composition 53 | * if needed. Otherwise layer markers will be used 54 | * @todo [description] 55 | */ 56 | 57 | -------------- 58 | 59 | ###[timeline.jsx](https://raw.github.com/ae-scripting/Expressions/master/timeline.jsx) 60 | /** 61 | * @author Timur Constantinov 62 | * @description function to getting current layer on time line 63 | * || start (int) : first index of layers in comp 64 | * || end (int) : last index of layers 65 | * You should add two sliders - "startLayer" and "endLayer" 66 | */ 67 | 68 | -------------- 69 | 70 | -------------------------------------------------------------------------------- /TOC.md: -------------------------------------------------------------------------------- 1 | ##Autogenerated TOC 2 | ###[loop_path.jsx](https://raw.github.com/ae-scripting/Expressions/master/loop_path.jsx) 3 | /** 4 | * @author [author] 5 | * @description allows for temp parenting you need 6 | * one layer control and one checkbox control for this 7 | * 8 | * @todo [description] 9 | */ 10 | 11 | -------------- 12 | 13 | ###[parent_delay.jsx](https://raw.github.com/ae-scripting/Expressions/master/parent_delay.jsx) 14 | /** 15 | * @author [author] 16 | * @description just a simple expression to delay parenting selected property 17 | * 18 | * 19 | * @todo [description] 20 | */ 21 | 22 | -------------- 23 | 24 | ###[parent_temporary.jsx](https://raw.github.com/ae-scripting/Expressions/master/parent_temporary.jsx) 25 | /** 26 | * @author [author] 27 | * @description allows for temp parenting 28 | * you need one layer control and one checkbox control for this 29 | * 30 | * @todo [description] 31 | */ 32 | 33 | -------------- 34 | 35 | ###[reverse-animation.jsx](https://raw.github.com/ae-scripting/Expressions/master/reverse-animation.jsx) 36 | /** 37 | * @author [author] 38 | * @description reverse animation after marker You may add a compMarker checkbox control to the layer 39 | * which will make the expression to take markers from composition 40 | * if needed. Otherwise layer markers will be used 41 | * @todo [description] 42 | */ 43 | 44 | -------------- 45 | 46 | ###[timeline.jsx](https://raw.github.com/ae-scripting/Expressions/master/timeline.jsx) 47 | /** 48 | * @author Timur Constantinov 49 | * @description function to getting current layer on time line 50 | * || start (int) : first index of layers in comp 51 | * || end (int) : last index of layers 52 | * You should add two sliders - "startLayer" and "endLayer" 53 | */ 54 | 55 | -------------- 56 | 57 | -------------------------------------------------------------------------------- /loop_path.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @author [author] 3 | * @description allows for temp parenting you need 4 | * one layer control and one checkbox control for this 5 | * 6 | * @todo [description] 7 | */ 8 | 9 | try{ 10 | target = effect(1)(1).transform.position; //target layer 11 | 12 | onOff = effect(2)(1); //checkbox is the second 13 | 14 | near = onOff.nearestKey(time); 15 | if(time1){ //if False - add 23 | //if 1st is False - pass 24 | increment+=target.valueAtTime(onOff.key(i).time); 25 | } 26 | else{ //if True - subtrackt 27 | increment-=target.valueAtTime(onOff.key(i).time); 28 | } 29 | } 30 | 31 | if(onOff.key(nI).value == 1){ 32 | //if we have true on the left (we move) 33 | increment+=target; 34 | } 35 | 36 | value + increment; //add 37 | 38 | } 39 | 40 | catch(err){value}; 41 | 42 | //make it recursive 43 | -------------------------------------------------------------------------------- /parent_delay.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @author [author] 3 | * @description just a simple expression to delay parenting selected property 4 | * 5 | * 6 | * @todo [description] 7 | */ 8 | 9 | delta = index; 10 | n = thisComp.layer(1).transform.position; //choose null and prop 11 | n_k = n.key(2); //out-1, in-2 12 | 13 | null_pos = n.valueAtTime(time-delta*thisComp.frameDuration); //shift delta frames left 14 | 15 | value + null_pos - n_k; 16 | 17 | 18 | -------------------------------------------------------------------------------- /parent_temporary.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @author [author] 3 | * @description allows for temp parenting 4 | * you need one layer control and one checkbox control for this 5 | * 6 | * @todo [description] 7 | */ 8 | 9 | try{ 10 | target = effect(1)(1).transform.position; //target layer 11 | 12 | onOff = effect(2)(1); //checkbox is the second 13 | 14 | near = onOff.nearestKey(time); 15 | if(time1){ //if False - add 23 | //if 1st is False - pass 24 | increment+=target.valueAtTime(onOff.key(i).time); 25 | } 26 | else{ //if True - subtrackt 27 | increment-=target.valueAtTime(onOff.key(i).time); 28 | } 29 | } 30 | 31 | if(onOff.key(nI).value == 1){ 32 | //if we have true on the left (we move) 33 | increment+=target; 34 | } 35 | 36 | value + increment; //add 37 | 38 | } 39 | 40 | catch(err){value}; 41 | 42 | //make it recursive 43 | -------------------------------------------------------------------------------- /reverse-animation.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @author [author] 3 | * @description reverse animation after marker You may add a compMarker checkbox control to the layer 4 | * which will make the expression to take markers from composition 5 | * if needed. Otherwise layer markers will be used 6 | * @todo [description] 7 | */ 8 | 9 | 10 | try{ 11 | if(effect("compMarker")("Checkbox")==1){ 12 | mrkr = thisComp.marker; 13 | } 14 | else mrkr = marker; 15 | } 16 | catch(err){ mrkr = marker;} 17 | 18 | n = 0; 19 | if (mrkr.numKeys > 0){ 20 | n = mrkr.nearestKey(time).index; 21 | if (mrkr.key(n).time > time) n--; 22 | } 23 | 24 | if(n>0){ 25 | 26 | try{ 27 | t = time-mrkr.key(n).time; 28 | if(n%2==1){ 29 | lastKeyTime = thisProperty.key(thisProperty.numKeys).time; 30 | thisProperty.valueAtTime(lastKeyTime-t); 31 | } 32 | else{ 33 | thisProperty.valueAtTime(t+thisProperty.key(1).time); 34 | } 35 | } 36 | catch(err){value;} 37 | } 38 | else value; 39 | -------------------------------------------------------------------------------- /timeline.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Timur Constantinov 3 | * @description function to getting current layer on time line 4 | * || start (int) : first index of layers in comp 5 | * || end (int) : last index of layers 6 | * You should add two sliders - "startLayer" and "endLayer" 7 | */ 8 | 9 | 10 | function getCurrentLayer(start, end) { 11 | arr = [];//array for current layers in time line 12 | for (var i=start;i<=thisComp.numLayers-end;i++) { 13 | //if layer start later than current time 14 | //and not finish yet 15 | if (time>=thisComp.layer(i).inPoint && time<=thisComp.layer(i).outPoint) { 16 | arr.push(thisComp.layer(i));//push the layer to array 17 | } 18 | } 19 | 20 | arr.sort(function(a, b) { 21 | //sorting array function 22 | if (b.marker.numKeys>0) { 23 | //if have a marker key and time is not earler 24 | //push it to first index else push to end 25 | return time<=b.marker.key(1).time ? -1 : 1; 26 | } else { 27 | //if don't have a markers counting by inPoint 28 | return b.inPoint-a.inPoint; 29 | } 30 | }); 31 | 32 | return arr[0];//return first index of array 33 | } 34 | 35 | var layerStart = Math.floor(effect("startLayer")("Slider"))//link to slider of first layer from that we will find. 36 | var layerEnd = effect("endLayer")("Slider");//link to slider of last layer to that we will find. 37 | var sep = "\t\t\t\t\t\t\t\t\t\t\t\t";//seperator 38 | var stampBlock = "CURRENT TIME: "+timeToTimecode(time, 1/thisComp.frameDuration);//timestamp 39 | var _l = getCurrentLayer(layerStart, layerEnd);//finding layer 40 | 41 | var layerBlock="THIS SHOT: | "+_l.name.toLowerCase()+" |";//current shot name 42 | var layerFrameBlock="["+timeToTimecode(_l.time-_l.inPoint, 1/thisComp.frameDuration)+"]";//current shot timestamp from inPoint 43 | value=stampBlock+sep+layerBlock+" ››› "+layerFrameBlock;//merge all 44 | --------------------------------------------------------------------------------