Variable expression error

New Here ,
May 21, 2020

Copy link to clipboard

Copied

Hi,

 

I'm trying to make a simple variable for a sourceRectAtTime expression but I am getting an error on my first variable definition.

var s = thisComp.layer("name");

 That's the first variable I want to define and I get the following error:
"Undefined value used in expression"

There is literally one composition in my project with only a shape layer and a text layer in it, so I don't think AE could be confused about the syntax. I tried switching the expression mode to legacy and that made no difference.

I just updated to the lastest version of AE, so maybe this is a bug?

 

Screenshot attached.

Any suggestions on how to troubleshoot would be greatly appreciated. 
 


Adobe Community Professional
Correct answer by Roland Kahlenberg | Adobe Community Professional

That single line won't do anything for the Size property which requires a number value for input.
There are tutorials on sourceRectAtTime which should help you out even though every tutorial on sourceRectAtTime that I've seen is either simplistic (doesn't cover realworld use cases) and is unnecessarily bloated. 😉

TOPICS
Error or problem, Expressions, Scripting

Views

770

Likes

Translate

Translate

Report

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

Variable expression error

New Here ,
May 21, 2020

Copy link to clipboard

Copied

Hi,

 

I'm trying to make a simple variable for a sourceRectAtTime expression but I am getting an error on my first variable definition.

var s = thisComp.layer("name");

 That's the first variable I want to define and I get the following error:
"Undefined value used in expression"

There is literally one composition in my project with only a shape layer and a text layer in it, so I don't think AE could be confused about the syntax. I tried switching the expression mode to legacy and that made no difference.

I just updated to the lastest version of AE, so maybe this is a bug?

 

Screenshot attached.

Any suggestions on how to troubleshoot would be greatly appreciated. 
 


Adobe Community Professional
Correct answer by Roland Kahlenberg | Adobe Community Professional

That single line won't do anything for the Size property which requires a number value for input.
There are tutorials on sourceRectAtTime which should help you out even though every tutorial on sourceRectAtTime that I've seen is either simplistic (doesn't cover realworld use cases) and is unnecessarily bloated. 😉

TOPICS
Error or problem, Expressions, Scripting

Views

771

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

That single line won't do anything for the Size property which requires a number value for input.
There are tutorials on sourceRectAtTime which should help you out even though every tutorial on sourceRectAtTime that I've seen is either simplistic (doesn't cover realworld use cases) and is unnecessarily bloated. 😉

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 21, 2020 0
New Here ,
May 21, 2020

Copy link to clipboard

Copied

Yeah, I realized that I was making an error with the sourceRectAtTime values but AE was underlining that variable as the problem so I was completely confused. Operator error! Thanks for the reply.  

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Also note that my extension Pins & Boxes can take care of all the technical details of writing sourceRectAtTime expressions for you. You can create complex dynamic layouts with it easily.

sample_vertical_optimized

Likes

Translate

Translate

Report

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