Your Ad Here

Go to: Synopsis. Flags. Return value. Python examples.

Synopsis

detachCurve( [curveName] , [constructionHistory=boolean], [curveOnSurface=boolean], [keep=boolean], [name=string], [object=boolean], [parameter=float], [polygon=int], [range=boolean], [rebuild=boolean], [replaceOriginal=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

detachCurve is undoable, queryable, and editable.

The detachCurve command detaches a curve into pieces, given a list of parameter values. You can also specify which pieces to keep and which to discard using the "-k" flag. The names of the newly detached curve(s) is returned. If history is on, then the name of the resulting dependency node is also returned.

You can use this command to open a periodic curve at a particular parameter value. You would use this command with only one "-p" flag.

If you are specifying "-k" flags, then you must specify one, none or all "-k" flags. If you are specifying all "-k" flags, there must be one more "-k" flag than "-p" flags.

Flags

constructionHistory, curveOnSurface, keep, name, object, parameter, polygon, range, rebuild, replaceOriginal
Long name (short name) [argument types] Properties
parameter(p) float queryeditmultiuse
Parameter values to detach at
Default: 0.0

In query mode, this flag needs a value.

keep(k) boolean queryeditmultiuse
Whether or not to keep a detached piece. This multiattribute should be one element larger than the parameter multattribute.
Default: true

In query mode, this flag needs a value.

name(n) string create
Name the resulting object
constructionHistory(ch) boolean create
Turn the construction history on or off (not available in all commands)
object(o) boolean create
Create the result, or just the dependency node (not available in all commands)
replaceOriginal(rpo) boolean create
Create "in place" (i.e., replace) (not available in all commands)
curveOnSurface(cos) boolean create
If possible, create 2D curve as a result (not available in all commands)
polygon(po) int create
The value of this argument controls the type of the object created by this operation (not available in all commands)
  • 0: nurbs surface
  • 1: polygon (use nurbsToPolygonsPref to set the parameters for the conversion)
  • 2: subdivision surface (use nurbsToSubdivPref to set the parameters for the conversion)
  • 3: Bezier surface
  • 4: subdivision surface solid (use nurbsToSubdivPref to set the parameters for the conversion)
range(rn) boolean create
Force a curve range on complete input curve (not available in all commands)
rebuild(rb) boolean create
Rebuild the input curve(s) before using them in the operation. Use nurbsCurveRebuildPref to set the parameters for the conversion. (not available in all commands)

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.

Return value


[string[]] (object name and node name)

Python examples

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.

  

Return to Autodesk Index


Your Ad Here