Expression Control

New Here ,
Sep 01, 2020

Copy link to clipboard

Copied

Hi everyone,

I have a background with four different values. I have a wide shot, a close up shot, a beauty shot and a screen shot. It is basically the same background with different transform values. Instead of having to duplicate the background, I would like to have only one layer with checkbox that would activivate a specific transform keyframe. Is it possible? 

 

TOPICS
Expressions

Views

70

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Sep 01, 2020

Copy link to clipboard

Copied

The Drop-down Menu Control is more suited for a single, mutually exclusive, selection across multiple options.

 

Drop-down Menu Setup

Roland_Kahlenberg_0-1598993414589.png

 

In the Timeline, spread out your keyframes every 10 frames for easy referencing.

You will set up your menu as the one below, with four entries, one for each of the possible selections. So, you will have keyframes at time = 0, 10, 20 and the 30 frame mark of your Timeline.

 

Roland_Kahlenberg_1-1598993549098.png

 

 

Then apply this same Expression to all the properties.

----------------------------------------------

myShotSelectionMenu= effect("Shot Selection Menu")(1);
if(myShotSelectionMenu==1) {
thisProperty.valueAtTime(framesToTime(1))
} else if(myShotSelectionMenu==2) {
thisProperty.valueAtTime(framesToTime(10))
} else if(myShotSelectionMenu==3) {
thisProperty.valueAtTime(framesToTime(20))
} else {
thisProperty.valueAtTime(framesToTime(30))
}

---------------------------------------------

HTH

 


Digital-First Brand Guidelines | Responsive Design Solutions
Development | Consulting | Training

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Guide ,
Sep 01, 2020

Copy link to clipboard

Copied

Indeed, Dropdowns are a great application for this - just as Roland said.

 

But instead of applying the same expression on all properties, better use timeRemap and stick it to the selected keyframe time. You can use any of your properties, as long as the keyframes are not shifted to each other. This will also works with markers. You need as much keyframes as menu entries, but it doesn't matter where you place them.

And this effectively will stop the time on the layer, so if there are any animations going on, we need another approach.

 

The code looks like this:

 

prop = *pickwhip one of the properties with the keyframes here*

selection = effect("Shot Selection Menu")(1);

prop.key(selection).time;

 

*Martin

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more