Activity › Forums › Adobe After Effects Expressions › Show a property using Extendscript
-
Show a property using Extendscript
Posted by Avinash Ramanath on February 13, 2021 at 8:27 amHi, I need help in exposing the Path 1 property of the line layer. Is there a shortcut to do so or can I get help in writing a script that will twirl down to that level. Thanks.
Anton Shushar replied 2 years, 7 months ago 4 Members · 8 Replies -
8 Replies
-
Fabrice Leconte
February 13, 2021 at 2:13 pm -
Filip Vandueren
February 14, 2021 at 10:42 pmI just came up with this hack:
// prop we want to reveal:
prop = app.project.item(1).layer("Shape Layer 1")("Contents")("Shape 1")("Contents")("Path 1")("Path");
// reveal in timeline Hack:
originalExpression = prop.expression;
prop.expression= "1/0"; // create an expression error
//reveal expression errors:
app.executeCommand( app.findMenuCommandId("Reveal Expression Errors") );
$.sleep(1); // wait 1 ms
// reset expression to previous value
prop.expression = originalExpression;It does seem to hide the properties that were previously visible though…
-
Avinash Ramanath
February 16, 2021 at 2:05 amThanks for your effort on this. Running this code exposes the path property. Is there any way I can show its parent – Path 1 and make its state as selected? Fingers crossed.
-
Avinash Ramanath
February 16, 2021 at 2:06 amThanks but I wanted the Path 1 attribute exposed so that I can select its leads and modify it
-
Filip Vandueren
February 16, 2021 at 7:39 amNo, the hack only works on properties that have canSetExpressiom=true
And it is a hack, there’s no official way to show or hide anything in the timeline via scripting.
-
Avinash Ramanath
February 16, 2021 at 8:32 amOK, thanks very much for trying. I will use this hack sometime in the future.
-
Anton Shushar
April 7, 2022 at 8:45 pmI modified Filip’s code a bit to support multiple properties. You just need to pass as many properties as you need into
revealProperty
function as argumentsHere’s small working example:
var curComp = app.project.activeItem;
var curLayer = curComp.selectedLayers[0];
revealProperty(curLayer.opacity, curLayer.scale);
function revealProperty(){
var originalExpressions = [], prop = arguments;
for(i=0; i<prop.length; i++){
originalExpressions.push(prop[i].expression);
prop[i].expression= "1/0";
}
app.executeCommand(app.findMenuCommandId("Reveal Expression Errors"));
$.sleep(1);
for(i=0; i<prop.length; i++){
prop[i].expression = originalExpressions[i];
}
}
Reply to this Discussion! Login or Sign Up