FCurveKey

Object Hierarchy | 関連する C++クラス:FCurveKey

継承

SIObject

FCurveKey

導入

v1.0

詳細

FCurveKey は、FCurve 上のキーを表し、そのキーに関する情報へのアクセスや修正に使用されます。

注: F カーブの補間および外挿の詳細については、Softimage ユーザ ガイドの「F カーブの補間および外挿」を参照してください。

メソッド

GetConstraint2 IsClassOfオペレータ IsEqualToオペレータ Set

プロパティ

Application Categories Constraint FullNameオペレータ
Help Index Interpolation Left
LeftTanX LeftTanY Locked Nameオペレータ
NestedObjects Origin OriginPath Parent
Right RightTanX RightTanY Selected
Time Typeオペレータ Value  
       

1. JScript の例

/*

	This example demonstrates how to set an fcurve on the posx parameter

	and then how to access the keys through the FCurveKey object

*/

NewScene( null, false )

var oRoot = Application.ActiveProject.ActiveScene.Root;

var oNull = oRoot.AddNull();

var oPosX = oNull.posx;

// Create and connect an fcurve to the position x

var oFCurve = oPosX.AddFCurve2( new Array(1, 10, 50, 0, 100, 10) );

// Set the zero slopes on the key tangents

oFCurve.SetKeyTangents( new Array( 

	-10.5, 0, 10.5, 0, 

	-10.5, 0, 10.5, 0, 

	-10.5, 0, 10.5, 0 

));

// Get the keys on the fcurve

for ( var i=0; i<oFCurve.Keys.Count; i++ ) {

	var oFCKey = oFCurve.Keys(i);

	Application.LogMessage( "oFCKey[" + oFCKey.Index + "] at frame " + oFCKey.Time + " = " + oFCKey.Value );

}

// Expected results:

//INFO : oFCKey[0] at frame 1 = 10

//INFO : oFCKey[1] at frame 50 = 0

//INFO : oFCKey[2] at frame 100 = 10

2. VBScript の例

'

' This example demonstrates how to set an fcurve on the posx parameter

' and then how to access the keys through the FCurveKey object

'

set oRoot = Application.ActiveProject.ActiveScene.Root

set oNull = oRoot.AddNull

set oPosX = oNull.posx

' Create and connect an fcurve to the position x

set oFCurve = oPosX.AddFCurve2( Array( 1, 10, 50, 0, 100, 10 ))

' Set the zero slopes on the key tangents

oFCurve.SetKeyTangents( Array( _

	-10.5, 0, 10.5, 0, _

	-10.5, 0, 10.5, 0, _

	-10.5, 0, 10.5, 0 _

))

' Get the keys on the fcurve

for each oFCKey in oFCurve.Keys

	Application.LogMessage "oFCKey[" & oFCKey.Index & "] at frame " & oFCKey.Time & " = " & oFCKey.Value

next

' Expected results:

'INFO : oFCKey[0] at frame 1 = 10

'INFO : oFCKey[1] at frame 50 = 0

'INFO : oFCKey[2] at frame 100 = 10

3. Python の例

#

# This example demonstrates how to set an fcurve on the posx parameter

# and then how to access the keys through the FCurveKey object

#

Application.NewScene( "", 0 )

oRoot = Application.ActiveProject.ActiveScene.Root

oNull = oRoot.AddNull()

oPosX = oNull.posx

# Create and connect an fcurve to the position x

oFCurve = oPosX.AddFCurve2( [1, 10, 50, 0, 100, 10] )

# Set the zero slopes on the key tangents

oFCurve.SetKeyTangents( [ 

	-10.5, 0, 10.5, 0, 

	-10.5, 0, 10.5, 0, 

	-10.5, 0, 10.5, 0 

])

# Get the keys on the fcurve

for oFCKey in oFCurve.Keys :

	Application.LogMessage( "oFCKey[" + str(oFCKey.Index) + "] at frame " + str(oFCKey.Time) + " = " + str(oFCKey.Value) )

# Expected results:

#INFO : oFCKey[0] at frame 1.0 = 10.0

#INFO : oFCKey[1] at frame 50.0 = 0.0

#INFO : oFCKey[2] at frame 100.0 = 10.0

関連項目

FCurve.Keys FCurveKeyCollection FCurve