Go to: Synopsis. Return value. Flags. Python examples.
convertSolidTx(
[node|attribute] [object...]
, [alpha=boolean], [antiAlias=boolean], [backgroundColor=[int, int, int]], [backgroundMode=string], [camera=name], [componentRange=boolean], [doubleSided=boolean], [fileFormat=string], [fileImageName=string], [fillTextureSeams=boolean], [force=boolean], [fullUvRange=boolean], [name=string], [pixelFormat=string], [resolutionX=int], [resolutionY=int], [reuseDepthMap=boolean], [samplePlane=boolean], [samplePlaneRange=[float, float, float, float]], [shadows=boolean], [uvBBoxIntersect=boolean], [uvRange=[float, float, float, float]], [uvSetName=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
convertSolidTx is undoable, queryable, and editable.
Command to convert a texture on a surface to a file texture. The first
argument is a rendering node or attribute. If only the node is
specified, the outColor attribute will be sampled. If the node does
not have an outColor attribute, the first attribute on the node which
is: readable, not writable, not hidden, connectable, and not a multi
is used. If lighting is to be baked, a shading group must be specified
as the texture.
The current selection will be used if a texture and surface are not
specified.
An image file will be generated for each object and stored in your
image segment of your project. The filename will be formatted using
the texture and surface names as follows:
{texture}-{surface}.{fileExtension}
However, if force is off and there is a name collision a version
number will be determined and the filename will be formatted as
follows:
{texture}-{surface}.{version}.{fileExtension}
If uv/uvsetName option is specified the filename will include
{surface}-{uvname} instead of {surface}.
string[] | File texture nodes |
In query mode, return type is based on queried flag.
alpha, antiAlias, backgroundColor, backgroundMode, camera, componentRange, doubleSided, fileFormat, fileImageName, fillTextureSeams, force, fullUvRange, name, pixelFormat, resolutionX, resolutionY, reuseDepthMap, samplePlane, samplePlaneRange, shadows, uvBBoxIntersect, uvRange, uvSetName
Long name (short name) |
Argument types |
Properties |
antiAlias(aa)
|
boolean
|
|
|
Perform anti-aliasing on the resulting image. Convert solid
texture will generally take four times longer than without
anti-aliasing. By default this flag is off.
|
|
alpha(al)
|
boolean
|
|
|
Specify whether to compute the transparency when baking
lighting. The conversion will sample both the color and
transparency of the shading network; the alpha channel of the
file texture will be set to correspond to the result from sampling
the transparency. By default transparency is not computed.
|
|
camera(cam)
|
name
|
|
|
Specify a camera to use in baking lighting. If a camera is not
specified the camera in the active view will be used.
|
|
componentRange(cr)
|
boolean
|
|
|
If one or more components have been selected to use, then
if this flag is set, then the uv range of the components
is used to fit into the texture map resolution. By default this
flag is set to false.
|
|
doubleSided(ds)
|
boolean
|
|
|
Specify whether the sampler should flip the surface normal if the
sample point faces away from the camera. Note: flipping the normal
will make the result dependent on the camera (ie. one camera may
flip normals where different camera wouldn't). It's not recommended
that doubleSided be used in combination with shadows. By default
this flag is false.
|
|
force(f)
|
boolean
|
|
|
If the output image already exists overwrite it. By default
this flag is off.
|
|
fileFormat(fil)
|
string
|
|
|
File format to be used for output. IFF is the default if
unspecified. Other valid formats are:
- als: Alias PIX
- cin: Cineon
- eps: EPS
- gif: GIF
- iff: Maya IFF
- jpg: JPEG
- yuv: Quantel
- rla: Wavefront RLA
- sgi: SGI
- si: SoftImage (.pic)
- tga: Targa
- tif: TIFF
- bmp: Windows Bitmap
|
|
fileImageName(fin)
|
string
|
|
|
Specify the output path and name of file texture image. If the
file name doesn't contain a directory separator, the image
will be written to source images of the current project. The
file will not be versioned if it already exists.
|
|
fullUvRange(fur)
|
boolean
|
|
|
Sample using the full uv range of the surface. This flag
cannot be used with the -uvr flag. A 2D texture placement node
will be created and connected to the file texture. The placement's
translate and coverage will be set according to the full UV range of
the surface.
|
|
name(n)
|
string
|
|
|
Set the name of the file texture node. Name conflict
resolution will be used to determine valid names when multiple
objects are specified.
|
|
resolutionX(rx)
|
int
|
|
|
Set the horizontal image resolution. If this flag
is not specified, the resolution will be set to 256.
|
|
resolutionY(ry)
|
int
|
|
|
Set the vertical image resolution. If this flag
is not specified, the resolution will be set to 256.
|
|
shadows(sh)
|
boolean
|
|
|
Specify whether to compute shadows when baking lighting. Disk based
shadow maps will be used. Only lights with depth map shadows enabled
will contribute to the shading. By default shadows are not computed.
|
|
samplePlane(sp)
|
boolean
|
|
|
Specify whether to sample using a virtual plane. This virtual plane
has texture coordinates in the rectangle defined by the
-samplePlaneRange flag. If the -samplePlaneRange flag is not set then
the virtual plane defaults to having texture coordinates in the
(0,0) to (1,1) square. If this option is set than all surface based
arguments will be ignored.
|
|
samplePlaneRange(spr)
|
[float, float, float, float]
|
|
|
Specify the uv range of the texture coordinates used to sample if
the -samplePlane option is set. There are four arguments corresponding
to uMin, uMax, vMin and vMax. By default the virtual plane is from
uMin 0 to uMax 1, and vMin 0 to vMax 1.
|
|
uvBBoxIntersect(ubi)
|
boolean
|
|
|
backgroundMode(bm)
|
string
|
|
|
Defines how the background of the texture should be
filled. Three modes are available:
"shader" or 1: uses the default shader color.
"color" or 2: uses the color given by
-backgroundColor flag.
"extend" or 3: extends outwards the color along the
seam edges.
Default is "shader".
|
|
backgroundColor(bc)
|
[int, int, int]
|
|
|
Set the background color to a specific value. Default is to
use the shader default color to fill the background. Valid
values range from 0 to 255 if the pixel format is 8 bits per channel,
or 0 to 65535 if the pixel format is 16 bits per channel.
This flag automatically sets -backgroundMode to "color".
Default is black: 0 0 0.
|
|
fillTextureSeams(fts)
|
boolean
|
|
|
Specify whether or not to overscan the polygon beyond its outer
edges, when creating the file texture, in order to fill the texture
seams.
Default is true.
|
|
reuseDepthMap(rdm)
|
boolean
|
|
|
Specify whether or not to reuse all the generated dmaps.
Default is false.
|
|
uvSetName(uv)
|
string
|
|
|
Specify which uv set has to be used as the driving parametrization
for convert solid.
|
|
uvRange(uvr)
|
[float, float, float, float]
|
|
|
Specify the uv range in which samples will be computed. There are
four arguments corresponding to uMin, uMax, vMin and vMax. Each
value should be specified based on the surface's uv space. A 2D
texture placement node will be created and connected to the file
texture. The placement's frame translate and coverage will be set
according to the uv range specified. By default the entire uv range
of the surface will be used.
|
|
pixelFormat(pf)
|
string
|
|
|
Specifies the pixel format of the image.
Note that not all file formats support all pixel formats.
Available options:
"8": 8 bits per channel, unsigned (0-255)
"16": 16 bits per channel, unsigned (0-65535)
Default is "8".
|
|
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.
|
import maya.cmds as cmds
cmds.file( f=True, new=True )
# Create a blinn shader with a marble texture.
cmds.shadingNode( 'blinn', asShader=True )
cmds.sets( renderable=True, noSurfaceShader=True, empty=True, name='blinn1SG' )
cmds.connectAttr( 'blinn1.outColor', 'blinn1SG.surfaceShader', f=True )
cmds.shadingNode( 'marble', asTexture=True )
cmds.connectAttr( 'marble1.outColor', 'blinn1.color', f=True )
# Create two objects, and assign the blinn shader to them.
cmds.polySphere()
cmds.sets( e=True, forceElement='blinn1SG' )
cmds.polyPlane()
cmds.move( 2, 0, 0 )
cmds.sets( e=True, forceElement='blinn1SG' )
# Create a low resolution texture for the sphere
cmds.convertSolidTx( 'marble1', 'pSphere1', rx=64, ry=64 )
# Create a transparency texture forthe plane.
cmds.convertSolidTx( 'marble1.outAlpha', 'pPlane1' )
# Create a texture named myTexture.iff for the sphere.
cmds.convertSolidTx( 'marble1', 'pSphere1', bm='extend', fileImageName='myTexture.iff' )