ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.

概要

setAttr( attribute Any [Any...] , [alteredValue=boolean], [caching=boolean], [capacityHint=uint], [channelBox=boolean], [clamp=boolean], [keyable=boolean], [lock=boolean], [size=uint], [type=string])

注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。

setAttr は、取り消し可能、照会可能、および編集可能です。

ディペンデンシー ノードのアトリビュートの値を設定します。フラグとして -l/-k/-s を使用している場合、アトリビュートの値を設定する必要はありません。 -type フラグは、非数値型のアトリビュートを設定するときのみに必要となります。

Ufe アトリビュートの場合、入力アトリビュートの文字列は、「<ufe_path_string>.<ufe_attribute_name>」です。

下記の表は、非数値データ型に対する setAttr の構文をおおまかに示したものです。


この例を実行する場合は、最初にこれらのコマンドを実行して、サンプル アトリビュート タイプを作成します。

sphere -n node;
addAttr -ln short2Attr -at short2;
addAttr -ln short2a -p short2Attr -at short;
addAttr -ln short2b -p short2Attr -at short;
addAttr -ln short3Attr -at short3;
addAttr -ln short3a -p short3Attr -at short;
addAttr -ln short3b -p short3Attr -at short;
addAttr -ln short3c -p short3Attr -at short;
addAttr -ln long2Attr -at long2;
addAttr -ln long2a -p long2Attr -at long;
addAttr -ln long2b -p long2Attr -at long;
addAttr -ln long3Attr -at long3;
addAttr -ln long3a -p long3Attr -at long;
addAttr -ln long3b -p long3Attr -at long;
addAttr -ln long3c -p long3Attr -at long;
addAttr -ln float2Attr -at float2;
addAttr -ln float2a -p float2Attr -at "float";
addAttr -ln float2b -p float2Attr -at "float";
addAttr -ln float3Attr -at float3;
addAttr -ln float3a -p float3Attr -at "float";
addAttr -ln float3b -p float3Attr -at "float";
addAttr -ln float3c -p float3Attr -at "float";
addAttr -ln double2Attr -at double2;
addAttr -ln double2a -p double2Attr -at double;
addAttr -ln double2b -p double2Attr -at double;
addAttr -ln double3Attr -at double3;
addAttr -ln double3a -p double3Attr -at double;
addAttr -ln double3b -p double3Attr -at double;
addAttr -ln double3c -p double3Attr -at double;
addAttr -ln int32ArrayAttr -dt Int32Array;
addAttr -ln doubleArrayAttr -dt doubleArray;
addAttr -ln pointArrayAttr -dt pointArray;
addAttr -ln vectorArrayAttr -dt vectorArray;
addAttr -ln stringArrayAttr -dt stringArray;
addAttr -ln stringAttr -dt "string";
addAttr -ln matrixAttr -dt "matrix";
addAttr -ln sphereAttr -dt sphere;
addAttr -ln coneAttr -dt cone;
addAttr -ln meshAttr -dt mesh;
addAttr -ln latticeAttr -dt lattice;
addAttr -ln spectrumRGBAttr -dt spectrumRGB;
addAttr -ln reflectanceRGBAttr -dt reflectanceRGB;
addAttr -ln componentListAttr -dt componentList;
addAttr -ln attrAliasAttr -dt attributeAlias;
addAttr -ln curveAttr -dt nurbsCurve;
addAttr -ln surfaceAttr -dt nurbsSurface;
addAttr -ln trimFaceAttr -dt nurbsTrimface;
addAttr -ln polyFaceAttr -dt polyFaces;

