74 lines
1.8 KiB
React
74 lines
1.8 KiB
React
|
|
|
|
|
|
/**
|
|
* A function library for adding text animators on top of text layers
|
|
*
|
|
* @author Kyle Harter
|
|
*
|
|
*/
|
|
|
|
|
|
var KMTextAnimatorsLib = (function(){
|
|
|
|
var matchNames = {
|
|
animator: "ADBE Text Animator",
|
|
|
|
props: {
|
|
anchorPoint: "ADBE Text Anchor Point 3D" ,
|
|
position: "ADBE Text Position 3D" ,
|
|
scale: "ADBE Text Scale 3D" ,
|
|
skew: "ADBE Text Skew" ,
|
|
skewAxis: "ADBE Text Skew Axis" ,
|
|
rotation: "ADBE Text Rotation",
|
|
opacity: "ADBE Text Opacity"
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
* adds a text animator group to a text layer along with a range selector
|
|
*
|
|
* @param {TextLayer} textLayer
|
|
* @param {string} animator - matchNames.animatorName
|
|
* @return {Property} the added text animation property
|
|
*/
|
|
function addBasicAnimator(textLayer, animator){
|
|
var anim = textLayer.property("ADBE Text Properties")
|
|
.property("ADBE Text Animators")
|
|
.addProperty(animator);
|
|
|
|
|
|
var selector = anim.property("ADBE Text Selectors").addProperty("ADBE Text Selector");
|
|
|
|
return anim
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* adds a text animator property to a text animator group
|
|
*
|
|
* @param {object} anim - the text animator group established in "addBasicAnimator(textLayer,animator)"
|
|
* @param {string} prop - matchNames.propName
|
|
* @return {Property} added text animator property
|
|
*/
|
|
function addAnimProp(anim,prop){
|
|
var animPosGroup = anim.property("ADBE Text Animator Properties");
|
|
var textAnimProp = animPosGroup.addProperty(prop);
|
|
return textAnimProp
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
matchNames: matchNames,
|
|
addBasicAnimator: addBasicAnimator,
|
|
addAnimProp: addAnimProp
|
|
};
|
|
}());
|
|
|