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

概要

uvLink( [objects] , [b=boolean], [isValid=boolean], [make=boolean], [queryObject=name], [texture=name], [uvSet=name])

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

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

オブジェクトの UV セットとその UV セットで使用されるテクスチャ間で、UV のリンク機能リレーションの作成、切断、照会を行うのに使用します。

make フラグ、break フラグ、query フラグを指定せずに uvSet フラグと texture フラグの両方を指定すると、make フラグが指定したと仮定されます。

make フラグ、break フラグ、query フラグを指定せずに uvSet フラグか texture フラグのいずれかを指定すると、query フラグが指定したと仮定されます。

この UV リンクのコンテキストで言う「texture」とは、多少単純化しすぎた表現です。実際は、UV セットは UV 座標を入力に取る、どのノードともリンク可能です。しかし、ほとんどの場合、UV セットとリンクする必要が生じるのはテクスチャだけです。

戻り値

stringまたは、isValid の照会ブーリアンの文字配列です。

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

フラグ

b, isValid, make, queryObject, texture, uvSet
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
make(m) boolean create
コマンドでこのフラグを指定すると、UV セットとテクスチャの間にリンクを作成するためにコマンドが呼び出されます。
b(b) boolean create
コマンドでこのフラグを指定すると、UV セットとテクスチャ間のリンクを切断するためにコマンドが呼び出されます。
uvSet(uvs) name create
uvSet フラグの引数は、アクションの実行時にコマンドが使用する UV セットを指定します。
texture(t) name create
texture フラグの引数は、アクションの実行時にコマンドが使用するテクスチャを指定します。
queryObject(qo) name create
このフラグはテクスチャの照会時のみに使われます。このフラグを使用して、照会結果がこのフラグで指定したオブジェクトの UV セットに限定されることを示します。
isValid(iv) boolean create
このフラグを使用して、テクスチャまたは UV セットが UV リンクに有効かどうかを検証します。これは -texture フラグまたは -uvSet フラグとともに使用されますが、両方のフラグを一度には使うことはできません。

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

Python 例

import maya.cmds as cmds

cmds.uvLink( uvSet='pSphereShape1.uvSet[2].uvSetName', texture='checker1' )
# causes a UV link to be created between uvSet[2] on pSphereShape1
# and the checker1 texture.
# Note that no make, break or query flag is specified so make is
# assumed since both uvSet and texture are specified.

cmds.uvLink( make=True, uvSet='pCubeShape2.uvSet[0].uvSetName', texture='file8' )
# causes a UV link to be created between uvSet[0] of pCubeShape2 and
# the file8 file texture.

cmds.uvLink( uvSet='pCubeShape2.uvSet[0].uvSetName', texture='file8' )
# causes a UV link to be created between uvSet[0] of pCubeShape2 and
# the file8 file texture. Note: no make, break or query flag is
# specified so the make flag is assumed since both uvSet
# and texture are specified.

cmds.uvLink( query=True, uvSet='pCubeShape2.uvSet[0].uvSetName' )
# will return a string array of textures which use the UV set
# pCubeShape2.uvSet[0].setName. For example, the return value might
# be:
# file8 file9 checker4 slimeMap

cmds.uvLink( query=True, texture='checker4' )
# will return a string array of the UV sets that are used by the
# texture. For example, the return value might be
# pCubeShape2.uvSet[0].setName pCylinderShape1.uvSet[4].setName
# pCylinderShape2.uvSet[3].setName

cmds.uvLink( texture='checker4' )
# will return a string array of the UV sets that are used by the
# texture. For example, the return value might be
# pCubeShape2.uvSet[0].setName pCylinderShape1.uvSet[4].setName
# pCylinderShape2.uvSet[3].setName
# Note that no make, break or query flag is specified, so query is
# assumed since no uvSet was specified.

cmds.uvLink( b=True, uvSet='pCylinderShape2.uvSet[3].uvSetName', texture='checker4' )
# causes the checker4 texture to no longer use the UV set
# pCylinderShape2.uvSet[3].setName.
# The texture will use the default UV set on pCylinderShape2 instead.
# If checker4 wasn't using pCylinderShape2.uvSet[3].setName,
# nothing changes and a warning is produced.

cmds.uvLink( isValid=True, texture='myTexture' )
# Returns true if myTexture is a texture to which a UV set can be
# linked, or false otherwise.

myPlug = getSomePlugFromSomewhere()
cmds.uvLink( isValid=True, uvSet=myPlug )
# Returns true if $myPlug is a UV set, or false otherwise.