FCurveKey.Value

Description

Sets or returns the value of the fcurve key as a Variant. The fcurve key value is returned as follows:

- Standard fcurves: double (VT_R8)

- Raw fcurves: double (VT_R8)

- Integer fcurves: LONG (VT_I4)

- Boolean fcurves: variant bool (VT_BOOL,VARANT_TRUE,VARIANT_FALSE)

Note: If you are setting the key value the value will be clamped within the range defined by the FCurve.LowClamp and the FCurve.HighClamp values.

C# Syntax

// get accessor

Object rtn = FCurveKey.Value;

// set accessor

FCurveKey.Value = Object;

Examples

1. JScript Example

/*

	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 Example

'

' 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 Example

#

# 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