Object Hierarchy | 関連する C++クラス:Delta
Delta
v6.0
Delta オブジェクトは、リファレンスモデルへの変更のリストを表します。このオブジェクトは、ActionDelta と呼ばれる変更のタイプにグループ化されます。この変更のタイプには、Parameter.Source タイプ(siModificationDeltaType を参照)と似た独自のタイプや、オーバーライド(Delta プロパティの下の PropertiesAddedToRefModel パラメータに格納されている)への変更などがあります。
オーバーライドに格納された変更は、新しいマテリアルなどの静的な変更を保存するのに使用されます。
ActionDelta に格納された変更は、FCurve や Constraint などのアニメーションに関連します。
Delta プロパティはモデルの下に格納され、各モデルには関連付けられている1 つのデルタが含まれます。そのため、Delta にアクセスするには、Dictionary.GetObject メソッド(var myDelta = Dictionary.GetObject("MyRefModel.Delta");など)を使用する必要があります。
リファレンス モデルで Delta を作成するには、3 つの方法があります。
(1)リファレンス モデルのパラメータの値またはソースに変更を加えると、ActionDeltaItem と ActionDelta を含む新しい Delta が自動的に作成され、変更が保存されます。
(2) AddDelta コマンドを使用して空の Delta を追加します。
(3) ImportDelta または ImportReferencedDelta コマンドを使用して Delta を読み込みます。
/*
This example demonstrates how to display information about the delta
*/
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);
// Print delta information
Application.Logmessage(" Name: " + oDelta.Name);
Application.Logmessage(" Type: " + oDelta.Type);
Application.Logmessage(" Target reference model name: " + oDelta.Target);
// Output of above script:
//INFO : Name : Delta
//INFO : Type : model_delta
//INFO : Target reference model name : Model |