FCurve.SI3DStyle

導入

v3.0

詳細

F カーブの Mmt1306プロパティをBooleanとして設定したり、戻したりします(SI3DStyle の場合は true)。F カーブが SI3DStyleとして設定されている場合、キータンジェントは SI3Dタンジェントコンストレイントを使用して拘束されます。この拘束により、すべてのキータンジェントにおいて、スロープの長さの水平コンポーネントが2 つの連続するキー間の距離の 1/3になります。さらに、調整タンジェント定数(siFCurveKeyConstraint)がオフになります。既存の F カーブを SI3Dスタイルを使用して変更する場合は、タンジェントはすべて SI3Dタンジェントコンストレイントに一致するよう調整されます。

SI3D スタイルは標準 F カーブ(FCurve.Type == siStandardFCurve)にのみ適用できます。このプロパティを他の F カーブタイプに設定するとメソッドは C++の S_FALSE を戻し、SI3DStyle を取得すると常に VARIANT_FALSE を戻します。

1. VBScript の例

'
'       This example illustrates how to create an fcurve with
'       the SI3D style for constraining tangents.
'
set o = getprim( "Null" )
set fc = o.posx.addfcurve()
fc.setkeys( Array(1,50,50,0,100,50) )
fc.si3dstyle = true
' Get the object as though it was selected and get the fcurve 
' on its local.posx parameter
set o = selection(0)
set fc = o.posx.source
if fc.si3dstyle then
        LogMessage "fcurve has SI3D style of tangent constraints."
end iF
' Outputs:
'INFO : fcurve has SI3D style of tangent constraints.

2. JScript の例

/*
        This example illustrates how to create an fcurve with
        the SI3D style for constraining tangents.
*/
// Create a null
Application.NewScene( "", false );
var nullobj = ActiveSceneRoot.AddNull();
// Get the posx, posy parameters from the null
var posx = nullobj.posx;
var posy = nullobj.posy;
// Create an fcurve on posx, posy
var fc1 = posx.AddFCurve();
var fc2 = posy.AddFCurve();
// Define the number of keys
var nbkeys = 100;
// Start editing the fcurves
fc1.BeginEdit();
fc2.BeginEdit();
// Set the style of fc1 to SI3D style
fc1.SI3DStyle = true;
var tangents = new Array( nbkeys * 4 );
// Add keys to the fcurve
for ( i=0, j=0; i<nbkeys; i++, j+=4 )
{
        val = (Math.cos( (i+1)/10 ) * 100);
        fc1.AddKey( i, val );
        fc2.AddKey( i, val );
        tangents[j] = 0;
        tangents[j+1] = 0;
        tangents[j+2] = 0;
        tangents[j+3] = 0;
}
// Set the tangent to zero to illustrate the difference 
// between the Softimage & SI|3D styles
fc1.SetKeyTangents(tangents);
fc2.SetKeyTangents(tangents);
// End editing the fcurve and put undo event onto the
// undo/redo stack
fc1.EndEdit();
fc2.EndEdit();
// Print the key tangents from both curves to compare
var key1;
var key2;
for ( i=0; i<nbkeys; i++ )
{
        key1 = fc1.GetKeyAtIndex(i);
        key2 = fc2.GetKeyAtIndex(i);
        str = "fc1: " + key1.lefttanx + ","+ key1.lefttany + ","+ key1.righttanx + ","+ key1.righttany;
        str += " fc2: " + key2.lefttanx + ","+ key2.lefttany + ","+ key2.righttanx + ","+ key2.righttany;
        LogMessage(str);
}
// Outputs:
//INFO : fc1: 0,0,0.3333333333333333,0 fc2: 0,0,0,0
//INFO : fc1: -0.33333333333333326,0,0.33333333333333326,0 fc2: 0,0,0,0
//INFO : fc1: -0.33333333333333326,0,0.3333333333333335,0 fc2: 0,0,0,0
//      etc.
//INFO : fc1: -0.3333333333333343,0,0.3333333333333343,0 fc2: 0,0,0,0
//INFO : fc1: -0.3333333333333343,0,0.3333333333333343,0 fc2: 0,0,0,0
//INFO : fc1: -0.3333333333333343,0,0,0 fc2: 0,0,0,0