Selected (FCurveKey)

Introduced

6.0

Description

Returns the selected state of the FCurve key as a Boolean.

Note: A key is only considered selected if the fcurve is also selected."

C# Syntax

    // get accessor
    Boolean rtn = FCurveKey.Selected;

Examples

JScript Example

    //
    // 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).Keys;
       Application.LogMessage( 'FCurve ' + i + ':', siInfo );
       if (oFCurves(i).SelectedKeys.count > 0)
       {
           for (var j = 0; j < keys.Count; j++)
           {
              if ( keys(j).Selected )
              {
                  Application.LogMessage( '  key ' + j + ' is selected', siInfo );
              }
              else
              {
                  Application.LogMessage( '  key ' + j + ' is not selected', siInfo );
              }
           }
       }
           }

    // Produces the following output:
    //
    //INFO : FCurve 0:
    //INFO :   key 0 is not selected
    //INFO :   key 1 is not selected
    //INFO :   key 2 is selected
    //INFO :   key 3 is selected
    //INFO :   key 4 is selected
    //INFO :   key 5 is not selected

See Also

FCurve.Selected | FCurve.SelectedKeys | XSIApplication.FCurveSelection | SelectKeysInTimespan

Autodesk Softimage v7.5