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

HELP, Why is this wrong, both should return a numeric value.

Explorer ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

transform.zPosition = thisComp.layer("text_02").transform.zPosition + 12;

 

 

 

TOPICS
Expressions

Views

328

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
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

It looks OK--where have you applied the expression? Are you getting an error message?

Votes

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
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

If you have applied the expression to a layer that doesn't have position dimensions separated, it would need to be more like this:

z = thisComp.layer("text_02").transform.zPosition + 12;
[value[0],value[1],z]

Votes

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
community guidelines
Explorer ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Same results Error can't return results in numeric value

Votes

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
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Can you post a screen shot that shows the expression in the timeline and the error message?

Votes

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
community guidelines
Explorer ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Adobe After Effects 2024 - I__Family_Little Butt_#1 - After Effects_Happy Holidays_edited.jpg

 My guess I am wrong, I know C##, and Visual Basic to me that should work. So don't laugh

 

Votes

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
community guidelines
Explorer ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Actually to me the 1st post should have worked.  

Votes

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
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

You'll get that error if text_02 doesn't have separated dimensions for position. If that's the case, this should work:

 

z = thisComp.layer("text_02").transform.position[2] + 12;
[value[0],value[1],z]

 

Votes

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
community guidelines
Explorer ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

Maybe I should tell you what I am looking for. I need an expression that moves layers below on the z axis a  # of pixels Hope that makes sense.

 

Thank

Mark

Votes

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
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

If neither layer has dimensions separated, the last one I posted should do the trick.

Votes

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
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

LATEST

If you just want to move a layer a number of pixels in the z direction, something like this should work:

n = 12;
value + [0,0,n]

Votes

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
community guidelines