pymel.core.general.move

move(*args, **kwargs)

The move command is used to change the positions of geometric objects. The default behaviour, when no objects or flags are passed, is to do a absolute move on each currently selected object in the world space. The value of the coordinates are interpreted as being defined in the current linear unit unless the unit is explicitly mentioned. When using -objectSpace there are two ways to use this command. If numbers are typed without units then the internal values of the object are set to these values. If, on the other hand a unit is specified then the internal value is set to the equivalent internal value that represents that world-space distance. The -localSpace flag moves the object in its parent space. In this space the x,y,z values correspond directly to the tx, ty, tz channels on the object. The -rotatePivotRelative/-scalePivotRelative flags can be used with the -absolute flag to translate an object so that its pivot point ends up at the given absolute position. These flags will be ignored if components are specified. The -worldSpaceDistance flag is a modifier flag that may be used in conjunction with the -objectSpace/-localSpace flags. When this flag is specified the command treats the x,y,z values as world space units so the object will move the specified world space distance but it will move along the axis specified by the -objectSpace/-localSpace flag. The default behaviour, without this flag, is to treat the x,y,z values as units in object space or local space. In other words, the worldspace distance moved will depend on the transformations applied to the object unless this flag is specified.

Modifications:
  • allows any iterable object to be passed as first argument:

    move("pSphere1", [0,1,2])
    

NOTE: this command also reorders the argument order to be more intuitive, with the object first

Flags:
Long name (short name) Argument Types Properties
absolute (a) bool ../../../_images/create.gif
 
Perform an absolute operation.
deletePriorHistory (dph) bool  
   
localSpace (ls) bool ../../../_images/create.gif
 
Move in local space
moveX (x) bool ../../../_images/create.gif
 
Move in X direction
moveXY (xy) bool ../../../_images/create.gif
 
Move in XY direction
moveXYZ (xyz) bool ../../../_images/create.gif
 
Move in all directions (default)
moveXZ (xz) bool ../../../_images/create.gif
 
Move in XZ direction
moveY (y) bool ../../../_images/create.gif
 
Move in Y direction
moveYZ (yz) bool ../../../_images/create.gif
 
Move in YZ direction
moveZ (z) bool ../../../_images/create.gif
 
Move in Z direction
objectSpace (os) bool ../../../_images/create.gif
 
Move in object space
orientJoint (oj) bool ../../../_images/create.gif
 
Default is xyz.
parameter (p) bool ../../../_images/create.gif
 
Move in parametric space
preserveChildPosition (pcp) bool  
   
preserveUV (puv) bool ../../../_images/create.gif
 

When true, UV values on translated components are projected along the translation in 3d space. For small edits, this will freeze the world space texture mapping on the object. When false, the UV values will not change for a selected vertices. Default is false.

reflection (rfl) bool ../../../_images/create.gif
 
To move the corresponding symmetric components also.
reflectionAboutBBox (rab) bool ../../../_images/create.gif
 
Sets the position of the reflection axis at the geometry bounding box
reflectionAboutOrigin (rao) bool ../../../_images/create.gif
 
Sets the position of the reflection axis at the origin
reflectionAboutX (rax) bool ../../../_images/create.gif
 
Specifies the X=0 as reflection plane
reflectionAboutY (ray) bool ../../../_images/create.gif
 
Specifies the Y=0 as reflection plane
reflectionAboutZ (raz) bool ../../../_images/create.gif
 
Specifies the Z=0 as reflection plane
reflectionTolerance (rft) float ../../../_images/create.gif
 
Specifies the tolerance to findout the corresponding reflected components
relative (r) bool ../../../_images/create.gif
 
Perform a operation relative to the object’s current position
rotatePivotRelative (rpr) bool ../../../_images/create.gif
 
Move relative to the object’s rotate pivot point.
scalePivotRelative (spr) bool ../../../_images/create.gif
 
Move relative to the object’s scale pivot point.
secondaryAxisOrient (sao) bool ../../../_images/create.gif
 
Default is xyz.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
worldSpace (ws) bool ../../../_images/create.gif
 
Move in world space
worldSpaceDistance (wd) bool ../../../_images/create.gif
 
Move is specified in world space units

Derived from mel command maya.cmds.move

Example:

import pymel.core as pm

pm.polySphere()
# Result: [nt.Transform(u'pSphere1'), nt.PolySphere(u'polySphere1')] #
pm.move( 1, 1, 1 )
pm.move( 5, y=True )
pm.move( '1in', '1in', '1in', relative=True, objectSpace=True, worldSpaceDistance=True )
pm.move( 0, 0, 0, 'pSphere1', absolute=True )

Previous topic

pymel.core.general.makePaintable

Next topic

pymel.core.general.nodeCast

Core

Core Modules

Other Modules

This Page