-type short2
2 つの短整数の配列
値の構文 short short
値の意味 value1 value2
MEL の例 setAttr node.short2Attr -type short2 1 2;
Python の例 cmds.setAttr('node.short2Attr',1,2,type='short2')
-type short3
3 つの短整数の配列
値の構文 short short short
値の意味 value1 value2 value3
MEL の例 setAttr node.short3Attr -type short3 1 2 3;
Python の例 cmds.setAttr('node.short3Attr',1,2,3,type='short3')
-type long2
2 つの長整数の配列
値の構文 long long
値の意味 value1 value2
MEL の例 setAttr node.long2Attr -type long2 1000000 2000000;
Python の例 cmds.setAttr('node.long2Attr',1000000,2000000,type='long2')
-type long3
3 つの長整数の配列
値の構文 long long long
値の意味 value1 value2 value3
MEL の例 setAttr node.long3Attr -type long3 1000000 2000000 3000000;
Python の例 cmds.setAttr('node.long3Attr',1000000,2000000,3000000,type='long3')
-type Int32Array
長整数の可変長配列
値の構文 int {int}
値の意味 numberOfArrayValues {arrayValue}
MEL の例 setAttr node.int32ArrayAttr -type Int32Array 2 12 75;
Python の例 cmds.setAttr('node.int32ArrayAttr',[2,12,75],type='Int32Array')
-type float2
2 つの浮動小数点数の配列
値の構文 float float
値の意味 value1 value2
MEL の例 setAttr node.float2Attr -type float2 1.1 2.2;
Python の例 cmds.setAttr('node.float2Attr',1.1,2.2,type='float2')
-type float3
3 つの浮動小数点数の配列
値の構文 float float float
値の意味 value1 value2 value3
MEL の例 setAttr node.float3Attr -type float3 1.1 2.2 3.3;
Python の例 cmds.setAttr('node.float3Attr',1.1,2.2,3.3,type='float3')
-type double2
2 つの倍精度浮動小数点数の配列
値の構文 double double
値の意味 value1 value2
MEL の例 setAttr node.double2Attr -type double2 1.1 2.2;
Python の例 cmds.setAttr('node.double2Attr',1.1,2.2,type='double2')
-type double3
3 つの倍精度浮動小数点数の配列
値の構文 double double double
値の意味 value1 value2 value3
MEL の例 setAttr node.double3Attr -type double3 1.1 2.2 3.3;
Python の例 cmds.setAttr('node.double3Attr',1.1,2.2,3.3,type='double3')
-type doubleArray
倍精度浮動小数点数の可変長配列
値の構文 int {double}
値の意味 numberOfArrayValues {arrayValue}
MEL の例 setAttr node.doubleArrayAttr -type doubleArray 2 3.14159 2.782;
Python の例 cmds.setAttr( "node.doubleArrayAttr", (2, 3.14159, 2.782,), type="doubleArray")
-type matrix
倍精度浮動小数点数の 4x4 行列
値の構文 double double double double
double double double double
double double double double
double double double double
値の意味 row1col1 row1col2 row1col3 row1col4
row2col1 row2col2 row2col3 row2col4
row3col1 row3col2 row3col3 row3col4
row4col1 row4col2 row4col3 row4col4
代替構文 string double double double
double double double
integer
double double double
double double double
double double double
double double double
double double double
double double double
double double double double
double double double double
double double double
ブーリアン
代替構文の値の意味 "xform" scaleX scaleY scaleZ
rotateX rotateY rotateZ
rotationOrder (0=XYZ, 1=YZX, 2=ZXY, 3=XZY, 4=YXZ, 5=ZYX)
translateX translateY translateZ
shearXY shearXZ shearYZ
scalePivotX scalePivotY scalePivotZ
scaleTranslationX scaleTranslationY scaleTranslationZ
rotatePivotX rotatePivotY rotatePivotZ
rotateTranslationX rotateTranslationY rotateTranslationZ
rotateOrientW rotateOrientX rotateOrientY rotateOrientZ
jointOrientW jointOrientX jointOrientY jointOrientZ
inverseParentScaleX inverseParentScaleY inverseParentScaleZ
compensateForParentScale
MEL の例 setAttr node.matrixAttr -type "matrix" 1 0 0 0 0 1 0 0 0 0 1 0 2 3 4 1;
setAttr node.matrixAttr -type "matrix" "xform" 1 1 1 0 0 0 0 2 3 4 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 1 1 0 false;
Python の例 cmds.setAttr('node.matrixAttr',(1,0,0,0,0,1,0,0,0,0,1,0,2,3,4,1),type='matrix')
cmds.setAttr('node.matrixAttr','xform',(1,1,1),(0,0,0),0,(2,3,4),(0,0,0),
(0,0,0),(0,0,0),(0,0,0),(0,1,1),(0,0,1,0),(1,0,1,0),(1,2,3),False,type="matrix")
-type pointArray
ポイントの可変長配列
値の構文 int {double double double double}
値の意味 numberOfArrayValues {xValue yValue zValue wValue}
MEL の例 setAttr node.pointArrayAttr -type pointArray 2 1 1 1 1 2 2 2 1;
Python の例 cmds.setAttr('node.pointArrayAttr',2,(1,1,1,1),(2,2,2,1),type='pointArray')
-type vectorArray
ベクトルの可変長配列
値の構文 int {double double double}
値の意味 numberOfArrayValues {xValue yValue zValue}
MEL の例 setAttr node.vectorArrayAttr -type vectorArray 2 1 1 1 2 2 2;
Python の例 cmds.setAttr('node.vectorArrayAttr',2,(1,1,1),(2,2,2),type='vectorArray')
-type "string"
キャラクタ文字列
値の構文 文字列
値の意味 characterStringValue
MEL の例 setAttr node.stringAttr -type "string" "blarg";
Python の例 cmds.setAttr('node.stringAttr',"blarg",type="string")
-type stringArray
文字列の可変長配列
値の構文 int {string}
値の意味 numberOfArrayValues {arrayValue}
MEL の例 setAttr node.stringArrayAttr -type stringArray 3 "a" "b" "c";
Python の例 cmds.setAttr('node.stringArrayAttr',3,"a","b","c",type='stringArray')
-type sphere
球データ
値の構文 倍精度浮動小数点数
値の意味 sphereRadius
setAttr node.sphereAttr -type sphere 5.0;
-type cone
円錐データ
値の構文 double double
値の意味 coneAngle coneCap
MEL の例 setAttr node.coneAttr -type cone 45.0 5.0;
Python の例 cmds.setAttr('node.coneAttr',45.0,5.0,type='cone')
-type reflectanceRGB
反射率データ
値の構文 double double double
値の意味 redReflect greenReflect blueReflect
MEL の例 setAttr node.reflectanceRGBAttr -type reflectanceRGB 0.5 0.5 0.1;
Python の例 cmds.setAttr('node.reflectanceRGBAttr',0.5,0.5,0.1,type='reflectanceRGB')
-type spectrumRGB
スペクトル データ
値の構文 double double double
値の意味 redSpectrum greenSpectrum blueSpectrum
MEL の例 setAttr node.spectrumRGBAttr -type spectrumRGB 0.5 0.5 0.1;
Python の例 cmds.setAttr('node.spectrumRGBAttr',0.5,0.5,0.1,type='spectrumRGB')
-type componentList
コンポーネントの可変長配列
値の構文 int {string}
値の意味 numberOfComponents {componentName}
MEL の例 setAttr node.componentListAttr -type componentList 3 cv[1] cv[12] cv[3];
Python の例 cmds.setAttr('node.componentListAttr',3,'cv[1]','cv[12]','cv[3]',type='componentList')
-type attributeAlias
文字列のエイリアス データ
値の構文 string string
値の意味 newAlias currentName
MEL の例 setAttr node.attrAliasAttr -type attributeAlias
{"GoUp", "translateY", "GoLeft", "translateX"};
Python の例 cmds.setAttr('node.attrAliasAttr',("GoUp", "translateY",
"GoLeft", "translateX"),type='attributeAlias')
-type nurbsCurve
NURBS カーブ データ
値の構文 int int int bool int int {double}
int {double double double}
値の意味 degree spans form isRational dimension knotCount {knotValue}
cvCount {xCVValue yCVValue [zCVValue] [wCVValue]}
MEL の例 // degree is the degree of the curve(range 1-7)
// spans is the number of spans
// form is open (0), closed (1), periodic (2)
// isRational is true if the curve CVs contain a rational component
// dimension is 2 or 3, depending on the dimension of the curve
// knotCount is the size of the knot list
// knotValue is a single entry in the knot list
// cvCount is the number of CVs in the curve
// xCVValue,yCVValue,[zCVValue] [wCVValue] is a single CV.
// zCVValue is only present when dimension is 3.
// wCVValue is only present when isRational is true.
//
$curve = `createNode nurbsCurve`;
setAttr ($curve+".cc") -type nurbsCurve 3 1 0 no 3
6 0 0 0 1 1 1
4 -2 3 0 -2 1 0 -2 -1 0 -2 -3 0;
Python の例 # degree is the degree of the curve(range 1-7)
# spans is the number of spans
# form is open (0), closed (1), periodic (2)
# isRational is true if the curve CVs contain a rational component
# dimension is 2 or 3, depending on the dimension of the curve
# knotList is the list of knots
# next argument is unused and can be set to 0
# cvCount is the number of CVs in the curve
# (xCVValue,yCVValue,[zCVValue] [wCVValue]) is a single CV.
# zCVValue is only present when dimension is 3.
# wCVValue is only present when isRational is true.
#
curve = maya.cmds.createNode("nurbsCurve")
maya.cmds.setAttr(curve+".cc",
3, 1, 0, False, 3,
(0, 0, 0, 1, 1, 1), 0,
4,
(-2, 3, 0), (-2, 1, 0), (-2, -1, 0), (-2, -3, 0),
type="nurbsCurve")
-type nurbsSurface
NURBS サーフェス データ
値の構文 int int int int bool
int {double}
int {double}
[string] int {double double double}
値の意味 uDegree vDegree uForm vForm isRational
uKnotCount {uKnotValue}
vKnotCount {vKnotValue} ["TRIM"|"NOTRIM"] cvCount {xCVValue yCVValue zCVValue [wCVValue]}
MEL の例 // uDegree is degree of the surface in U direction (range 1-7)
// vDegree is degree of the surface in V direction (range 1-7)
// uForm is open (0), closed (1), periodic (2) in U direction
// vForm is open (0), closed (1), periodic (2) in V direction
// isRational is true if the surface CVs contain a rational component
// uKnotCount is the size of the U knot list
// uKnotValue is a single entry in the U knot list
// vKnotCount is the size of the V knot list
// vKnotValue is a single entry in the V knot list
// If "TRIM" is specified then additional trim information is expected
// If "NOTRIM" is specified then the surface is not trimmed
// cvCount is the number of CVs in the surface
// xCVValue,yCVValue,zCVValue [wCVValue]is a single CV.
// zCVValue is only present when dimension is 3.
// wCVValue is only present when isRational is true
//
$surface = `createNode nurbsSurface`;
setAttr ($surface+".cc") -type nurbsSurface 3 3 0 0 no
6 0 0 0 1 1 1
6 0 0 0 1 1 1
16 -2 3 0 -2 1 0 -2 -1 0 -2 -3 0
-1 3 0 -1 1 0 -1 -1 0 -1 -3 0
1 3 0 1 1 0 1 -1 0 1 -3 0
3 3 0 3 1 0 3 -1 0 3 -3 0;
Python の例 # uDegree is degree of the surface in U direction (range 1-7)
# vDegree is degree of the surface in V direction (range 1-7)
# uForm is open (0), closed (1), periodic (2) in U direction
# vForm is open (0), closed (1), periodic (2) in V direction
# isRational is true if the surface CVs contain a rational component
# uKnotList is the list of knots in U
# next argument is unused and can be set to 0
# vKnotList is the list of knots in V
# next argument is unused and can be set to 0
# If "TRIM" is specified then additional trim information is expected
# If "NOTRIM" is specified then the surface is not trimmed
# cvCount is the number of CVs in the surface
# (xCVValue,yCVValue,zCVValue [wCVValue])is a single CV.
# zCVValue is only present when dimension is 3.
# wCVValue is only present when isRational is true
#
surface = maya.cmds.createNode("nurbsSurface")
maya.cmds.setAttr(surface+".cc",
3, 3, 0, 0, False,
(0, 0, 0, 1, 1, 1), 0,
(0, 0, 0, 1, 1, 1), 0,
16,
(-2, 3, 0), (-2, 1, 0), (-2, -1, 0), (-2, -3, 0),
(-1, 3, 0), (-1, 1, 0), (-1, -1, 0), (-1, -3, 0),
(1, 3, 0), (1, 1, 0), (1, -1, 0), (1, -3, 0),
(3, 3, 0), (3, 1, 0), (3, -1, 0), (3, -3, 0),
type="nurbsSurface")
-type nurbsTrimface
NURBS トリムフェース データ
値の構文 bool int {int {int {double bool bool} int {bool double}}}
値の意味 flipNormal boundaryCount {boundaryType tedgeCountOnBoundary
{splineCountOnEdge {edgeTolerance isEdgeReversed geometricContinuity}
{splineCountOnPedge {isMonotone pedgeTolerance}}}
例: // flipNormal if true turns the surface inside out
// boundaryCount: number of boundaries
// boundaryType:
// tedgeCountOnBoundary : number of edges in a boundary
// splineCountOnEdge : number of splines in an edge in
// edgeTolerance : tolerance used to build the 3d edge
// isEdgeReversed : if true, the edge is backwards
// geometricContinuity : if true, the edge is tangent continuous
// splineCountOnPedge : number of splines in a 2d edge
// isMonotone : if true, curvature is monotone
// pedgeTolerance : tolerance for the 2d edge
//
-type polyFaces
ポリゴン フェース データ
値の構文 {"f" int {int}}
{"h" int {int}}
{"mf" int {int}}
{"mh" int {int}}
{"mu" int int {int}}
{"mc" int int {int}}
値の意味 {"f" faceEdgeCount {edgeIdValue}}
{"h" holeEdgeCount {edgeIdValue}}
{"mf" faceUVCount {uvIdValue}}
{"mh" holeUVCount {uvIdValue}}
{"mu" uvSet faceUVCount {uvIdValue}}
{"mc" colorIndex multiColorCount {colorIdValue}}
例: // This data type (polyFace) is meant to be used in file I/O
// after setAttrs have been written out for vertex position
// arrays, edge connectivity arrays (with corresponding start
// and end vertex descriptions), texture coordinate arrays and
// color arrays.The reason is that this data type references
// all of its data through ids created by the former types.
//
// "f" specifies the ids of the edges making up a face -
// negative value if the edge is reversed in the face
// "h" specifies the ids of the edges making up a hole -
// negative value if the edge is reversed in the face
// "mf" specifies the ids of texture coordinates (uvs) for a face.
// This data type is obsolete as of version 3.0.It is replaced by "mu".
// "mh" specifies the ids of texture coordinates (uvs) for a hole
// This data type is obsolete as of version 3.0.It is replaced by "mu".
// "mu" The first argument refers to the uv set.This is a zero-based
// integer number.The second argument refers to the number of vertices (n)
// on the face which have valid uv values.The last n values are the uv
// ids of the texture coordinates (uvs) for the face.These indices
// are what used to be represented by the "mf" and "mh" specification.
// There may be more than one "mu" specification, one for each unique uv set.
// "mc" specifies the color index values for a face.The first argument
// is color index.The second argument is the number of color ids to follow.
// Rest of the arguments are color ids for the face.
//
setAttr node.polyFaceAttr -type polyFaces "f" 3 1 2 3 "mc" 0 4 0 1 2 3;
-type mesh
ポリゴン メッシュ
値の構文 {string [int {double double double}]}
{string [int {double double double}]}
[{string [int {double double}]}]
{string [int {double double string}]}
値の意味 "v" [vertexCount {vertexX vertexY vertexZ}]
"vn" 0
["vt" [uvCount {uValue vValue}]]
"e" [edgeCount {startVertex endVertex "smooth"|"hard"}]
"face" ["l" edgeLoopCount edgeIndex1...] ]"lt" uvCount uvIndex1...]"
"face"...
MEL の例 // "v" specifies the vertices of the polygonal mesh
// "vn"must be set to 0
// "vt" is optional and specifies a U,V texture coordinate for each vertex
// "e" specifies the edge connectivity information between vertices
// "face" specifies face connectivity (edges/UVs) for a single face
//
$mesh = `createNode mesh`;
setAttr ($mesh+".o")
-type mesh "v" 3 0 0 0 0 1 0 0 0 1
"vn" 3 1 0 0 1 0 0 1 0 0
"vt" 3 0 0 0 1 1 0
"e" 3 0 1 "hard" 1 2 "hard" 2 0 "hard"
"face" "l" 3 0 1 2 "lt" 3 0 1 2;
Python の例 # "v" specifies the vertices of the polygonal mesh
# "vn"must be set to 0
# "vt" is optional and specifies a U,V texture coordinate for each vertex
# "e" specifies the edge connectivity information between vertices
# "face" specifies face connectivity (edges/UVs) for a single face
#
mesh = maya.cmds.createNode("mesh")
maya.cmds.setAttr(mesh+".o",
"v", 3, (0, 0, 0), (0, 1, 0), (0, 0, 1),
"vn", 0,
"vt", 3, (0, 0), (0, 1), (1, 0),
"e", 3, 0, 1, "hard", 1, 2, "hard", 2, 0, "hard",
"face", "l", 3, 0, 1, 2, "lt", 3, 0, 1, 2,
type="mesh")
-type lattice
ラティス データ
値の構文 int int int int {double double double}
値の意味 sDivisionCount tDivisionCount uDivisionCount
pointCount {pointX pointY pointZ}
MEL の例 // sDivisionCount is the horizontal lattice division count
// tDivisionCount is the vertical lattice division count
// uDivisionCount is the depth lattice division count
// pointCount is the total number of lattice points
// pointX,pointY,pointZ is one lattice point.The list is
// specified varying first in S, then in T, last in U so the
// first two entries are (S=0,T=0,U=0) (s=1,T=0,U=0)
//
$lattice = `createNode lattice`;
setAttr ($lattice+".cc") -type lattice 2 5 2 20
-2 -2 -2 2 -2 -2 -2 -1 -2 2 -1 -2 -2 0 -2
2 0 -2 -2 1 -2 2 1 -2 -2 2 -2 2 2 -2
-2 -2 2 2 -2 2 -2 -1 2 2 -1 2 -2 0 2
2 0 2 -2 1 2 2 1 2 -2 2 2 2 2 2;
Python の例 # sDivisionCount is the horizontal lattice division count
# tDivisionCount is the vertical lattice division count
# uDivisionCount is the depth lattice division count
# pointCount is the total number of lattice points
# (pointX,pointY,pointZ) is one lattice point.The list is
# specified varying first in S, then in T, last in U so the
# first two entries are (S=0,T=0,U=0) (s=1,T=0,U=0)
#
lattice = maya.cmds.createNode("lattice")
maya.cmds.setAttr(lattice+".cc",
2, 5, 2, 20,
(-2, -2, -2), (2, -2, -2), (-2, -1, -2), (2, -1, -2), (-2, 0, -2),
(2, 0, -2), (-2, 1, -2), (2, 1, -2), (-2, 2, -2), (2, 2, -2),
(-2, -2, 2), (2, -2, 2), (-2, -1, 2), (2, -1, 2), (-2, 0, 2),
(2, 0, 2), (-2, 1, 2), (2, 1, 2), (-2, 2, 2), (2, 2, 2),
type="lattice")

