Is there anyway to identify keyframe of timeline animation using JSX script?
I need to retrieve animation data of keyframes( Only keyframes ) of video animation
I am using following code to iterate timeline. But still, I couldn't identify keyframes
Is there any way to identify keyframes?
function gotoFrame(Seconds, Frame, frameRate) {
var desc69 = new ActionDescriptor();
var ref33 = new ActionReference();
ref33.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('time'));
ref33.putClass(stringIDToTypeID('timeline'));
desc69.putReference(charIDToTypeID('null'), ref33);
var desc70 = new ActionDescriptor();
desc70.putInteger(stringIDToTypeID('seconds'), Seconds);
desc70.putInteger(stringIDToTypeID('frame'), Frame);
desc70.putDouble(stringIDToTypeID('frameRate'), frameRate);
desc69.putObject(charIDToTypeID('T '), stringIDToTypeID('timecode'), desc70);
executeAction(charIDToTypeID('setd'), desc69, DialogModes.NO);
};
unction getCurrentFrame() {
try {
var ref = new ActionReference();
ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('currentFrame'));
ref.putClass(stringIDToTypeID('timeline'));
var desc = new ActionDescriptor();
desc.putReference(charIDToTypeID('null'), ref);
var TC = executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);
return TC.getInteger(stringIDToTypeID('currentFrame'));
} catch (e) { return null; }
};
function getTimelineLength() {
var ref = new ActionReference();
ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('duration'));
ref.putClass(stringIDToTypeID('timeline'));
var desc = new ActionDescriptor();
desc.putReference(charIDToTypeID('null'), ref);
var TC = executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);
TC = TC.getObjectValue(stringIDToTypeID('duration'));
var M = 0;
try { M = TC.getInteger(stringIDToTypeID('minutes')); } catch (e) { }
var S = 0;
try { S = TC.getInteger(stringIDToTypeID('seconds')); } catch (e) { }
var F = TC.getInteger(stringIDToTypeID('frame'));
var FR = TC.getInteger(stringIDToTypeID('frameRate'));
var A = new Array();
A.push([,
return A;
}
var timeLineLenth = getTimelineLength();
var doc = activeDocument;
for (var i = 0; i <= timeLineLenth[0][1]; i++) {
for (var j = 0; j < timeLineLenth[0][3]; j++) {
gotoFrame(i, j, 30);
var a = getCurrentFrame();
}
}
