• 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 CS4 animation timeline data

New Here ,
Aug 10, 2010 Aug 10, 2010

Copy link to clipboard

Copied

I'd like to write a plugin that makes use of Photoshop CS4 animation timeline data but, after much searching through the SDK, I haven't been successful at locating any examples or documentation defining how to get at this information.  Is this data exposed?  If so, can someone kindly point me to the appropriate location.

Thank you.

TOPICS
SDK

Views

1.8K

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
New Here ,
Aug 16, 2010 Aug 16, 2010

Copy link to clipboard

Copied

I started taking a look at trying to get at this data through the .psd file directly using the Photoshop File Formats.pdf that Tom posted in the "psd and psb File Format Specifications" thread as I'm making the assumption this is unexposed since I've still not found any mention to it within the SDK and no one has replied yet.  If someone knows otherwise or can confirm this assumption I'd be much appriciative.  However, it appears that the appropriate chunk isn't described at all within the file format spec.  Perhaps this isn't surprising given the 2007 date of the documentation.  Though it seems even much of the described chunks are also missing format information.

Is there a more recent version that we can request, and is there an appropriate contact that we should inquire with?

Based on some experimentation between binary dumps of .psd files and building together a simple and very incomplete .psd parser from the file Tom provided it appears that the data I'm looking for resides within the Layer and Mask Information section contained within a chunk with the 8BIM identifier of AnDs.  From a cursory look at the data around this it appears to have some similarities in structure to the partially described Action .ATN file format at the end of the document.

Can anyone from Adobe or otherwise point me to format information for the 'AnDs' chunk or is there at least a more complete specification for the Action .atn files since they appear to share similar subchunk types?

I'm also missing mention of the following Image resource chunks (though this seems unrelated):

0xfa0, 0xfa1, 0xfa2, 0xfa3, 0xfa4

Thank you.

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
Adobe Employee ,
Aug 17, 2010 Aug 17, 2010

Copy link to clipboard

Copied

Sorry the documentation is incomplete for you. Most of the "descriptor" format is details for each descriptor are undocumented but the descriptor format is key / value pairs with information about the type for each key. What I like to call 'self' documenting. (It all depends on your definition of 'self' documenting I suppose.) Here is some more information for you. Look in PIStringTerminology.h for the key constants.

const uint32 kAnimationDescriptorKey = 'AnDs';

PActionDescriptor animationDict = TActionDescriptor::Make ();
animationDict->PutInteger( kactiveFrameSetIDStr, fRep->mActiveFrameSetID );
int32 numFrameSets = GetFrameSetCount();

//Write all the frames in all frame sets in one array (they may be shared among frame sets)

//Problem with using active frame for defaults is that we don't know what the active
//frame is before we read it, So use default FrameInfo.

FrameInfo defaultFrameInfo; //  = GetActiveFrame();

{
PActionList framesArray = TActionList::Make ();
set<FrameID> writtenFrames; //check to see if there are any unused frames...

for (int32 frameSetIndex = 0 ; frameSetIndex < numFrameSets; frameSetIndex++)
{
  FrameSetID frameSetID = GetNthFrameSetID(frameSetIndex);
  int32 numFrames = GetFrameCount(frameSetID);

  for (FrameIndexT frameIndex = 0; frameIndex < numFrames; frameIndex++)
  {
   FrameInfo frameInfo = GetFrame(frameIndex, frameSetID); //Caller of StoreAnimation. needs to do UpdateActiveFrame.

   if (writtenFrames.find(frameInfo.GetFrameID()) == writtenFrames.end())
   {
    PActionDescriptor frameDict = FrameInfo::Store(frameInfo, defaultFrameInfo);
    framesArray -> PutObject (frameDict);
    writtenFrames.insert(frameInfo.GetFrameID());
   }
  }
}
animationDict->PutList(kframeInfoStr, framesArray );
}


//Write the frame sets (arrays of frame ids)
{
PActionList frameSetsArray = TActionList::Make ();
 
for (int32 frameSetIndex = 0 ; frameSetIndex < numFrameSets; frameSetIndex++)
{
  FrameSetID frameSetID = GetNthFrameSetID(frameSetIndex);
  FrameIndexT activeFrameIndex = GetActiveFrameIndex(frameSetID);
  int32 numFrames = GetFrameCount(frameSetID);
  PActionDescriptor frameSetDict = TActionDescriptor::Make ();
  PActionList  framesArray = TActionList::Make ();

  for (FrameIndexT frameIndex = 0; frameIndex < numFrames; frameIndex++)
  {
   FrameID frameID = GetFrame(frameIndex, frameSetID).GetFrameID(); //Caller of StoreAnimation. needs to do UpdateActiveFrame.
   framesArray->PutInteger ( frameID );
  }

  frameSetDict->PutInteger(kframeSetIDStr, frameSetID );
  frameSetDict->PutInteger(kactiveFrameIndexStr, activeFrameIndex );
  frameSetDict->PutList(kframesStr, framesArray );
  frameSetDict->PutInteger(kloopCountStr, GetLoopCount(frameSetID) );
  
  frameSetsArray->PutObject( frameSetDict );
}

animationDict->PutList(kframeSetsStr, frameSetsArray );
}

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
Community Beginner ,
Sep 28, 2018 Sep 28, 2018

Copy link to clipboard

Copied

LATEST

Hi Tom Ruark.

I'm sorry for hijacking this thread 8 years later, but...

Can you help me with my post? Where exactly Photoshop stores timeline data on a PSD file?

I'm short of some details of how the ImageResource blocks 0x0FA0 and 0x0FA1 works and how I can interpret them.

Also, inside the AdditionalLayerInfo there's the shmd (metadata) chunk with two other chunks inside, mlst and cust.

Thanks.

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