Go to: Synopsis. Return value. Related. Python examples.

Synopsis

setKeyPath( [object] )

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

setKeyPath is undoable, NOT queryable, and NOT editable.

The setKeyPath command either creates or edits the path (a nurbs curve) based on the current position of the selected object at the current time.

Return value

string[] (Names of the created curve node and motionPath node)

Related

autoKeyframe, findKeyframe, setDrivenKeyframe, setKeyframe

Python examples

import maya.cmds as cmds

# Apply setKeyPath command on the currently selected object at current time:
cmds.setKeyPath()
# Apply setKeyPath command on an object named "ball" at current time:
cmds.setKeyPath( 'ball' )