Object Hierarchy | Related C++ Class: Delta
Delta
v6.0
The Delta object represents a 'diff' or list of modifications to a reference model. These are grouped into
types of changes called ActionDeltas, which have a unique type similar to the
Parameter.Source type (see siModificationDeltaType) and changes to
Overrides (which are stored in a parameter called 'PropertiesAddedToRefModel' under the Delta property), etc.
Modifications stored in an override are used to save static modifications, such as a new material.
Modifications stored in an ActionDelta are related to animation, such as FCurves,
Constraints, etc.
Delta properties are stored under the model and each model can only have one delta associated to it, so to
access a delta, use the Dictionary.GetObject method (for example,
'var myDelta = Dictionary.GetObject("MyRefModel.Delta");'.
There are three ways to create deltas on a reference model:
(1) When the user makes a change to a value or source on a parameter in a reference model, a new Delta is
automatically created containing an ActionDelta with the ActionDeltaItem to store the change.
(2) Add an empty Delta using the AddDelta command.
(3) Import a delta using the ImportDelta or ImportReferencedDelta commands.
/* 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 |