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

Timeline: how to set duration of each frame, at the same time?

Participant ,
Dec 07, 2022 Dec 07, 2022

I'm animating in photoshop.

I have all the frames highlighted, and would like to set each frame duration on 2's. 

When I adjust the size of one of them, only that one frame gets adjusted, but not all the other frames that are highlighted.

Thank you.

5.6K
Translate
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

correct answers 1 Correct answer

Mentor , Dec 08, 2022 Dec 08, 2022

This can be done with a script. Initital state:

  1. All frames must be located on the same track. If they are located on different tracks, then the frame duration will be set correctly, but the starting position of each frame will remain unchanged.
  2. Before running the script, you need to select all the frames whose duration should be changed.

 

#target photoshop
s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayersIDs'));
r.putEnumerated(s2t('documen
...
Translate
Community Expert ,
Dec 07, 2022 Dec 07, 2022

With all of the frames selected, just change the "seconds" dropdown value in one frame, the others should all change to the same value.

Translate
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
Participant ,
Dec 07, 2022 Dec 07, 2022

I can't seem to find where the "seconds" dropdown value is. 

Translate
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
Participant ,
Dec 07, 2022 Dec 07, 2022

Oh wait, I found the dropdown, but only in the frame timeline. Is it not possible to adjust the frame duration like this for the video timeline mode?

 

Translate
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 ,
Dec 07, 2022 Dec 07, 2022

 

Select your first frame, then shift select the last frame.

The timing drop down in on the bottom right of the frame you first selected.

kevinstohlmeyer_1-1670453850373.png

 

kevinstohlmeyer_2-1670453868975.png

 

kevinstohlmeyer_0-1670453824249.png

 

Translate
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
Participant ,
Dec 07, 2022 Dec 07, 2022

Thank you.

But is there a way to do this in the Video Timeline mode?

Translate
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 ,
Dec 08, 2022 Dec 08, 2022

No there isn't. Premiere Pro would be a better program to do this in if you want advanced controls.

 

Translate
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
Mentor ,
Dec 08, 2022 Dec 08, 2022

This can be done with a script. Initital state:

  1. All frames must be located on the same track. If they are located on different tracks, then the frame duration will be set correctly, but the starting position of each frame will remain unchanged.
  2. Before running the script, you need to select all the frames whose duration should be changed.

 

#target photoshop
s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayersIDs'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var selectedLayers = executeActionGet(r).getList(p),
    layers = [],
    frameRate;
(r = new ActionReference()).putProperty(s2t("property"), s2t("time"));
r.putClass(s2t("timeline"));
(d = new ActionDescriptor()).putReference(s2t("null"), r);
(d1 = new ActionDescriptor()).putInteger(s2t("seconds"), 0);
d1.putInteger(s2t("frame"), 0);
d.putObject(s2t("to"), s2t("timecode"), d1);
executeAction(s2t("set"), d, DialogModes.NO);
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('frameRate'));
r.putClass(s2t('timeline'));
frameRate = executeActionGet(r).getDouble(p);
for (var i = 0; i < selectedLayers.count; i++) {
    (r = new ActionReference()).putIdentifier(s2t('layer'), selectedLayers.getReference(i).getIdentifier());
    (d = new ActionDescriptor()).putReference(s2t('null'), r);
    executeAction(s2t('select'), d, DialogModes.NO);
    (d1 = new ActionDescriptor()).putObject(s2t("resetTime"), s2t("timecode"), new ActionDescriptor());
    executeAction(s2t("moveOutTime"), d1, DialogModes.NO);
    (d = new ActionDescriptor()).putInteger(s2t("seconds"), 2);
    d.putInteger(s2t("frame"), -1);
    d.putDouble(s2t('frameRate'), frameRate);
    (d1 = new ActionDescriptor()).putObject(s2t("timeOffset"), s2t("timecode"), d);
    executeAction(s2t("moveOutTime"), d1, DialogModes.NO);
}

 

Translate
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
Participant ,
Dec 10, 2022 Dec 10, 2022

Thank you!

Translate
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
New Here ,
Aug 27, 2024 Aug 27, 2024

Im trying to do the same but go from 12fps to 8fps and have all the frames have a length of 1. how would I edit the script to do that?

Translate
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
Mentor ,
Aug 28, 2024 Aug 28, 2024

The script works if you use the video timeline mode. I admit that it may not handle all possible cases, since I only considered the situation described by the author of the topic.
Show a screenshot of your timeline, perhaps this will help to understand what the problem is.

Normally, it is enough to change this line of code and set the desired number of seconds for the selected frames:

 

(d = new ActionDescriptor()).putInteger(s2t("seconds"), 8);

 

Translate
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
New Here ,
Feb 06, 2025 Feb 06, 2025

Hi! I really don't know how to put the lines of code in photoshop. Is there a jsx. file i could use? Would make it much simpler

Translate
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 ,
Feb 06, 2025 Feb 06, 2025
LATEST
quote

Hi! I really don't know how to put the lines of code in photoshop. Is there a jsx. file i could use? Would make it much simpler


By @micha�l_4585

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

 

Adobe Photoshop Script Installation Location

Scripts are installed in the /Presets/Scripts folder

Mac OS Example:

  • /Applications⁩/Adobe Photoshop CC 2019⁩/Presets⁩/Scripts
  • /Applications/Adobe Photoshop 2021/Presets/Scripts
 
(If this path does not match your version, it should be a simple enough process to find the correct folder using this guide)

Win OS Example:
  • C:\Program Files\Adobe\Adobe Photoshop CC 2018\Presets\Scripts
  • C:\Program Files\Adobe\Adobe Photoshop 2021\Presets\Scripts
 
(If this path does not match your version, it should be a simple enough process to find the correct folder using this guide)
 
NOTE: If running, Adobe Photoshop must be quit and restarted for newly added scripts to become accessible.

Alternatively, select File > Scripts > Browse and navigate to the script file. Scripts recorded into an Action via the Browse command will record the entire absolute path to the script, often making them unsuitable for use on multiple computers. Installed scripts will only record the script name into an Action, which is the better option for Actions that will be installed on multiple computers.
 
William Campbell has videos on how to install scripts here:

Further information at the Adobe site:
https://helpx.adobe.com/photoshop/using/scripting.html
Translate
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