Activity › Forums › Adobe After Effects › After Effects + JavaScript: How to change the position of a single axis?
-
After Effects + JavaScript: How to change the position of a single axis?
Michael Kurz replied 7 years, 9 months ago 7 Members · 18 Replies
-
Gleb Rysanov
December 8, 2011 at 9:42 amOh…sorry, I thought you was talking of expressions…those also use Java language, don’t they?
-
Conor Grebel
December 8, 2011 at 10:15 pmyes you thought it was expressions. Even though In my initial post and in EVERY POST AFTER THAT I wrote “not about expressions, please read description”
Please if somebody can help me I would appreciate it…
-
Steve Blacker
December 8, 2011 at 11:45 pmActually, your original post didn’t explicitly state that you were attempting to write a script, per se, and since most questions here *would* pertain to expressions rather than scripts, I think it’s an oversight that can be forgiven, no?
Did you not have any luck with your question over at aescripts.com?
Because if you can get help with scripting anywhere, it’s there. Perhaps you need to think of alternate ways to achieve the result you’re after.
It’s only work if you’d rather be doing something else…
-
Conor Grebel
December 8, 2011 at 11:58 pmI did write Javascript. yes I posted there but no response…
I’m getting frustrated because every response has been for expressions… -
Steve Blacker
December 9, 2011 at 12:06 amI see two responses to your post there, one from Lloyd, who is a veritable script guru. Neither of those suggestions helped?
It’s only work if you’d rather be doing something else…
-
Touko Maksimainen
January 12, 2015 at 8:04 amapp.project.item(1).layer(“”).property(“Position”).getSeparationFollower(0).setValue=value;
0 for x, 1 for y, etc.
-
Dusan Marinkovic
December 21, 2015 at 6:13 pmapp.project.item(1).layer(“”).property(“Position”).getSeparationFollower(0).setValue=value;
This doesnt seem to work, value is not set with new value.
Can anyone explain how to use properly Property methods and attributes related to the Separate Dimensions feature(dimensionsSeparated,getSeparationFollower,isSeparationFollower,isSeparationLeader,separationDimension,
separationLeader)? -
Michael Kurz
July 31, 2018 at 2:34 amJust getting into scripting and finding out that resources and documentation online are very sparse. Why no official documentation? Anyway….
I’m pretty sure Touko Maksimainen above is nearly correct regarding how to set (at least by ExtendScript, After Effect’s javascript language) the position properties of a layer with Separate Dimensions. To be clear, I’m referring to “Separate Dimensions” as the option After Effects gives you when you right click a layer’s position property and check the “Separate Dimensions” option. This splits the position property into two properties “X Position” and “Y Position” (and a “Z Position” if the layer is 3D) in the timeline view.
To check if a layer has Separate Dimensions:
mylayer.position.dimensionsSeparatedTo access X Position of a layer with Separate Dimensions (read-only):
mylayer.position.getSeparationFollower(0).value;To access Y Position of a layer with Separate Dimensions (read-only):
mylayer.position.getSeparationFollower(1).value;To set X Position of a layer with Separate Dimensions:
mylayer.position.getSeparationFollower(0).setValue(value);
Notice how the setValue part is a method, just a little different than Touko’s suggestion.IMPORTANT: If your layer has keyframes, I believe you will need to use one of these in order to set a value:
app.project.item(index).layer(index).propertySpec.setValueAtKey(keyIndex, newValue)
app.project.item(index).layer(index).propertySpec.setValueAtTime(time, newValue)The best documentation I can find is from AEnhancers:
https://docs.aenhancers.com/properties/property/#property-setvalueatkeyhttp://www.freelancebymichael.com
Reply to this Discussion! Login or Sign Up