Delta.Apply

Description

Applies the Delta to a reference model. Use this method when you add modifications to a delta (for example, using the ActionDelta.AddFCurveItem method) and you want to apply those changes back to the reference model.

C# Syntax

Delta.Apply();

Scripting Syntax

Delta.Apply();

Examples

JScript Example

/*
	This example demonstrates how to apply modifications 
	contained in a 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);
// 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);
// Change the value of cube.kine.local.posx
oActionDeltaItem.Value = 5.0;
// To apply the modification
oDelta.Apply();

See Also

ApplyDelta