/*
	properyNXɃ\bh𑝐
	^[QbgL[𕡐郁\bh

	property.duplicateKey(index integer,time float)

	w肳ꂽL[w肳ꂽԈʒuɕ
	ȗ͕s ߂l͐VKL[Index
	ʌƕʐ̎ԂꍇAE[낵]ȂĂ݂
	ӖȂ̂łȂɂȂŖ߂Ƃɂ
*/
Property.prototype.duplicateKey=function(myIndex,myTime)
{
//vpeB^CvPROPERTY̍ۂ̂ݎs(قɂ̓L[Ȃ)
	if(this.propertyType!=PropertyType.PROPERTY){return false}
//sȂ珈s
	if((! myIndex)||(this.numKeys<myIndex)||isNaN(myTime)){return false;};
//w莞ԂƎwL[timelꍇ͏XLbv
	if(myTime==this.keyTime(myIndex)){return myIndex;};
//UndoGroup
	app.beginUndoGroup("L[t[");
//VL[쐬
	var newKeyIndex = this.addKey(myTime);
//ÂL[
	var oldKeyIndex = (newKeyIndex>myIndex)? myIndex:myIndex+1;
//l̕
	this.setValueAtKey(newKeyIndex,this.keyValue(oldKeyIndex));
//L[vpeB(܂?)
if(this.isSpatial)
{
	this.setTemporalContinuousAtKey(newKeyIndex,this.keyTemporalContinuous(oldKeyIndex));
	this.setTemporalAutoBezierAtKey(newKeyIndex,this.keyTemporalAutoBezier(oldKeyIndex));
	this.setSpatialTangentsAtKey(newKeyIndex,this.keyInSpatialTangent(oldKeyIndex),this.keyOutSpatialTangent(oldKeyIndex));//^[g
	this.setSpatialContinuousAtKey(newKeyIndex,this.keySpatialContinuous(oldKeyIndex));
	this.setSpatialAutoBezierAtKey(newKeyIndex,this.keySpatialAutoBezier(oldKeyIndex));
	this.setRovingAtKey(newKeyIndex,this.keyRoving(oldKeyIndex));//[rO
}
if(this.isInterpolationTypeValid(KeyframeInterpolationType.BEZIER))
{
	this.setTemporalEaseAtKey(newKeyIndex,this.keyInTemporalEase(oldKeyIndex),this.keyOutTemporalEase(oldKeyIndex));
	this.setInterpolationTypeAtKey(newKeyIndex,this.keyInInterpolationType(oldKeyIndex),this.keyOutInterpolationType(oldKeyIndex));//ԃ^Cv
}
	this.setSelectedAtKey(newKeyIndex,this.keySelected(oldKeyIndex));//I?
//O[v
	app.endUndoGroup();
//VL[̃CfbNXԂ
	return newKeyIndex;
};//
//Test	
app.project.activeItem.layer(1).position.duplicateKey(2,1.5);
