ActionDeltaItem

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

継承

SIObject

ActionDeltaItem

導入

v6.0

カテゴリ

Delta|Action|RefModel

詳細

ActionDeltaItem オブジェクトは、リファレンスモデルの一部であるパラメータに加えられた変更を追跡します。各 ActionDeltaItem は、参照されるパラメータへの 1 つの変更を表します。そのため、静的な値、F カーブ、コンストレイント、エクスプレッション、またはグループ関係に変更があるたびに、新しい ActionDeltaItem が生成されます。

ActionDelta.AddConstraintItemActionDelta.AddExpressionItemActionDelta.AddFCurveItem、またはActionDelta.AddStaticValueItemのいずれかのメソッドを使用して、データセットから新しい ActionDeltaItems を作成することもできます。

同じタイプ(「siModificationDeltaType」を参照)の ActionDeltaItem オブジェクトは、ActionDelta.Itemsプロパティを使用してアクセスできるActionDeltaActionDeltaItemCollection)に格納されます。

メソッド

IsClassOfオペレータ IsEqualToオペレータ    
       

プロパティ

Application AuditInfo Categories FullNameオペレータ
Help Mute Nameオペレータ NestedObjects
Origin OriginPath Parent Typeオペレータ
Value      
       

1. JScript の例

/*
        This example demonstrates how to assign a new value to an ActionDeltaItem
*/
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 );
// Translate the cube that also generate a delta
Translate(oCube, 2.0, 1.3, 0, siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
// Get the Delta object
var oDelta = Dictionary.GetObject("Model.Delta");
// Get the ActionDeltaItem collection of the first ActionDelta
var oActionDeltaItemsColl = oDelta.ActionDeltas(0).Items;
for (var i=0; i<oActionDeltaItemsColl.Count; i++) {
         // Print info about the current ActionDeltaItem
         Application.LogMessage("ActionSourceItem[" + i + "]");
         Application.LogMessage("Name: " + oActionDeltaItemsColl(i).Name)
         Application.LogMessage("Type: " + oActionDeltaItemsColl(i).Type)
         //Print the current value
         Application.LogMessage("Initiale Value: " +oActionDeltaItemsColl(i).Value)
         // Change the value of the item
         oActionDeltaItemsColl(i).Value = 1.2 * i
         // Print the new value
         Application.LogMessage("New Value: "+ oActionDeltaItemsColl(i).Value)
         Application.LogMessage("");
}
// Apply modification on the target reference asset container (the reference model)
oDelta.Apply()
// Output of above script:
//INFO : ActionSourceItem[0]
//INFO : Name: cube.kine.local.posx
//INFO : Type: siModificationDeltaStaticValue
//INFO : Initiale Value: 2
//INFO : New Value: 0
//INFO : 
//INFO : ActionSourceItem[1]
//INFO : Name: cube.kine.local.posy
//INFO : Type: siModificationDeltaStaticValue
//INFO : Initiale Value: 1.3
//INFO : New Value: 1.2
//INFO : 
//INFO : ActionSourceItem[2]
//INFO : Name: cube.kine.local.posz
//INFO : Type: siModificationDeltaStaticValue
//INFO : Initiale Value: 0
//INFO : New Value: 2.4
//INFO :

2. JScript の例

/*
        This example demonstrates how to set the name 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 the Static value item    
var oActionDeltaItem = oDeltaAction.AddStaticValueItem(oCube + ".kine.global.posx", 10);
// Get the relative name for the sclx parameter
var rp = GetRelativeNameForTarget(oCube.sclx);
// Replace posx parameter by sclx
oActionDeltaItem.name = rp;
// Apply modification on the target reference asset container (the reference model)
oDelta.Apply()
// Reload the reference model to reset cube.kine.local.posx value
UpdateReferencedModel("Model");
// Convenience function
function GetRelativeNameForTarget(in_param) {
        var mdlname = in_param.Model.FullName;
        if (mdlname == "Scene_Root") {
                return in_param.FullName;
        } else {
                var tmp = in_param.FullName;
                var re = new RegExp(mdlname + ".", "i");
                return tmp.replace(re, "");
        }
}

関連項目

ActionDelta ActionDelta.Items ActionDelta.AddFCurveItem ActionDelta.AddStaticValueItem ActionDelta.AddExpressionItem