Copy link to clipboard
Copied
I'm working on a .jsx and I've hit a wall with adding an expression to an expression selector.
This is the chunk of code I have that gives no errors, but doesn't actually add the expression to the expressible selector....
function createLabelsTextLayer(comp, labels) {
var textLayer = comp.layers.addText("Labels");
textLayer.name = "Labels";
var textProp = textLayer.property("Source Text");
var expression = '["' + labels.join('", "') + '"]';
textProp.expression = expression;
// Create a single position animator
var myAnim = textLayer.Text.Animators.addProperty("ADBE Text Animator");
myAnim.property("ADBE Text Animator Properties").addProperty("ADBE Text Position 3D");
var expressionSelector = myAnim.property("ADBE Text Selectors").addProperty("ADBE Text Expressible Selector");
var expSel = expressionSelector.property("ADBE Text Expressible Amount").expression;
var expression1 = "wiggle(5, 50)";
expSel.expression1 = expression1;
// based on lines
var basedOnProperty = expressionSelector.property("ADBE Text Range Type2");
basedOnProperty.setValue(4);
return textLayer;
}
where am I going wrong?
Copy link to clipboard
Copied
solved via gtp....
function createLabelsTextLayer(comp, labels) {
var textLayer = comp.layers.addText("Labels");
textLayer.name = "Labels";
var textProp = textLayer.property("Source Text");
var expression = '["' + labels.join('", "') + '"]';
textProp.expression = expression;
// Create a single position animator
var myAnim = textLayer.Text.Animators.addProperty("ADBE Text Animator");
myAnim.property("ADBE Text Animator Properties").addProperty("ADBE Text Position 3D");
var expressionSelector = myAnim.property("ADBE Text Selectors").addProperty("ADBE Text Expressible Selector");
var expSel = expressionSelector.property("ADBE Text Expressible Amount");
var expression1 = "wiggle(5, 50)";
expSel.expression = expression1;
// based on lines
var basedOnProperty = expressionSelector.property("ADBE Text Range Type2");
basedOnProperty.setValue(4);
return textLayer;
}
Copy link to clipboard
Copied
This line is wrong:
expSel.expression1 = expression1;
function createLabelsTextLayer(comp, labels) {
var textLayer = comp.layers.addText("Labels");
textLayer.name = "Labels";
var textProp = textLayer.property("Source Text");
var expression = '["' + labels.join('", "') + '"]';
textProp.expression = expression;
// Create a single position animator
var myAnim = textLayer.Text.Animators.addProperty("ADBE Text Animator");
myAnim.property("ADBE Text Animator Properties").addProperty("ADBE Text Position 3D");
var expressionSelector = myAnim.property("ADBE Text Selectors").addProperty("ADBE Text Expressible Selector");
var expression1 = "wiggle(5, 50)";
expressionSelector.property("ADBE Text Expressible Amount").expression = expression1;
// based on lines
var basedOnProperty = expressionSelector.property("ADBE Text Range Type2");
basedOnProperty.setValue(1);
}