OffsetValueMap

Introduced

v1.0

Description

Offsets the value map for a clip. One action item must be active at the specified global time. Offsetting actions is a task that you will probably perform frequently. For example, you may need to offset an action in local space so that the animation occurs in a different location from where it was originally defined.

Scripting Syntax

OffsetValueMap( [InputObjs], [Type], [Time], [Value] );

Parameters

Parameter Type Description
InputObjs String List of animatable parameters

Default Value: Current marked and selected objects

Type siEffectInputType Type of input we expect

Default Value: siSelectedParams

Possible Values:

Description:

siSelectedParams Handle selected parameters (InputObjs should be a list of params)
siAllParamsInClip Handle all parameters in clip (InputObjs should be a clip)
siPoseOffsetClip Compute a pose offset for clip (InputObjs should be a clip)
Time Double Frame number.

Default Value: Current frame.

Value Number Offset value

Default Value: Current value for each parameter. Use of this argument is rare.

Examples

VBScript Example

' Create an animation with a cone translated along the x axis

set oCone = CreatePrim( "Cone", "MeshSurface" )

SaveKey oCone & ".kine.local.posx", 5, 0

SaveKey oCone & ".kine.local.posx", 30, 5 

set oAction = StoreAction( oCone, "/kine.local.pos", 2, "testStoredAction" )

AddClip "Scene_Root", oAction, , , 10

' See what value of the x translation we get at frame 20

' with the original clip.

actualVal = GetValue( oCone & ".kine.local.posx", 20 )

LogMessage "Pre-offset, posx is: " & actualVal

' Offset the translation in x. Starts further from the left

OffsetValueMap oCone & ".kine.local.posx", siSelectedParams, 20, -5

' Confirm that indeed at frame 20 the result (using the

' offset we just set) is what we told it to be: -5.

actualVal = GetValue( oCone & ".kine.local.posx", 20 )

if abs( actualVal - -5 ) < 1e-9 then

	LogMessage "Expected -5 and got it...the universe makes sense!"

else

	LogMessage "Expected -5, but got " & actualVal

end if

See Also

SaveActionKey