Delta.AddAction メソッドで作成された ActionDelta にタイプ siModificationDeltaFCurves の新しい ActionDeltaItem を追加します。
ActionDelta のタイプは siModificationDeltaFCurves である必要があります(ActionDelta タイプのリストについては「siModificationDeltaType」を参照)。
ActionDeltaItem ActionDelta.AddFCurveItem( Object in_vTarget, Object in_KeyValueArray, Object in_vInterpolation, Object in_vType, Object in_vExtrapolation ); |
oReturn = ActionDelta.AddFCurveItem( Target, [KeyValueArray], [Interpolation], [Type], [Extrapolation] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| Target | String | ソース項目のターゲットパス |
| KeyValueArray | キーデータのArray | 配列には 1D 配列または 2D 配列を使用できます。2D 配列では、最初の次元でキーの値を定義する必要があります。補間型 siCubicInterpolation(siFCurveInterpolationを参照)の F カーブではキーごとに 6 つの値が含まれ、他の補間型の F カーブでは 2 つの値が含まれます。最初の値はキーの時間(フレーム)で、2 番目の値はキーの値(値単位)です。キュービック(ベジェ)F カーブの場合、残りの 4 つの値はタンジェンシ値です。lefttanx(フレーム)、lefttany(値単位)、righttanx(フレーム)、righttany(値単位)。 |
| Interpolation | siFCurveInterpolation |
F カーブの補間 デフォルト値:siCubicInterpolation |
| Type | siFCurveType |
F カーブのタイプ デフォルト値:siStandardFCurve |
| Extrapolation | siFCurveExtrapolation |
F カーブのエクストラポレーション デフォルト値:siConstantExtrapolation |
/*
This example demonstrates how to add an ActionDeltaItem of type
siModificationDeltaFCurves to a ActionDelta.
*/
NewScene (null, false);
// Create a reference model from a cube
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oCube = oRoot.AddGeometry("Cube", "MeshSurface");
var emdlFileRefModel = XSIUtils.BuildPath(Application.InstallationPath(siProjectPath), "Models", "MyModel.emdl");
CreateModelAndConvertToRef(oCube, emdlFileRefModel);
// Add the Delta object
var oDelta = AddDelta(oCube.Model);
// Add an action of type siModificationDeltaFCurves
var oDeltaAction = oDelta.AddAction(siModificationDeltaFCurve);
// Set the array
var aKeyData = Array
(
1.00, 5.00, 0, 0, 0, 0,
100.00, 8.00, 0, 0, 0, 0
);
// Add the fcurve item
var oActionDeltaItem = oDeltaAction.AddFCurveItem(oCube + ".kine.global.posx", aKeyData);
// Apply modification
oDelta.Apply(); |