移動先: 概要 戻り値 フラグ. Python 例.
detachCurve(
curve
, [caching=boolean], [constructionHistory=boolean], [curveOnSurface=boolean], [keep=boolean], [name=string], [nodeState=int], [object=boolean], [parameter=float], [replaceOriginal=boolean])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
detachCurve は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
パラメータ値のリストに従って、カーブをデタッチして断片にします。「-k」フラグを使用すると、保存する断片と破棄する断片を指定できます。
戻り値は、新しくデタッチされたカーブの名前です。コンストラクション ヒストリがオンの場合は、作成されるディペンデンシー ノード名も返されます。
このコマンドを使用すると、特定パラメータ値で周期的なカーブを開くことができます。このコマンドは、「-p」フラグを 1 つだけ指定して使用できます。
「-k」フラグを指定する場合は、「-k」フラグを 1 つかすべて指定するか、まったく指定しない必要があります。「-k」フラグをすべて指定する場合は、「-p」フラグより「-k」フラグを 1 つ多くする必要があります。
戻り値の型は照会モードでは照会フラグが基になります。
caching, constructionHistory, curveOnSurface, keep, name, nodeState, object, parameter, replaceOriginal
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
cmds.detachCurve( 'curve1', ch=True, p=0.2, replaceOriginal=False )
# Detaches curve1 at parameter value 0.2. The
# result is two curves and a detachCurve dependency node.
# The "-rpo" flag specifies that the original curve is not to be
# replaced; as a result a new curve is created for each curve piece.
# Note that if "k" flag is not used, then the default is that
# all pieces are kept.
cmds.detachCurve( 'curve1.ep[1]', ch=True, replaceOriginal=False )
# Detaches curve1 at its second edit point.
cmds.detachCurve( 'curve1.u[0.2]', ch=True, replaceOriginal=False )
# Detaches curve1 at parameter value 0.2
cmds.detachCurve( 'curve1', ch=True, p=0.4, k=(1 , 0), rpo=False )
# Detaches curve1 at parameter value 0.4 into two curves. Because of
# the "k" flags, two curves are created, but the second one is empty.
# A detachCurve dependency node is also returned.
cmds.detachCurve( 'curve1', ch=True, p=(0.2, 0.4), rpo=True )
# Detaches curve1 into three pieces. Because the "rpo" flag is on,
# the original curve is replaced with the first piece. The names
# of all curve pieces are returned. If curve1 is a result of history,
# then a dependency node is created and its output is connected as
# the input to curve1. If curve1 is not a result of construction
# history, then a dependency node is not created (even though the
# "ch" flag is on).
cmds.detachCurve( 'circle1', ch=True, p=(0.2, 0.4) )
# Detaches a periodic curve, circle1, at two places. Before
# the detach, the circle is periodic, with a start parameter of 0.0,
# and an end parameter of 8.0.
# The first parameter, 0.2, is used to move the start point of the curve,
# also called the "seam". The second parameter, 0.4, is used to perform
# a detach operation. The result is TWO curves only. The first curve
# has a parameter range of 0.2 to 0.4. The second curve has a parameter
# range of 0.4 to 8.2.