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 ); }
... View more