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

概要

curveOnSurface( string string , [append=boolean], [degree=float], [knot=float], [name=string], [periodic=boolean], [positionUV=[float, float]], [replace=boolean])

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

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

curve コマンドを使うと、コントロール頂点(CV)のリストから新規カーブを作成できます。新規作成されたカーブへのパス名を含む文字列が返されます。ワールド座標空間またはオブジェクト(ローカル)空間において、ウェイトを使ってまたは使わずに、ポイントからカーブを作成できます。「-r/replace」フラグを使用すると、既存のカーブを置き換えることができます。「-a/append」フラグを使用すると、ポイントを既存のカーブにアペンドできます。

カーブ オンサーフェスを作成するには、curveOnSurface コマンドを使用します。

カーブの次数を変更するには、rebuildCurve コマンドを使用します。

カーブのパラメータ範囲を変更するには、rebuildCurve コマンドを使用します。

curveOnSurface コマンドを使用すると、コントロール頂点(CV)のリストから新規のカーブ オンサーフェスが作成されます。新規作成されたカーブ オンサーフェスへのパス名を含む文字列が返されます。「-r/replace」フラグを使用すると、既存のカーブを置き換えることができます。「-a/append」フラグを使用すると、ポイントを既存のカーブ オンサーフェスにアペンドできます。カーブ アトリビュートの照会方法について説明した Curve コマンドも参照してください。

戻り値

string- 新しいカーブ オンサーフェスの名前
string新しいカーブまたは置き換えたカーブへのパス

関連

curve, curveOnSurface

フラグ

append, degree, knot, name, periodic, positionUV, replace
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
append(a) boolean create
既存のカーブの端にポイントをアペンドします。このフラグを使用する場合、アペンドするカーブの名前をコマンドの最後に指定する必要があります (以下の例を参照)。
degree(d) float create
新規カーブの次数。既定は 3 です。目に見えるカーブ スパンを作成するには、次数に 1 を足した数のカーブ ポイントが必要です。たとえば、3 次カーブには、4 個のポイントを配置する必要があります。
knot(k) float createmultiuse
ノット ベクトルにあるノットの値。ノット値ごとに 1 フラグ。(numberOfPoints + degree - 1)個のノットが必要で、ノット ベクトルは非減少型である必要があります。
name(n) string create
カーブの名前です。
periodic(per) boolean create
オンの場合、周期的なカーブを作成します。既定はオフです。
positionUV(uv) [float, float] createmultiuse
ポイントの UV の位置。
replace(r) boolean create
既存のカーブ全体を置き換えます。このフラグを使用する場合、置き換えるカーブの名前をコマンドの最後に指定する必要があります(以下の例を参照)。

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

Python 例

import maya.cmds as cmds

# These commands create curves with four control vertices.
# The first one is created without weights.  The third command
# shows how you can use units to specify position.
cmds.curve( p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)] )
cmds.curve( pw=[(0, 0, 0, 1), (3, 5, 6, 1), (5, 6, 7, 1), (9, 9, 9, 1)] )
cmds.curve( p=[('0cm', '0cm', '0cm'), ('3in', '5in', '6in'), ('5ft', '6ft', '7ft'), (9, 9, 9)] )

# This command replaces an existing curve, curve1, with the given points.
# Do not use this flag on a curve that is a result of a construction
# history operation.
cmds.curve( 'curve1', r=True, p=[(0, 0, 0), (3, 5, 6), (10, 12, 14), (9, 9, 9)] )

# This command adds two CVs to an existing curve, curve1.
# The "-ws" flag can be used if the specified CVs are in world space.
# Do not use this flag on a curve that is a result of a construction
# history operation.
cmds.curve( 'curve1', a=True, p=[(13, 13, 13), (13, 15, 16)] )

# This command creates a curve with five control vertices,
# with a knot vector. Notice that there must be
# (number of CVs + degree - 1) knots and that the knot
# vector must be non-decreasing.
cmds.curve( p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9), (12, 10, 2)], k=[0,0,0,1,2,2,2] )

