En keksinyt siistiä tapaa määrittää key interpolaatiota keyfreimatessa. Pidin parempana ratkaisuna key kohtaista interpolaatiota kuin koko curven. Interpolaatioon näytti pääsevän käsiksi SDK:n mukaan, mutta alkoi mennä hankalaksi joten päädyin oikotiehen. Silti jos joku keksii elegantimman tavan määrätä keytä asettaessa, kuulisin mielelläni. On sellainen olo että pitäisi mennä muutamalla rivillä.
//ConstantKeyer
//keys prefix c_ as constant for blocking
//TODO: Slider for constant,linear, spline key. Check for nested models.
//Mikko Ronkainen aka nRatio 2008.
{
//Get Model
var oRoot = ActiveSceneRoot
var oSelection = oRoot.Application.selection;
var oModel = SIGetModel (oSelection);
logmessage (oModel)
//Collection
var oColl = XSIFactory.createobject( "XSI.Collection" );
oColl.items = oModel.FindChildren("c_*");
logmessage (oColl)
//get preferences
var oKeyins = GetValue("preferences.animation.keyinsert");
var oUsekey = GetValue("preferences.animation.usekeyprefs");
var oSavekey = GetValue ("preferences.animation.save_key_command");
logmessage( oKeyins )
logmessage( oUsekey )
SetValue("preferences.animation.usekeyprefs", 1, null);
SetValue("preferences.animation.keyinsert", 1, null);
SetValue("preferences.animation.save_key_command", 0, null);
// Key Collection
SetKeyUsingMarkingSet(oColl,null);
//reset preferences
SetValue("preferences.animation.keyinsert", oKeyins, null);
SetValue("preferences.animation.usekeyprefs", oUsekey, null);
SetValue("preferences.animation.save_key_command", oSavekey);
}
Mikko