Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"Value At Time" with Scale

Engaged ,
Jun 12, 2022 Jun 12, 2022

Hopefully a quick and easy one this time. Short version: I'm trying to pull the value of a layer's scale at a specific time onto a slider, but I'm getting an error when I try to apply the expression. This is the expression syntax I've got:

 

temp2 = thisComp.layer(index-3).transform.scale[0].valueAtTime(10);

 

So basically what I'm trying to do is define a variable that'll pull the "X" scale of the layer (the slider is on a different layer if that makes a difference), but since it shifts at the start of the comp, I want it to pull a value from 10 seconds in after everything's settled down. But I can't seem to make AE happy.

 

If I leave off the "[0]", it says the result has to be of dimension 1, not 3 (it's a 3D layer in a Classic 3D space if that makes a difference, the layer I'm trying to pull it to is just a standard 2D layer). But when I add the "[0]", it says everything after temp2 (which is the variable I'm defining) isn't a function.

 

I'm slowly getting the hang of using and troubleshooting expressions, but I need help on this one.

TOPICS
Error or problem , Expressions
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2022 Jun 12, 2022

You just need to switch the syntax around a little. Try it this way:

temp2 = thisComp.layer(index-3).transform.scale.valueAtTime(10)[0];

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 12, 2022 Jun 12, 2022
LATEST

Dan Ebberts for the win as usual! It never even occurred to me to put the dimension indicator at the end. Thanks a million!

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