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

expression result must be of dimension 2 not 1+sourceReacTatTime

Community Beginner ,
Jan 31, 2020 Jan 31, 2020

Hi I'm trying to create a responsive textbox

Eventhough Im following EAbrahams instruction I got the following

message

this script is under shape layer, Rectangle/Rectangle Path/ Size and 'text' is the text layer

t=thisComp.layer("text").sourceRectAtTime();
w=t.width;
h=t.height;

(w,h)

expression result must be of dimension 2 not 1

Screenshot 2020-01-31 at 19.54.23.png

where is the bug in this ?

even if I try other the other guys script(https://www.youtube.com/watch?v=CVliDoNgoCg)

var t=thisComp.layer("text");
var w=t.sourceRectAtTime().width;
var h=t.sourceRectAtTime().height;

(w,h)

I got the same "expression result must be of dimension 2 not 1" message, Im a noob, but this is surreal.

If anyone have an idea, it would be appreciated.

Get the most comprehensive intro to After Effects ever: https://jkinmo.com/liae sourceRectAtTime() is a crazy useful expression, but there isn't a great explanation of what it exactly does, or how to wrangle it to do what you want. In this tutorial I'll demystify this expression and teach ...
TOPICS
Error or problem , Scripting
41.3K
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

correct answers 1 Correct answer

Valorous Hero , Jan 31, 2020 Jan 31, 2020

Use square brackets [ ] when defining an array. So, type [w,h] instead of (w,h).

Translate
Valorous Hero ,
Jan 31, 2020 Jan 31, 2020

Use square brackets [ ] when defining an array. So, type [w,h] instead of (w,h).

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
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 Beginner ,
Jan 31, 2020 Jan 31, 2020

thanks 🙂

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
Contributor ,
Jan 31, 2020 Jan 31, 2020

As far as i know, you should use square brackets "[]" instead of normal brackets "()". 

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 Beginner ,
Jun 21, 2023 Jun 21, 2023

Hello everyone, I have a similar problem! I have been following the tutorial that I've linked below to create a responsive text box animation because i wanted to change the width through the timeline smoothly. 

 

In the video, he wrote the following expressions on the scale;

 

originalBoxWidth = 1920;
targetWidth = effect("Textbox Width")("Slider");
s = targetWidth / originalBoxWidth;

value = s;

 

I followed the tutorial perfectly until this point and I got the "expression result must be of dimension 2, not 1" error on the first line but on the video it works just fine. 

 

I am new to the expressions and need some guidance to work this out. I couldn't find any other tutorial for the said effect so if you could recommend another way, it is also appreciated. 

 

https://www.youtube.com/watch?v=FpVPabZw3vU

 

Thank you!

Special thanks to our sponsors Squarespace. For a free trial and 10% off, visit https://www.squarespace.com/dojo and use the promo code: DOJO Tip originally by Ross Owens: https://twitter.com/RO_Motion Responsive Auto Scale Preset: https://creativedojo.net/store/responsive-auto-scale/ Today we'll
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
Contributor ,
Jun 21, 2023 Jun 21, 2023

Short answer, last line is "value * s" so you misread that ^^ 

Long answer that can help you in the future, some values like position are not singular values like 1 or 5 etc, they are "coordinates". (I probably remember the name wrong but it's been a while :/) 

As you can see, scale is (X,Y) in this case, so the expression should give a similar result as well. When you write "value = s", the value become a singular number which leads to that specific error. 

For beginners that error is something you can see frequently, so I wanted to explain what you should look for next time you see it and hopefully fix it yourself with ease. 

Good luck ^^ 

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 Beginner ,
Jun 23, 2023 Jun 23, 2023
LATEST

Thank you so much; I never realised the typo there! Also, thank you for the explanation; it made me understand the concept better and helped a lot!

Best wishes!

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