# This command creates a closed (or "periodic") curve with
# four distinct CVs. You must specify a knot vector when the
# "-per" flag is used. Notice that the first "degree" points
# are the same as the last "degree" points (ie. the first three
# points are the same as the last three points). Notice also
# that the knot spacing between the first "degree" knots must
# be the same as the spacing between the last "degree" knots
# (ie. the space between the 1st and 2nd knots is the same as
# the space between the 7th and 8th knots, and the space between
# the 2nd and 3rd knots is the same as the space between the
# 8th and 9th knots). There must be space between the first
# "degree" knots, unlike the previous example, where the first
# "degree" knots are the same.
cmds.curve( per=True, p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9), (0, 0, 0), (3, 5, 6), (5, 6, 7)], k=[-2,-1,0,1,2,3,4,5,6] )

# How to query curve properties:

# This returns the degree of the curve.  Note that the
# number of CVs = degree + spans.
cmds.getAttr( 'curve1.degree' )

# This returns the number of spans in the curve.  Note that the
# number of CVs = degree + spans.
cmds.getAttr( 'curve1.spans' )

# This returns the curve form.
cmds.getAttr( 'curve1.form' )

# This returns the minimum parameter value on the curve.
cmds.getAttr( 'curve1.minValue' )

# This returns the maximum parameter value on the curve.
cmds.getAttr( 'curve1.maxValue' )

# This returns the local x,y,z of the 1st CV.  Use a curve info node if
# the curve is a result of a construction history operation.
cmds.getAttr( 'curve1.cv[0]' )

# This returns the local x,y,z of the 1st three CVs.  Use a curve info
# node if the curve is a result of a construction history operation.
cmds.getAttr( 'curve1.cv[*]' )

# This returns the local x,y,z of all CVs.  Use a curve info node if
# the curve is a result of a construction history operation.
cmds.getAttr( 'curve1.cv[0:2]' )

# This returns the arc length of the curve.  Use "-ch" flag with
# the arclen command to get a curve info node that constantly updates
# to the current arc length.
cmds.arclen( 'curve1' )

# This sequence creates a curve info node, connects the info node to the
# curve and queries the knot vector of the curve using the curve info node.
# You can use the curve info node to query other attributes such as
# world space CV values and arc length.
cmds.createNode( 'curveInfo' )
cmds.connectAttr( 'curveShape1.worldSpace', 'curveInfo1.inputCurve' )
cmds.getAttr( 'curveInfo1.knots[*]' )

cmds.curveOnSurface( 'surface1', d=3, uv=((0, 0),(0.3, 0.5), (0.5, 0.6), (0.9, 1.0)) )
# This command creates a curve-on-surface of degree three with
# four control vertices on surface1.

cmds.curveOnSurface( 'surface1', uv=((0, 0), (0.3, 0.5), (0.5, 0.6), (0.7, 0.8), (1.0, 1.0)), k=(0, 0, 0, 1, 2, 2, 2) )
# This command creates a curve-on-surface with five CVs
# and a knot vector, on surface1. Notice that there must be
# (number of CVs + degree - 1) knots and that the knot
# vector must be non-decreasing.

cmds.curveOnSurface( 'surface1', degree=3, per=True, uv=((0, 0), (0.2, 0.6), (0.4, 0.7), (0.9, 0.9), (0.0, 0.0), (0.2, 0.6), (0.4, 0.7)), k=(-2, -1, 0, 1, 2, 3, 4, 5, 6) )
# This command creates a closed (or "periodic") curve-on-surface with
# four distinct CVs. You must specify a knot vector when the
# "-per" flag is on. Notice that the first "degree" points
# are the same as the last "degree" points (ie. the first three
# points are the same as the last three points). Notice also
# that the knot spacing between the first "degree" knots must
# be the same as the spacing between the last "degree" knots
# (ie. the space between the 1st and 2nd knots is the same as
# the space between the 7th and 8th knots, and the space between
# the 2nd and 3rd knots is the same as the space between the
# 8th and 9th knots). There must be space between the first
# "degree" knots, unlike the previous example, where the first
# "degree" knots are the same.

cmds.curveOnSurface( 'surface1->curve1', append=True, uv=(1.0, 1.0) )
# This command appends a point to an existing curve-on-surface.
# Notice that the curve-on-surface is specified, not just the surface.

cmds.curveOnSurface( 'surface1->curve1', replace=True, d=1, uv=((1.0, 1.0), (2.0, 2.0)) )
# This command replaces an existing curve, surface1->curve1, with a
# new curve of degree 1 having the given points. Do not use this
# flag on a curve that is a result of a construction history operation.