戻り値

なし

照会モードでは、戻り値のタイプは照会されたフラグに基づきます。

関連

addAttr, connectAttr, disconnectAttr, getAttr, listAttr

フラグ

alteredValue, caching, capacityHint, channelBox, clamp, keyable, lock, size, type
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
alteredValue(av) boolean create
値は現在値にすぎず、(アトリビュートに入力接続がある場合は)次の評価で変更される可能性があります。このフラグはファイル入出力時のみに使用します。したがって、入力接続を持つアトリビュートのデータが、ファイルが開かれてから最初の評価時に上書きされることはありません。
Ufe アトリビュートではサポートされていません。
caching(ca) boolean create
アトリビュートの内部キャッシュをオンまたはオフに設定します。すべてのアトリビュートのキャッシュを定義できるわけではありません。既定でキャッシュするように定義されていないアトリビュートに限り、キャッシュを設定することができます。また、マルチ アトリビュート要素にはキャッシュを設定することができません。キャッシュの設定は、複合アトリビュートの子アトリビュートにも影響を及ぼします。
Ufe アトリビュートではサポートされていません。
capacityHint(ch) uint create
-size フラグで十分な情報を指定できないアトリビュートに対して、メモリ割り当てヒントを指定するために使用されます。このフラグはオプションで、主にファイル入出力で使用されます。このフラグを利用できるのは特定のアトリビュートのみで、フラグ値の解釈はアトリビュートごとに異なります。
Ufe アトリビュートではサポートされていません。
このフラグは現在(node.attribute)によって使用されています。
  • mesh.face - フェース エッジ リストの合計要素数のヒントを指定します。
