pymel.core.modeling.polyProjection¶
- polyProjection(*args, **kwargs)¶
Creates a mapping on the selected polygonal faces. When construction history is created, the name of the new node is returned. In other cases, the command returns nothing.
Flags:
Long Name / Short Name Argument Types Properties constructionHistory / ch bool
Turn the construction history on or off (where applicable). createNewMap / cm bool
Create new map if it does not exist. imageCenterX / icx float
Specifies the X (U) translation of the projected UVs. Default is 0.5. imageCenterY / icy float
Specifies the Y (V) translation of the projected UVs. Default is 0.5. imageScaleU / isu float
Specifies the U scale factor of the projected UVs. Default is 1. imageScaleV / isv float
Specifies the V scale factor of the projected UVs. Default is 1. insertBeforeDeformers / ibd bool
Specifies if the projection node should be inserted before or after deformer nodes already applied to the shape. Inserting the projection after the deformer leads to texture swimming during animation and is most often undesirable. Default is on. keepImageRatio / kir bool
Specifies if the xy scaling in the planar projection has to be uniform. By setting this flag, the texture aspect ratio is preserved. This flag is ignored for cylindrical and spherical projections. mapDirection / md unicode
Specifies the direction of the projection. By specifying this flag, the projection placement values (pcx, pcy, pcz, rx, ry, rz, psu, psv) are internally computed. If both this flag and the projection values are specified, the projection values are ignored. Valid Values are : X Projects along the X Axis Y Projects along the Y Axis Z Projects along the Z Axis bestPlane Projects on the best plane fitting the object camera Projects along the viewing direction perspective Creates perspective projection if current camera is perspective Default is bestPlane. projectionCenterX / pcx float
Specifies the X coordinate of the center of the projection manipulator. projectionCenterY / pcy float
Specifies the Y coordinate of the center of the projection manipulator. projectionCenterZ / pcz float
Specifies the Z coordinate of the center of the projection manipulator. projectionScaleU / psu float
Specifies the U scale component of the projection manipulator. projectionScaleV / psv float
Specifies the V scale component of the projection manipulator. rotateX / rx float
Specifies the X-axis rotation of the projection manipulator. rotateY / ry float
Specifies the Y-axis rotation of the projection manipulator. rotateZ / rz float
Specifies the Z-axis rotation of the projection manipulator. rotationAngle / ra float
Specifies the rotation of the projected UVs in the UV space. Default is 0. seamCorrect / sc bool
Specifies if seam correction has to be done for spherical and cylindrical projections. This flag is ignored, if the planar projection is specified. smartFit / sf bool
Specifies if the projection manipulator has to be placed fitting the object. Used for cylindrical and spherical projections. For smart fitting the planar projection, the mapDirection flag has to be used, since there are several options for smart fitting a planar projection. type / t unicode
Specify the type of mapping to be performed. Valid values for the STRING are planarcylindricalsphericalDefault is planar. uvSetName / uvs unicode
Specifies name of the uv set to work on. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.polyProjection
Example:
import pymel.core as pm pm.file( f=True, new=True ) # To create a planar projection # pm.polyPlane( sx=10, sy=10 ) pm.move( 0, 0, r=3 ) pm.polyProjection( 'pPlane1.f[0:99]', type='Planar', md='y' ) polyPlanarProj1 # To create a cylindrical projection # pm.polyCylinder() pm.polyProjection( 'pCylinder1.f[0:21]', type='Cylindrical' ) polyCylProj1 # To create a spherical projection # pm.polySphere() pm.move( 0, 0, r=-3 ) pm.polyProjection( 'pSphere1.f[0:399]', type='Spherical' ) polySphProj1