pymel.core.animation.connectJoint

connectJoint(*args, **kwargs)

This command will connect two skeletons based on the two selected joints. The first selected joint can be made a child of the parent of the second selected joint or a child of the second selected joint, depending on the flags used. Note1: The first selected joint must be the root of a skeleton. The second selected joint must have a parent. Note2: If a joint name is specified in the command line, it is used as the child and the first selected joint will be the parent. If no joint name is given at the command line, two joints must be selected.

Flags:

Long Name / Short Name Argument Types Properties
connectMode / cm bool ../../../_images/create.gif
  The first selected joint will be parented under the parent of the second selected joint.
parentMode / pm bool ../../../_images/create.gif
  The first selected joint will be parented under the second selected joint. Both joints will be in the active list(selection list). Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.connectJoint

Example:

import pymel.core as pm

# make joint1 a child of joint4.
#
pm.connectJoint( 'joint1', 'joint4', pm=True )

# make joint1 a child of joint4's parent
#
pm.connectJoint( 'joint1', 'joint4', cm=True )