channelBox(cb) boolean create
channelBox でのアトリビュートの表示をオンまたはオフに設定します。キー設定可能なアトリビュートは、channelBox 設定に関係なく常に channelBox に表示されます。
Ufe アトリビュートではサポートされていません。チャネル ボックス(Channel Box)における Ufe アトリビュートの表示は、 channelBox コマンドの -ual/ufeFixedAttrListフラグを使用してコントロールします。
clamp(c) boolean create
数値アトリビュートで、その値がアトリビュートの範囲外である場合、強制的に最小値あるいは最大値にします。失敗することはありません。
Ufe アトリビュートではサポートされていません。
keyable(k) boolean create
アトリビュートのキー設定可能な状態をオンまたはオフに設定します。
Ufe アトリビュートではサポートされていません。
lock(l) boolean create
アトリビュートのロック状態をオンまたはオフに設定します。
size(s) uint create
マルチアトリビュート配列のサイズを定義します。これは単なるヒントで、できるだけ効率的にメモリを割り当てられるようにするために使用します。
Ufe アトリビュートではサポートされていません。
type(typ) string create
データ型を識別します。-type フラグが指定されていない場合は、数値型と想定されます。
Ufe アトリビュートではサポートされていません。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。

Python 例

import maya.cmds as cmds

cmds.sphere( n="sphere" )

# Set a simple numeric value
cmds.setAttr( 'sphere.translateX', 5 )

# Lock an attribute to prevent further modification
cmds.setAttr( 'sphere.translateX', lock=True )

# Make an attribute unkeyable
cmds.setAttr( 'sphere.translateZ', keyable=False )

# Set an entire list of multi-attribute values in one command
cmds.setAttr( 'sphereShape.weights[0:6]',1, 1, 2, 1, 1, 1, 2,size=7)
# Set an attribute with a compound numeric type
cmds.setAttr('sphere.rotate', 0, 45, 90, type="double3")

# Clamp the value of the attribute to the min/max
# Useful floating point math leaves the value just
# a little out of range - here the min is .01
cmds.setAttr( 'anisotropic1.roughness', 0.0099978, clamp=True )

# Set a multi-attribute with a compound numeric type
cmds.setAttr( 'sphereShape.controlPoints[0:2]', 0, 0, 0, 1, 1, 1, 2, 2, 2,type="double3" )