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

paragraph set boxTextPos [0, 0] doesn't work

Explorer ,
Jun 03, 2024 Jun 03, 2024

Copy link to clipboard

Copied

Hi,

 

I'm using AE 24.4.1 , and created a project with a single composition and a single paragraph text, to do scripting tests.

 

When running the following script, the value doesn't update if "pos = [0, 0]"

 

var txt = layer.sourceText.value;
var pos = [0, 0];
txt.boxTextPos = pos;
layer.sourceText.setValue(txt);

 

If pos[0] is not null, or pos[1] is not null, the position updates.

The bug seems to occur only with [0, 0].

 

Bug Unresolved
TOPICS
Scripting

Views

60

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
3 Comments
Adobe Employee ,
Jun 04, 2024 Jun 04, 2024

Copy link to clipboard

Copied

Indeed you are right - this looks to be very old code too.

 

I wonder why it was done that way?

 

It is just a straight comparison to zero - if you made the value .000001 for either pos x/y it ought to work.

 

I will look into it - thanks for reporting it @aescripter7 

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report
Explorer ,
Jun 04, 2024 Jun 04, 2024

Copy link to clipboard

Copied

Why do you think it's old code ? Are there other ways to do the same thing ?

 

The use case is to control the position of the paragraph programmatically.

 

In fact I just found out there are 2 ways to create text layers, regular text layers (just a click with the text tool), and paragraphs (click + holding) and that they behave differently on the anchor point management.

 

Controlling the anchor point of a regular text layer is accessible with the help of sourceRectAtTime().

For the Paragraph, I figured out there was not only the anchorPoint but another data which could be seen as a (2nd/sub-)anchor point (boxTextPos).

 

I was searching ways to move programmatically this anchorPoint, and found boxTextPos here https://ae-scripting.docsforadobe.dev/text/textdocument.html#textdocument-boxtextpos . 

In AE 23.6.2, I couldn't set boxTextPos with negative components ([-1, -1] = crash), but when we create a paragraph layer, the anchor is by default with negative components ([-250, -50] for example).

It was fixed since, in AE 24.4.1 negative and positive values do work, but doesn't work with [0, 0].

 

Visual example:

 

1) create a paragraph1) create a paragraph

 

2) click on the layer, the anchor point is a the center of the paragraph bounding box2) click on the layer, the anchor point is a the center of the paragraph bounding box3) resize the paragraph bounding box3) resize the paragraph bounding box4) the anchor point has not moved, but it isn't centered anymore4) the anchor point has not moved, but it isn't centered anymore

 

 

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jun 04, 2024 Jun 04, 2024

Copy link to clipboard

Copied

LATEST

It is old code because I can see the history - this behavior existed at least as far back as May 2021.

 

I remember the bug about negative positions - that was failing on validation and I changed that back in November 2023.

 

This is just a bug that affects setting the boxTextPos by Scripting - it has nothing to do with the other ways in which the position can be set.

 

Just to keep our terms tidy - this is NOT about setting the position of a paragraph, it is setting the position of the box (container) for the containing paragraph(s).

 

Your workaround is to make sure that if both x and y pos are zero, that you will have to change one of them ever slo slightly to be non-zero.

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Translate

Report

Report