Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects after effects jsx reset position

  • after effects jsx reset position

  • Cam Holland

    November 30, 2022 at 9:37 am

    I need a quick way to reset the position of a selected layer to 0,0.
    I found this jsx script:
    https://github.com/kyletmartinez/After-Effects-Scripts/blob/bb0c5f7ce7584457fc8c58bb070c37e15f86918d/scripts/Zero%20Position.jsx

    which zero’s the position but creates a null to do so.

    *I just want to change the x and y values back to 0 like a reset position function*

    (Its for a character rig / head rotation layer that I constantly need to reset to 0 so i can make changes to the default position of the head and then move the x y coordinates to see if the change was successful.)
    I can then add this .jsx file to a kbar icon and then it would be super fast fixing my character rigs in the future.

    thank you and it would save me so much time if someone had a solution. not much of a coder but can copy paste and understand with trial and error.

  • Filip Vandueren

    November 30, 2022 at 12:16 pm

    You can add an animation preset to Kbar I believe ?

    Then set the value of position to 0,0 manually, select the property and create an animation preset of this. So, no scripting is needed.

    A scripting solution would use:

    yourLayer.transform.position.setValue([0,0]);

    but you’d first need to establish what “yourLayer” is.

  • Cam Holland

    December 1, 2022 at 2:53 am

    Thank you, although the scripting looks like it would work, kbar has a animation preset option through a .ffx, but I have no idea how to create a .ffx for it to point to. I created a .ffx file in wordpad with your code but doenst work. looking at other .ffx formats there is a bunch more code needed for it to work it seems.
    KBAR can apply effect from effects tab , apply preset (through a .ffx file), set expression, invoke menu item, open extension, jsx file, run scriptlet, run shell command.

    I tried your code with my layer name for scriptlet and as a jsx and ffx file but doesnt work.
    Any ideas what this needs to work?

  • Filip Vandueren

    December 1, 2022 at 8:23 am
  • Cam Holland

    December 1, 2022 at 11:34 am

    Thank you solved the issue. works perfectly. Champ. 😁

Viewing 1 - 5 of 5 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy