Skip to main content
Bram Hoekstra
Inspiring
August 11, 2021
Answered

target separated position dimensions in AE Script?

  • August 11, 2021
  • 2 replies
  • 2251 views

Heey,

 

I'm wandering how to target separated position dimensions in a AE Script.

 

I separated the position dimensions with ".position.dimensionsSeparated = true" and want to apply expressions to each value.

 

I know I can add the different expressions in one expression, but it is eassier and more efficient to code it this way in this case.

 

Does anyone know how to apply expressions to the position dimension values after they have been separated?

 

Thank in advance for the reactions!

Correct answer Mathias Moehl

Yes, if you want to do it manually, you can do it via the context menu of the property. If you want to do it with a script, you need the dimensionSeparated attribue.

2 replies

Mathias Moehl
Community Expert
Community Expert
August 12, 2021

Say that your position property is stored in the variable "pos".

Then pos.getSeparationFollower(0) will give you the property for the x value and pos.getSeparationFollower(1) will give you the property for the y value. You can apply expressions to them as you can for any other property, i.e.

pos.getSeparationFollower(1).expression = "value+1";

 

See

https://ae-scripting.docsforadobe.dev/properties/property/#property-getseparationfollower

 

If your dimensions are not separated, yet, you should do

pos.dimensionsSeparated = true;

before you try to assign any expressions to the separated dimensions.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Participant
August 14, 2022

right click separate dimensions  on the position parameter on the timeline?

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
August 14, 2022

Yes, if you want to do it manually, you can do it via the context menu of the property. If you want to do it with a script, you need the dimensionSeparated attribue.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
Legend
August 12, 2021

I'm not clear what specifically you are asking. You add them like any other property. You would only need an extra check onj whether the properties are actually separated just in case...

 

Mylenium