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.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
activeHandle (ah) | int | ||
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 active1 - Y axis handle is active2 - Z axis handle is active3 - Center handle (all 3 axes) is active (default) |
|||
activeHandleNormal (ahn) | int | ||
0 - U axis handle is active1 - V axis handle is active2 - N axis handle is active ( default )3 - Center handle (all 3 axes) is activeapplicable only when the manip mode is 3. |
|||
alignAlong (aa) | float, float, float | ||
|
|||
editPivotMode (epm) | bool | ||
|
|||
editPivotPosition (epp) | bool | ||
|
|||
exists (ex) | bool | ||
image1 (i1) | unicode | ||
image2 (i2) | unicode | ||
image3 (i3) | unicode | ||
interactiveUpdate (iu) | bool | ||
|
|||
mode (m) | int | ||
Translate mode: 0 - Object Space1 - Local Space2 - World Space (default)3 - Move Along Vertex Normal4 - Move Along Rotation Axis5 - Move Along Live Object Axis6 - Custom Axis Orientation |
|||
orientAxes (oa) | float, float, float | ||
|
|||
orientJoint (oj) | unicode | ||
|
|||
orientJointEnabled (oje) | bool | ||
|
|||
orientTowards (ot) | float, float, float | ||
|
|||
position (p) | bool | ||
|
|||
postCommand (psc) | script | ||
|
|||
postDragCommand (pod) | script, <type ‘unicode’> | ||
|
|||
preCommand (prc) | script | ||
|
|||
preDragCommand (prd) | script, <type ‘unicode’> | ||
|
|||
preserveChildPosition (pcp) | bool | ||
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) | bool | ||
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) | bool | ||
|
|||
reflectionAbout (rab) | int | ||
|
|||
reflectionAxis (rfa) | int | ||
|
|||
reflectionTolerance (rft) | float | ||
|
|||
secondaryAxisOrient (sao) | unicode | ||
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) | bool | ||
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) | bool | ||
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) | bool | ||
|
|||
snapLivePoint (slp) | bool | ||
|
|||
snapRelative (sr) | bool | ||
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 | ||
|
|||
tweakMode (twk) | bool | ||
Derived from mel command maya.cmds.manipMoveContext
Example:
import pymel.core as pm
# To create a new move context:
pm.manipMoveContext()
# Result: u'manipMoveContext1' #
# To query the mode of an existing context:
pm.manipMoveContext( 'manipMoveContext1', q=True, mode=True )
# Result: 2 #
# To edit an existing context to come up with the X axis handle
# active by default:
pm.manipMoveContext( 'manipMoveContext1', e=True, ah=0 )
# Result: u'manipMoveContext1' #
pm.spaceLocator( p=(0, 0, 0), name='locatorA' )
# Result: nt.Transform(u'locatorA') #
pm.manipMoveContext( 'manipMoveContext1', e=True, m=2 ) # WorldSpace
# Result: u'manipMoveContext1' #
pm.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
# Result: u'manipMoveContext1' #
pm.manipMoveContext( 'manipMoveContext1', e=True, snapValue=0.4 )
# Result: u'manipMoveContext1' #
# Now, dragging any of the move handles will
# move the object in steps of 0.4 units.
pm.move( 0.8, 0, 0, 'locatorA', a=True )
pm.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
# Result: u'manipMoveContext1' #
pm.manipMoveContext( 'manipMoveContext1', e=True, snapValue=2 )
# Result: u'manipMoveContext1' #
pm.manipMoveContext( 'manipMoveContext1', e=True, snapRelative=False )
# Result: u'manipMoveContext1' #
# 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.
pm.move( 0.8, 0, 0, 'locatorA', a=True )
pm.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
# Result: u'manipMoveContext1' #
pm.manipMoveContext( 'manipMoveContext1', e=True, snapValue=2 )
# Result: u'manipMoveContext1' #
pm.manipMoveContext( 'manipMoveContext1', e=True, snapRelative=True )
# Result: u'manipMoveContext1' #
# 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