AddExpressionItem (ActionDelta)

Description

Adds a new ActionDeltaItem of type siModificationDeltaExpression to an ActionDelta created with the Delta.AddAction method.

The ActionDelta should be of type siModificationDeltaExpression to use this method (see siModificationDeltaType for a list of ActionDelta types).

Scripting Syntax

ActionDelta.AddExpressionItem( Target, Expression )

C# Syntax

ActionDeltaItem ActionDelta.AddExpressionItem( Object in_vTarget, Object in_vExpression );

Parameters

Parameter

Type

Description

Target

String

Target path for source item

Expression

String

The definition (formula) that defines the expression. For more information on how to define an expression, see Expression Reference).

Return Value

ActionDeltaItem

Examples

JScript Example

/*
   This example demonstrates how to add an ActionDeltaItem of type 
   siModificationDeltaExpression 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 the cube that also generate a delta
Translate(oCone , 3.0, 3.0, 0, 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 siModificationDeltaExpression
var oDeltaAction = oDelta.AddAction(siModificationDeltaExpression)

// Add the expression item
var oActionDeltaItem = oDeltaAction.AddExpressionItem(oCube + ".kine.global.posx",  "5*sin(" + oCone + ".kine.local.posx * 15)");

// Apply modification
oDelta.Apply();

See Also

ActionDelta.AddFCurveItem

ActionDelta.AddConstraintItem

ActionDelta.AddStaticValueItem



Autodesk Softimage v7.5