Object Hierarchy | 関連する C++クラス:ActionDelta
ActionDelta
v6.0
ActionDelta オブジェクトは、リファレンスモデルの一部であるパラメータに加えられた変更を追跡します。すべての ActionDelta には、1 つまたは複数の ActionDeltaItem(それぞれが参照されるパラメータへの 1 つの変更を表す)が含まれます。各 ActionDelta オブジェクトは特定のタイプ(siModificationDeltaTypeを参照)に設定されており、その中に含まれる各 ActionDeltaItem も同じタイプになります。
ActionDeltas はDelta(ActionDeltaCollection)に格納されており、Delta.ActionDeltas プロパティを使用してアクセスできます。既存のデルタプロジェクトに新しい ActionDelta を追加する場合は、Delta.AddActionを使用します。
| AddConstraintItem | AddExpressionItem | AddFCurveItem | AddStaticValueItem |
IsClassOf | IsEqualTo | RemoveAllItems | RemoveItem |
/*
This example demonstrates how to add an ActionDeltaItem of type siModificationDeltaConstraint 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 );
// Create a cone
var oCone = oRoot.AddGeometry("Cone","MeshSurface");
Translate(oCone, 3.20, 0.00, 1.65, siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
// Add the Delta object
var oDelta = AddDelta(oCube.Model);
// Add an action of type siModificationDeltaConstraint
var oActionDelta = oDelta.AddAction(siModificationDeltaConstraint);
// Add the fcurve item
var oActionDeltaItems = oActionDelta.AddConstraintItem("Position",oCube,oCone);
for(var i=0; i<oActionDeltaItems.Count; i++) {
Application.LogMessage ( " The item " + oActionDeltaItems(i).Name + " is active: " + oActionDeltaItems(i).Mute );
}
// Apply modification
oDelta.Apply();
// Output of above script:
//INFO : The item cube.kine.global.sclx is active: true
//INFO : The item cube.kine.global.scly is active: true
//INFO : The item cube.kine.global.sclz is active: true
//INFO : The item cube.kine.global.rotx is active: true
//INFO : The item cube.kine.global.roty is active: true
//INFO : The item cube.kine.global.rotz is active: true
//INFO : The item cube.kine.global.posx is active: false
//INFO : The item cube.kine.global.posy is active: false
//INFO : The item cube.kine.global.posz is active: false |
/*
This example demonstrates how to get the type of the item.
*/
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 siModificationDeltaStaticValue
var oDeltaAction = oDelta.AddAction(siModificationDeltaStaticValue)
// Add a static value item
oDeltaAction.AddStaticValueItem ( oCube + ".kine.global.posx", 10 );
// Get the first ActionDeltaItem in the first ActionDelta
var oActionDelta = oDelta.ActionDeltas(0);
// Print the type
Application.LogMessage(oActionDelta.Type);
// Output of above script:
//INFO : siModificationDeltaStaticValue |