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

Synopsis

manipMoveContext( [object] , [activeHandle=int], [activeHandleNormal=int], [alignAlong=[float, float, float]], [bakePivotOri=boolean], [constrainAlongNormal=boolean], [currentActiveHandle=int], [editPivotMode=boolean], [editPivotPosition=boolean], [exists=boolean], [image1=string], [image2=string], [image3=string], [interactiveUpdate=boolean], [lastMode=int], [manipVisible=boolean], [mode=int], [orientAxes=[float, float, float]], [orientJoint=string], [orientJointEnabled=boolean], [orientObject=string], [orientTowards=[float, float, float]], [pinPivot=boolean], [pivotOriHandle=boolean], [position=boolean], [postCommand=script], [postDragCommand=[script, string]], [preCommand=script], [preDragCommand=[script, string]], [preserveChildPosition=boolean], [preserveUV=boolean], [reflection=boolean], [reflectionAbout=int], [reflectionAxis=int], [reflectionTolerance=float], [secondaryAxisOrient=string], [snap=boolean], [snapComponentsRelative=boolean], [snapLiveFaceCenter=boolean], [snapLivePoint=boolean], [snapPivotOri=boolean], [snapPivotPos=boolean], [snapRelative=boolean], [snapValue=float], [translate=[float, float, float]], [tweakMode=boolean], [xformConstraint=string])

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

manipMoveContext is undoable, queryable, and editable.

This command can be used to create, edit, or query a move manip context. Note that the flags -s, -sv, -sr, -scr, -slp, -slf control the global behaviour of all move manip context. Changing one context independently is not allowed. Changing a context's behaviour using the above flags, will change all existing move manip context.

Return value

stringThe name of the new context

In query mode, return type is based on queried flag.

Flags

activeHandle, activeHandleNormal, alignAlong, bakePivotOri, constrainAlongNormal, currentActiveHandle, editPivotMode, editPivotPosition, exists, image1, image2, image3, interactiveUpdate, lastMode, manipVisible, mode, orientAxes, orientJoint, orientJointEnabled, orientObject, orientTowards, pinPivot, pivotOriHandle, position, postCommand, postDragCommand, preCommand, preDragCommand, preserveChildPosition, preserveUV, reflection, reflectionAbout, reflectionAxis, reflectionTolerance, secondaryAxisOrient, snap, snapComponentsRelative, snapLiveFaceCenter, snapLivePoint, snapPivotOri, snapPivotPos, snapRelative, snapValue, translate, tweakMode, xformConstraint
Long name (short name) Argument types Properties
activeHandle(ah) int queryedit
Sets the default active handle for the manip. That is, the handle which should be initially active when the tool is activated. Values can be:
  • 0 - X axis handle is active
  • 1 - Y axis handle is active
  • 2 - Z axis handle is active
  • 3 - Center handle (all 3 axes) is active (default)
activeHandleNormal(ahn) int queryedit
  • 0 - U axis handle is active
  • 1 - V axis handle is active
  • 2 - N axis handle is active ( default )
  • 3 - Center handle (all 3 axes) is active
applicable only when the manip mode is 3.
alignAlong(aa) [float, float, float] createedit
Aligns active handle along vector.
bakePivotOri(bpo) boolean queryedit
Bake pivot orientation. Automatically bake pivot orientation changes into the transform hierarchy / geometry.
constrainAlongNormal(xn) boolean queryedit
When true, transform constraints are applied along the vertex normal first and only use the closest point when no intersection is found along the normal.
currentActiveHandle(cah) int queryedit
Sets the active handle for the manip. Values can be:
  • 0 - X axis handle is active
  • 1 - Y axis handle is active
  • 2 - Z axis handle is active
  • 3 - Center handle (all 3 axes) is active
  • 4 - XY plane handle is active
  • 5 - YZ plane handle is active
  • 6 - XZ plane handle is active
editPivotMode(epm) boolean query
Returns true manipulator is in edit pivot mode
editPivotPosition(epp) boolean query
Returns the current position of the edit pivot manipulator.
exists(ex) boolean create
Returns true or false depending upon whether the specified object exists. Other flags are ignored.
image1(i1) string createqueryedit
First of three possible icons representing the tool associated with the context.
image2(i2) string createqueryedit
Second of three possible icons representing the tool associated with the context.
image3(i3) string createqueryedit
Third of three possible icons representing the tool associated with the context.
interactiveUpdate(iu) boolean queryedit
Value can be : true or false. This flag value is valid only if the mode is 3 i.e. move vertex normal.
lastMode(lm) int query
Returns the previous translation mode.
manipVisible(vis) boolean query
Returns true if the main translate manipulator is visible.
mode(m) int queryedit
Translate mode:
  • 0 - Object Space
  • 1 - Local Space
  • 2 - World Space (default)
  • 3 - Move Along Vertex Normal
  • 4 - Move Along Rotation Axis
  • 5 - Move Along Live Object Axis
  • 6 - Custom Axis Orientation
  • 10 - Component Space
