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

Get frame animation Loop Info

New Here ,
May 22, 2017 May 22, 2017

Copy link to clipboard

Copied

I am writing a script that exports the frame animation information from Photoshop timeline to a json file our game can load.  I have it exporting the frame order, names and delays just fine now, but I can't find a way to access whether the entire animation is set to loop once, 3 times, forever, etc.  I have seen some scripts on how to set the loop count, but nothing about how to read it?

Much thanks for any help!

TOPICS
Actions and scripting

Views

370

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

correct answers 1 Correct answer

Community Expert , May 23, 2017 May 23, 2017

#target photoshop

alert (getAnimationLoopCount ());

////// get framedelay //////

function getAnimationLoopCount (theIndex) {

var ref = new ActionReference(); 

ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationLoopCount')); 

ref.putEnumerated(stringIDToTypeID('animationClass'), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));

var desc=new ActionDescriptor(); 

desc.putReference(charIDToTypeID('null'), ref);          

var aaa = executeAction(charIDToTypeID('getd'), desc, DialogModes

...

Votes

Translate

Translate
Adobe
Community Expert ,
May 23, 2017 May 23, 2017

Copy link to clipboard

Copied

#target photoshop

alert (getAnimationLoopCount ());

////// get framedelay //////

function getAnimationLoopCount (theIndex) {

var ref = new ActionReference(); 

ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationLoopCount')); 

ref.putEnumerated(stringIDToTypeID('animationClass'), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));

var desc=new ActionDescriptor(); 

desc.putReference(charIDToTypeID('null'), ref);          

var aaa = executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);

return aaa.getInteger(stringIDToTypeID('animationLoopCount'))

};

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
New Here ,
May 23, 2017 May 23, 2017

Copy link to clipboard

Copied

LATEST

This works perfectly, thanks so much!!!!!

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