Skip to main content
Known Participant
March 24, 2022
Question

using values of an "expressioned" property as an input

  • March 24, 2022
  • 1 reply
  • 750 views

i tried manipulate one layer's property by another layer that is being manipulated too and it didn't work.

I'll explain:

I had layerA that it's position value is being manipulated by an expression, and I wanted layerB opacity to turn 100% on if layerA position[0] is greater than 0. It didn't work. but when I turned off layerA expression and changed it's position manually, it did work.

I have the impression that layerB opacity expression is looking at the original value and not at the manipulated one.

Is it correct? is there any way making the expression look at the manipulated value?

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
March 24, 2022

An expression on one property only has access to the post-expression value of another property, so I suspect you're misinterpreting what's going on. What do the two expressions look like?

talwagAuthor
Known Participant
March 24, 2022

The expression on layerB Position is an array of values which is picked by the numbers on another layers' markers.

 

(It might sound familiar because you took a big part in building this template I'm working on, solving all the riddles I couldn't decipher 😅).

 

 

This is the full expression both layers have on their position:

m = comp("ASA_LL_sky_UI").layer("Click controller B").marker.key(2).comment;


const cm = comp("ASA_LL_sky_UI").layer("Click controller B").marker;
const catM = comp("ASA_LL_sky_UI").layer("Sky CAT controller").marker;
let latestMarkerIndex = 0;


if (catM.numKeys > 0) {
 latestMarkerIndex = cm.nearestKey(time).index;


 if (cm.key(latestMarkerIndex).time > time) {
latestMarkerIndex--;
 }
}
let outputText = "";


if (latestMarkerIndex > 0) {
 const latestMarker = cm.key(latestMarkerIndex);
 outputText = latestMarker.comment;
};

menus =  comp("ASA_LL_sky_UI").layer("Sky CAT controller").effect(2)("Menu").value;
yVals = [371,634,896,1157,1416,1684,1950,2208,2470,2730,2995,3254,3515,3781,4038];
m = outputText-1;
y = yVals[menus-1];
result = [
	[ 159.0632 , y ],
	[ 349.0632 , y ],
	[ 540.0632 , y ],
	[ 731.0632 , y ],
	[ 920.0632 , y ]
];

result[m];

 

Dan Ebberts
Community Expert
Community Expert
March 24, 2022

What's layer B's opacity expression?