orientAxes(oa) [float, float, float] queryedit
Orients manipulator rotating around axes by specified angles
orientJoint(oj) string queryedit
Specifies the type of orientation for joint orientation. Valid options are: none, xyz, xzy, yxz, yzx, zxy, zyx.
orientJointEnabled(oje) boolean queryedit
Specifies if joints should be reoriented when moved.
orientObject(oo) string createedit
Orients manipulator to the passed in object/component
orientTowards(ot) [float, float, float] createedit
Orients active handle towards world point
pinPivot(pin) boolean queryedit
Pin component pivot. When the component pivot is set and pinned selection changes will not reset the pivot position and orientation.
pivotOriHandle(poh) boolean queryedit
When true, the pivot manipulator will show the orientation handle during editing. Default is true.
position(p) boolean query
Returns the current position of the manipulator
postCommand(psc) script createedit
Specifies a command to be executed when the tool is exited.
postDragCommand(pod) [script, string] createedit
Specifies a command and a node type. The command will be executed at the end of a drag when a node of the specified type is in the selection.
preCommand(prc) script createedit
Specifies a command to be executed when the tool is entered.
preDragCommand(prd) [script, string] createedit
Specifies a command and a node type. The command will be executed at the start of a drag when a node of the specified type is in the selection.
preserveChildPosition(pcp) boolean queryedit
When false, the children objects move when their parent is moved. When true, the worldspace position of the children will be maintained as the parent is moved. Default is false.
preserveUV(puv) boolean queryedit
When false, the uvs are not changes to match the vertex edit. When true, the uvs are edited to project to new values to stop texture swimming as vertices are moved.
reflection(rfl) boolean
This flag is obsolete. Reflection is now managed as part of selection itself using the symmetricModeling command.
reflectionAbout(rab) int
This flag is obsolete. Reflection is now managed as part of selection itself using the symmetricModeling command.
reflectionAxis(rfa) int
This flag is obsolete. Reflection is now managed as part of selection itself using the symmetricModeling command.
reflectionTolerance(rft) float
This flag is obsolete. Reflection is now managed as part of selection itself using the symmetricModeling command.
secondaryAxisOrient(sao) string queryedit
Specifies the global axis (in world coordinates) that should be used to should be used to align the second axis of the orientJointType triple. Valid options are xup, yup, zup, xdown, ydown, zdown, none.
snap(s) boolean queryedit
Value can be : true or false. Enable/Disable the discrete move. If set to true, the move manipulator of all the move contexts would snap at discrete points along the active handle during mouse drag. The interval between the points can be controlled using the 'snapValue' flag.
snapComponentsRelative(scr) boolean queryedit
Value can be : true or false. If true, while snapping a group of CVs/Vertices, the relative spacing between them will be preserved. If false, all the CVs/Vertices will be snapped to the target point (is used during grid snap(hotkey 'x'), and point snap(hotkey 'v')) Depress the 'x' key before click-dragging the manip handle and check to see the behaviour of moving a bunch of CVs, with this flag ON and OFF.
snapLiveFaceCenter(slf) boolean queryedit
Value can be : true or false. If true, while moving on the live polygon object, the move manipulator will snap to the face centers of the object.
snapLivePoint(slp) boolean queryedit
Value can be : true or false. If true, while moving on the live polygon object, the move manipulator will snap to the vertices of the object.
snapPivotOri(spo) boolean queryedit
Snap pivot orientation. Modify pivot orientation when snapping the pivot to a component.
snapPivotPos(spp) boolean queryedit
Snap pivot position. Modify pivot position when snapping the pivot to a component.
snapRelative(sr) boolean queryedit
Value can be : true or false. Applicable only when the snap is enabled. If true, the snapValue is treated relative to the original position before moving. If false, the snapValue is treated relative to the world origin. NOTE: If in local/object Space Mode, the snapRelative should be ON. Absolute discrete move is not supported in local/object mode.
snapValue(sv) float queryedit
Applicable only when the snap is enabled. The manipulator of all move contexts would move in steps of 'snapValue'
translate(tr) [float, float, float] queryedit
Returns the translation of the manipulator for its current orientation/mode.
tweakMode(twk) boolean queryedit
When true, the manipulator is hidden and highlighted components can be selected and moved in one step using a click-drag interaction.
xformConstraint(xc) string queryedit
  • none - no transform constraint
  • edge - edge transform constraint
  • surface - surface transform constraint

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# To create a new move context:
cmds.manipMoveContext()

# To query the mode of an existing context:
cmds.manipMoveContext( 'manipMoveContext1', q=True, mode=True )

# To edit an existing context to come up with the X axis handle
# active by default:
cmds.manipMoveContext( 'manipMoveContext1', e=True, ah=0 )

cmds.spaceLocator( p=(0, 0, 0), name='locatorA' )

cmds.manipMoveContext( 'manipMoveContext1', e=True, m=2 ) # WorldSpace
cmds.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapValue=0.4 )
# Now, dragging any of the move handles will
# move the object in steps of 0.4 units.

cmds.move( 0.8, 0, 0, 'locatorA', a=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapValue=2 )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapRelative=False )
# Now, dragging X-axis handle will
# move the object in steps of 2 units, and will
# place the object anywhere in (0,0,0) (2,0,0) (4,0,0) ...etc
# NOTE: If in objectSpace Mode, the snapRelative should be ON.
# Absolute discrete move is not supported in objectSpace mode.

cmds.move( 0.8, 0, 0, 'locatorA', a=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapValue=2 )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapRelative=True )
# Now, dragging X-axis handle will
# move the object in steps of 2 units, and will
# place the object anywhere in (2.8,0,0) (4.8,0,0) (6.8,0,0) ...etc