pymel.core.general.scale¶
- scale(obj, *args, **kwargs)¶
The scale command is used to change the sizes of geometric objects. The default behaviour, when no objects or flags are passed, is to do a relative scale on each currently selected object object using each object’s existing scale pivot point.
- Modifications:
allows any iterable object to be passed as first argument:
scale("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 Perform an absolute operation. centerPivot / cp bool Let the pivot be the center of the bounding box of all objects componentSpace / cs bool Move in local component space constrainAlongNormal / xn bool 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. deletePriorHistory / dph bool If true then delete the history prior to the current operation. distanceOnly / dso bool Scale only the distance between the objects. localSpace / ls bool Use local space for scaling objectCenterPivot / ocp bool Let the pivot be the center of the bounding box of each object objectSpace / os bool Use object space for scaling orientAxes / oa float, float, float Use the angles for the orient axes. pivot / p float, float, float Define the pivot point for the transformation preserveChildPosition / pcp bool When true, transforming an object will apply an opposite transform to its child transform to keep them at the same world-space position. Default is false. preserveGeometryPosition / pgp bool When true, transforming an object will apply an opposite transform to its geometry points to keep them at the same world-space position. Default is false. preserveUV / puv bool When true, UV values on scaled components are projected along the axis of scaling 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 To move the corresponding symmetric components also. reflectionAboutBBox / rab bool Sets the position of the reflection axis at the geometry bounding box reflectionAboutOrigin / rao bool Sets the position of the reflection axis at the origin reflectionAboutX / rax bool Specifies the X=0 as reflection plane reflectionAboutY / ray bool Specifies the Y=0 as reflection plane reflectionAboutZ / raz bool Specifies the Z=0 as reflection plane reflectionTolerance / rft float Specifies the tolerance to findout the corresponding reflected components relative / r bool Perform a operation relative to the object’s current position scaleX / x bool Scale in X direction scaleXY / xy bool Scale in X and Y direction scaleXYZ / xyz bool Scale in all directions (default) scaleXZ / xz bool Scale in X and Z direction scaleY / y bool Scale in Y direction scaleYZ / yz bool Scale in Y and Z direction scaleZ / z bool Scale in Z direction symNegative / smn bool When set the component transformation is flipped so it is relative to the negative side of the symmetry plane. The default (no flag) is to transform components relative to the positive side of the symmetry plane. worldSpace / ws bool Use world space for scaling xformConstraint / xc unicode Apply a transform constraint to moving components. none - no constraintsurface - constrain components to the surfaceedge - constrain components to surface edgeslive - constraint components to the live surfaceFlag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.scale
Example:
import pymel.core as pm pm.scale( 1, 1, 1 ) pm.scale( 3, 3, 3, 'curve1', pivot=(1, 0, 0), absolute=True )