FCurveKey.Value

説明

F カーブキーの値を Variant として設定したり、戻したりします。F カーブ キー値は、次のように戻されます。

- 標準 F カーブ: Double (VT_R8)

- ロー F カーブ: Double (VT_R8)

- 整数 F カーブ: LONG (VT_I4)

- ブール F カーブ: Variant Bool (VT_BOOL,VARANT_TRUE,VARIANT_FALSE)

注: キー値を設定する場合、値は FCurve.LowClamp および FCurve.HighClamp 値で定義した範囲内に制限されます。

C#構文

// get accessor

Object rtn = FCurveKey.Value;

// set accessor

FCurveKey.Value = Object;

1. JScript の例

/*

	This example illustrates how to set the key value on a specific key. It also

	provides a demonstration of an alternative way to set an fcurve, by using the

	SaveKey command instead of Parameter.AddFCurveKey (as demonstrated in FCurveKey.Value)

*/

// Create scene with a null with an animated local.posx 

NewScene( null, false );

var n = Application.ActiveSceneRoot.AddNull();

SaveKey( "null.kine.local.posx", 1, 5.0 );

// Get the fcurve from the local.posx

var posx = n.posx;

var fc = posx.Source;

// Get the first key in the fcurve

var fckey = fc.Keys(0);

// Increment the value of the key by 1

Application.LogMessage( "Before modification: " + fckey.Value );

fckey.Value++;						// == fckey.Value = fckey.Value + 1;

Application.LogMessage( "After modification: " + fckey.Value );

// Expected results:

//INFO : Before modification: 5

//INFO : After modification: 6

2. VBScript の例

'

' This example illustrates how to set the key value on a specific key. It also

' provides a demonstration of an alternative way to set an fcurve, by using the

' SaveKey command instead of Parameter.AddFCurveKey (as demonstrated in FCurveKey.Value)

' 

' Create scene with a null with an animated local.posx 

NewScene , false

set n = Application.ActiveSceneRoot.AddNull()

SaveKey "null.kine.local.posx", 1, 5.0 

' Get the fcurve from the local.posx

set posx = n.posx

set fc = posx.Source

' Get the first key in the fcurve

set fckey = fc.Keys(0)

' Increment the value of the key by 1

Application.LogMessage "Before modification: " & fckey.Value 

fckey.Value = fckey.Value + 1

Application.LogMessage "After modification: " & fckey.Value 

' Expected results:

'INFO : Before modification: 5

'INFO : After modification: 6

3. Python の例

#

# This example illustrates how to set the key value on a specific key. It also

# provides a demonstration of an alternative way to set an fcurve, by using the

# SaveKey command instead of Parameter.AddFCurveKey (as demonstrated in FCurveKey.Value)

# 

# Create scene with a null with an animated local.posx 

Application.NewScene( "", 0 )

n = Application.ActiveSceneRoot.AddNull()

Application.SaveKey( "null.kine.local.posx", 1, 5.0 )

# Get the fcurve from the local.posx

posx = n.posx

fc = posx.Source

# Get the first key in the fcurve

fckey = fc.Keys(0)

# Increment the value of the key by 1

Application.LogMessage( "Before modification: " + str(fckey.Value) )

fckey.Value = fckey.Value + 1

Application.LogMessage( "After modification: " + str(fckey.Value) ) 

# Expected results:

#INFO : Before modification: 5.0

#INFO : After modification: 6.0