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

How to get animation frame ID?

Explorer ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

Hello!

I'm trying to get identifiers of frames on the timeline panel (Frame animation mode).

I see, that they are stored inside Image Resource Section of PSD file.

Resource ID is 4000 (0x0fa0) which is supposed to be used by plug-ins.

But I can't figure out how to get them using javascript or OLE-automation. Is it possible?

And if not, is it possible to read them from C/C++ plug-in and send to javascript?

TOPICS
Actions and scripting

Views

709

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
Adobe
Guide ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

Votes

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
Explorer ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

That works with video timeline only. For frame animation there is "animationClass" and "animationFrameClass" and I know how to select frames and get/set delays, but not the ID.

Votes

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
Guide ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

Would this work to get the current frame selected?

function currentFrameNumber(){

   var ref = new ActionReference();

   ref.putProperty( charIDToTypeID('Prpr') , charIDToTypeID('NmbL'))

   ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );

   var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;

backGround = activeDocument.artLayers[activeDocument.artLayers.length - 1].isBackgroundLayer ? 0 : 1;

   for(i=backGround; i<count; i++){

        ref = new ActionReference();

        ref.putIndex( charIDToTypeID( 'Lyr ' ), i );

        var desc = executeActionGet(ref);

        var adjustment = false;

        if(desc.getBoolean(stringIDToTypeID('visible'))) return i;

   }

};

alert(currentFrameNumber());

Votes

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
Explorer ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

LATEST

No.

Unfortunately, your code works with layers, not animation frames. And in my case it always returns 1, because all my layers are visible on every animation frame.

It's pretty popular approach when for every animation frame there is only one visible layer. But it's not my case.

Yet again, I'm looking for a way to get persistent identifier of animation frame. It is stored inside PSD file. There is a descriptor with CharID 'AnDs' with list 'FrIn' which contains frame ids with key 'FrID'.

I can easily parse them from psd file, but I need them at runtime even from a document that is not saved yet.

Votes

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
Contributor ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

Is there a way to get the current timeline frame number in Frame Animation mode?
.

I had this same question a while ago. But no real solution exists as I know.

If You are in an extension panel, You can listen to JSONEvents from PS. One of these events is SELECT which is mirroring Timeline frame changes:


{"_obj":"select","null":{"_index":1,"_ref":"animationFrameClass"}}

But You still don't know which is the actual frame when You open or switch to a fresh .psd.

Votes

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