SavePivotKey

Categories

animation

Description

Key frames current values on pivot and pivot compensation parameters of the given S,R,T channels. The fcurves on pivot and pivot compensation have constant interpolation - pivot and pivot compensation require constant values to balance correctly.

Scripting Syntax

SavePivotKey( [InputObjs], [Type], [Time] );

Parameters

Parameter Type Description
InputObjs String List of objects to key

Default Value: Current selection

Type siTransformFilter Specifies the type of transformation to reset

Default Value: siSRT

Time Number Key frames are set at this frame.

Default Value: Key frame

Examples

VBScript Example

'
' This example animates rotation and pivot point of a cube, 
' creating a rolling cube animation. 
'
CreatePrim "Cube", "MeshSurface"
SetValue "cube.polymsh.geom.cube.length", 2
Translate , -5, 1, 0, siAbsolute, siPivot, siObj, siXYZ, , , , , , , , , , 0
SetValue "Camera.camvis.compobjselcenterpivot", True
'save initial rotation key, move pivot and save pivot key
SaveKey "cube.kine.local.rotx,cube.kine.local.roty,cube.kine.local.rotz", 1
'move pivot and save pivot key at frame 1
SetValue "cube.kine.local.pposx", 1
SetValue "cube.kine.local.pposy", -1
SavePivotKey "cube", siTrn, 1
Rot90AndKey "cube", 10
SetValue "cube.kine.local.pposy", 1
SavePivotKey "cube", siTrn, 10
Rot90AndKey "cube", 20
SetValue "cube.kine.local.pposx", -1
SavePivotKey "cube", siTrn, 20
Rot90AndKey "cube", 30
SetValue "cube.kine.local.pposy", -1
SavePivotKey "cube", siTrn, 30
Rot90AndKey "cube", 40
SetValue "cube.kine.local.pposx", 1
SavePivotKey "cube", siTrn, 40
Rot90AndKey "cube", 50
SetValue "cube.kine.local.pposy", 1
SavePivotKey "cube", siTrn, 50
Rot90AndKey "cube", 60
sub Rot90AndKey( obj, in_frame )
        'rotate about pivot point and save rotation key
        SetValue "PlayControl.Key", in_frame
        SetValue "PlayControl.Current", in_frame
        Rotate obj, 0, 0, -90, siRelative, siAdd, siObj, siXYZ, , , , , , , , 0
        SaveKey obj&".kine.local.rotx,"&obj&".kine.local.roty,"&obj&".kine.local.rotz", in_frame
end sub

See Also

SaveKey