ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Using Expressions - how to check if a layer is selected

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Frank LimaUsing Expressions - how to check if a layer is selected
by on Jun 3, 2012 at 8:03:41 pm

I have these psd icons for an animated rig. I want the users to click these icons for different portions of the body (make it user friendly), but when they click on these icons, I want to make them 30% opaque so that the animators can see what is below (the rig).

I noticed there is no 'isSelected' boolean statement in Expressions so there's no way to see if the layer is selected, only 'active' but that doesn't help.

Is there a possibility to change the opacity on movement? such as this...
temp = thisLayer.position;
if(temp - this.position == [0,0])
{
transform.opacity = 30;

}

else
{
transform.opacity = 90;
}

I have this expression in the opacity transformation of the icon layer, but it doesn't work.


Return to posts index

Frank LimaRe: Using Expressions - how to check if a layer is selected
by on Jun 3, 2012 at 11:50:23 pm

I've refined it, but it's still not logically correct because it just keeps updating temp and temp2, thus it will always be the 'else' statement because they're both equal to each other. What I'm trying to do here logically is when the user moves the icon, the temp and temp2 variables will remain initial where at if statement, it will check its current position on that frame and compare it to the temp/temp2. If they're different, that means it moved and if it moved, it has to go transparent.

temp = thisLayer.position[0];
temp2 = thisLayer.position[1];


if(temp[0] != transform.position[0] && temp2[0] != transform.position[1])
{
transform.opacity = 30;
}

else
{
transform.opacity = 90;

}


Return to posts index

Darby EdelenRe: Using Expressions - how to check if a layer is selected
by on Jun 4, 2012 at 2:35:15 am

I'm 99.9% sure that there is no way to do what you're describing with expressions.

Darby Edelen


Return to posts index


Frank LimaRe: Using Expressions - how to check if a layer is selected
by on Jun 4, 2012 at 6:02:11 am

If that's the case, can it be done using the extendedScript editor? I'm still trying the other method, I'm getting close but there still isn't any kind of progress.

if I do the extendedScript option, will it not work anyway since it has to deal with layers? I mean, I've never used extendedScript before, but I'm well versed in programming in general as a computer scientist.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]