FCurveKey.Time

説明

F カーブキーの時間(フレーム)を設定したり、戻したりします。F カーブキーの時間(フレーム)は、double(VT_R8)として戻されます(Variant を参照)。

キーの時間を設定すると、キーがその時間に移動します。F カーブが標準F カーブの場合は、タンジェントが自動的に調整されます。

C#構文

// get accessor

Object rtn = FCurveKey.Time;

// set accessor

FCurveKey.Time = Object;

1. JScript の例

/*

	This example illustrates how to set a fcurve key's time by creating a null with 

	its local.posx parameter driven by an fcurve 

*/

NewScene( null, false );

// Create a null

var n = Application.ActiveSceneRoot.AddNull();

// Get the posx parameter

var posx = n.posx;

// Create an fcurve on posx

var fc = posx.AddFCurve();

// Define some keys

var keyvalues = new Array( 0,0, 50,25, 100,50 );

// Set the keys

fc.SetKeys( keyvalues );

// Get 2nd key and set the key time

var fckey = fc.Keys(1);

Application.LogMessage( "fckey.Time before = " + fckey.Time );

fckey.Time = 51;

Application.LogMessage( "fckey.Time after = " + fckey.Time );

// Expected results:

//INFO : fckey.Time before = 50

//INFO : fckey.Time after = 51

2. VBScript の例

'

' This example illustrates how to set a fcurve key's time by creating a null with 

' its local.posx parameter driven by an fcurve 

'

NewScene , false 

' Create a null

set n = Application.ActiveSceneRoot.AddNull()

' Get the posx parameter

set posx = n.posx

' Create an fcurve on posx

set fc = posx.AddFCurve()

' Define some keys

keyvalues = array( 0,0, 50,25, 100,50 )

' Set the keys

fc.SetKeys keyvalues 

' Get 2nd key and set the key time

set fckey = fc.Keys(1)

Application.LogMessage "fckey.Time before = " & fckey.Time 

fckey.Time = 51

Application.LogMessage "fckey.Time after = " & fckey.Time 

' Expected results:

'INFO : fckey.Time before = 50

'INFO : fckey.Time after = 51

3. Python の例

#

# This example illustrates how to set a fcurve key's time by creating a null with 

# its local.posx parameter driven by an fcurve 

#

Application.NewScene( "", 0 )

# Create a null

n = Application.ActiveSceneRoot.AddNull()

# Get the posx parameter

posx = n.posx

# Create an fcurve on posx

fc = posx.AddFCurve()

# Define some keys

keyvalues = [ 0,0, 50,25, 100,50 ]

# Set the keys

fc.SetKeys( keyvalues )

# Get 2nd key and set the key time

fckey = fc.Keys(1)

Application.LogMessage( "fckey.Time before = " + str(fckey.Time) )

fckey.Time = 51

Application.LogMessage( "fckey.Time after = " + str(fckey.Time) )

# Expected results:

#INFO : fckey.Time before = 50.0

#INFO : fckey.Time after = 51.0