FCurve.Selected

導入

v6.0

詳細

FCurveの選択されている状態を示すBoolean値を戻します(選択されている場合は true)。F カーブが選択されている場合は、選択されているキーが含まれることがあります。キーが何も選択されていない場合は、F カーブ全体が選択されているものとして扱われます。

JScript の例

/* 
        This example illustrates how to print selected key information
*/
// Create a new scene
NewScene(null, false);
// Create a null
oNull = Application.GetPrim("Null");
// Get the posx parameter of the null
oPosX = oNull.posx
// Create array of time-value pairs
aKeys = new Array( 0.00, 5.00,
                                1.00, 6.00,
                                2.00, 7.00,
                                3.00, 8.00,
                                4.00, 9.00,
                                5.00, 10.00 );
// Create an empty FCurve
oFCurve = oPosX.AddFCurve2( null, siStandardFCurve );
// Set the fcurve keys
oFCurve.SetKeys( aKeys );
// Select some keys
SelectKeysInTimespan(oPosX, siSetKeySelection, 2, 4, siInputParameters);
// Get selected fcurves
oFCurves = Application.FCurveSelection;
// Print selected key information
for (var i = 0; i < oFCurves.Count; i++) 
{
        var keys = oFCurves(i).SelectedKeys;
        var msg = 'FCurve ' + i + ' has ' + keys.count + ' keys selected';
        if (keys.Count > 0)
        {
                msg += ' at frames: [';
                for (var j = 0; j < keys.Count; j++) 
                {
                        if ( j > 0 ) { msg += ', '; }
                        msg += keys(j).Time;
                }
                msg += ']';
        }       
        Application.LogMessage( msg, siInfo );
}
// Produces the following output:
//
//INFO : FCurve 0 has 3 keys selected at frames: [2, 3, 4]

関連項目

FCurve.SelectedKeys FCurveKey.Selected XSIApplication.FCurveSelection SelectKeysInTimespan