Python API 2.0 Reference: OpenMaya.MFnNurbsSurface Class Reference

+ Inheritance diagram for OpenMaya.MFnNurbsSurface:

Public Member Functions

__init__ ()
 
area ()
 
assignUV ()
 
assignUVs ()
 
boundaryType ()
 
clearUVs ()
 
closestPoint ()
 
copy ()
 
create ()
 
cv ()
 
cvPosition ()
 
cvPositions ()
 
cvsInU ()
 
cvsInV ()
 
distanceToPoint ()
 
edge ()
 
getAssignedUVs ()
 
getConnectedShaders ()
 
getDerivativesAtParam ()
 
getParamAtPoint ()
 
getPatchUV ()
 
getPatchUVid ()
 
getPatchUVs ()
 
getPointAtParam ()
 
getUV ()
 
getUVs ()
 
intersect ()
 
isFlipNorm ()
 
isKnotU ()
 
isKnotV ()
 
isParamOnSurface ()
 
isPointInTrimmedRegion ()
 
isPointOnSurface ()
 
knotInU ()
 
knotInV ()
 
knotsInU ()
 
knotsInV ()
 
normal ()
 
numBoundaries ()
 
numEdges ()
 
projectCurve ()
 
removeKnotInU ()
 
removeKnotInV ()
 
removeOneKnotInU ()
 
removeOneKnotInV ()
 
setCVPosition ()
 
setCVPositions ()
 
setKnotInU ()
 
setKnotInV ()
 
setKnotsInU ()
 
setKnotsInV ()
 
setUV ()
 
setUVs ()
 
tangents ()
 
trim ()
 
updateSurface ()
 
- Public Member Functions inherited from OpenMaya.MFnDagNode
__init__ ()
 
addChild ()
 
child ()
 
childCount ()
 
create ()
 
dagPath ()
 
dagRoot ()
 
duplicate ()
 
fullPathName ()
 
getAllPaths ()
 
getConnectedSetsAndMembers ()
 
getPath ()
 
hasChild ()
 
hasParent ()
 
instanceCount ()
 
isChildOf ()
 
isInstanced ()
 
isInstancedAttribute ()
 
isParentOf ()
 
parent ()
 
parentCount ()
 
partialPathName ()
 
removeChild ()
 
removeChildAt ()
 
setObject ()
 
transformationMatrix ()
 
- Public Member Functions inherited from OpenMaya.MFnDependencyNode
__init__ ()
 
absoluteName ()
 
addAttribute ()
 
addExternalContentForFileAttr ()
 
affectsAnimation ()
 
attribute ()
 
attributeClass ()
 
attributeCount ()
 
canBeWritten ()
 
create ()
 
dgCallbackIds ()
 
dgCallbacks ()
 
dgTimer ()
 
dgTimerOff ()
 
dgTimerOn ()
 
dgTimerQueryState ()
 
dgTimerReset ()
 
findAlias ()
 
findPlug ()
 
getAffectedAttributes ()
 
getAffectingAttributes ()
 
getAliasAttr ()
 
getAliasList ()
 
getConnections ()
 
getExternalContent ()
 
hasAttribute ()
 
hasUniqueName ()
 
isFlagSet ()
 
isNewAttribute ()
 
isTrackingEdits ()
 
name ()
 
plugsAlias ()
 
removeAttribute ()
 
reorderedAttribute ()
 
setAffectsAnimation ()
 
setAlias ()
 
setDoNotWrite ()
 
setExternalContent ()
 
setExternalContentForFileAttr ()
 
setFlag ()
 
setName ()
 
setUuid ()
 
userNode ()
 
uuid ()
 
- Public Member Functions inherited from OpenMaya.MFnBase
__init__ ()
 
hasObj ()
 
object ()
 
setObject ()
 
type ()
 

Static Public Attributes

int kClosed = 2
 
int kClosedSegment = 4
 
int kInner = 2
 
int kInvalid = 0
 
int kInvalidBoundary = 0
 
int kLast = 4
 
int kOpen = 1
 
int kOuter = 1
 
int kPeriodic = 3
 
float kPointTolerance = 0.001
 
int kSegment = 3
 
- Static Public Attributes inherited from OpenMaya.MFnDagNode
int kNextPos = 255
 
- Static Public Attributes inherited from OpenMaya.MFnDependencyNode
int kTimerMetrics = 9
 
int kTimerTypes = 3
 
int kExtensionAttr = 3
 
int kInvalidAttr = 4
 
int kLocalDynamicAttr = 1
 
int kNormalAttr = 2
 
int kTimerInvalidState = 3
 
int kTimerOff = 0
 
int kTimerOn = 1
 
int kTimerUninitialized = 2
 
int kTimerMetric_callback = 0
 
int kTimerMetric_callbackNotViaAPI = 6
 
int kTimerMetric_callbackViaAPI = 5
 
int kTimerMetric_compute = 1
 
int kTimerMetric_computeDuringCallback = 7
 
int kTimerMetric_computeNotDuringCallback = 8
 
int kTimerMetric_dirty = 2
 
int kTimerMetric_draw = 3
 
int kTimerMetric_fetch = 4
 
int kTimerType_count = 2
 
int kTimerType_inclusive = 1
 
int kTimerType_self = 0
 

Properties

 dataObject
 
 degreeInU
 
 degreeInV
 
 formInU
 
 formInV
 
 hasHistoryOnCreate
 
 isBezier
 
 isFoldedOnBispan
 
 isTrimmedSurface
 
 isUniform
 
 knotDomainInU
 
 knotDomainInV
 
 numCVsInU
 
 numCVsInV
 
 numKnotsInU
 
 numKnotsInV
 
 numNonZeroSpansInU
 
 numNonZeroSpansInV
 
 numPatches
 
 numPatchesInU
 
 numPatchesInV
 
 numRegions
 
 numSpansInU
 
 numSpansInV
 
 numUVs
 
- Properties inherited from OpenMaya.MFnDagNode
 boundingBox
 
 inModel
 
 inUnderWorld
 
 isInstanceable
 
 isIntermediateObject
 
 objectColor
 
 objectColorRGB
 
 objectColorType
 
 useObjectColor
 
- Properties inherited from OpenMaya.MFnDependencyNode
 isDefaultNode
 
 isFromReferencedFile
 
 isLocked
 
 isShared
 
 namespace
 
 pluginName
 
 typeId
 
 typeName
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenMaya.MFnDependencyNode
allocateFlag ()
 
classification ()
 
deallocateAllFlags ()
 
deallocateFlag ()
 

Detailed Description

NURBS (Non-Uniform Rational B-Spline) surface function set.

The shape of a NURBS surface is defined by an array of CVs
(control vertices), an array of knot values in the U direction
and an array of knot values in the V direction, a degree in U
and in V, and a form in U and in V.

The U and V knot vectors for NURBS surfaces are of size
(spansInU + 2*degreeInU -1) and (spansInV + 2*degreeInV -1).
Note: spans = numCVs - degree.

There are 3 possible forms for the surface in the U and V
directions: open, closed and periodic. These forms are described
below. Note that the descriptions below apply to both the U and
V directions.

The open and closed forms are quite similar, and in fact a
closed surface will become an open surface if either the first
or last CV is moved so that they are no longer coincident. To
create an open or closed surface, of degree N, with M spans, you
must provide M+N CVs. This implies that for a degree N surface,
you must specify at least N+1 CVs to get a surface with a single
span.

The number of knots required for the surface is M + 2N - 1.  If
you want the surface to start exactly at the first CV and end
exactly at the last CV, then the knot vector must be structured
to have degree N multiplicity at the beginning and end. This
means that the first N knots must be identical, and the last N
knots must be identical.

A periodic surface is a special case of a closed surface.
Instead of having just the first and last CVs coincident, the
last N CVs in the surface, where N is equal to the degree,
overlap the first N CVs. This results in a surface with no
tangent break where the ends meet. The last N CVs in a periodic
surface are permanently bound to the first N CVs, and Maya will
not allow those last N CVs to be repositioned. If one or more
of the first N CVs of the surface are repositioned, the
overlapping CV's will remain bound, and will also be moved.

In order to create a periodic surface, you must specify at least
2N+1 CVs, so that that last N can overlap the first N and you
still have 1 non-overlapping CV left.  The number of CVs
required to create a periodic surface is still N+M (with a
lower limit of 2N+1), but you must ensure that the positions
of the last N CVs are identical to the positions of the
first N.

You still need M + 2N - 1 knots for a periodic surface, but
the knot values required are more restrictive than for open
or closed surfaces because of the overlap of the last N CVs.
The first N knots should be specified at the beginning of
the knot array as values { -(N-1), -(N-2), ... 0 } in order
to implement the overlap.  Additionally there can be no knot
multiplicity at the end of the surface, because that would
compromise the tangent continuity property.

Note that some third party applications use a different
format for knots, where the number of knots required for a
surface is M+2N+1 rather than M+2N-1 as used in Maya. Both
knot representations are equivalent mathematically. To
convert from one of these external representations into the
Maya representation, simply omit the first and last knots
from the external representation when creating the Maya
representation. To convert from the Maya representation into
the external representation, add two new knots at the
beginning and end of the Maya knot sequence. The value of
these new knots depends on the existing knot sequence. For a
knot sequence with multiple end knots, simply duplicate the
existing first and last knots once more, for example:

Maya representation: {0,0,0,...,N,N,N}
External representation: {0,0,0,0,...,N,N,N,N}

For a knot sequence with uniform end knots, create the new
knots offset at an interval equal to the existing first and
last knot intervals, for example:

Maya representation: {0,1,2,...,N,N+1,N+2}
External representation: {-1,0,1,2,...,N,N+1,N+2,N+3}

Method resolution order:
-   MFnNurbsSurface
-   MFnDagNode
-   MFnDependencyNode
-   MFnBase
-   __builtin__.object

Constructor & Destructor Documentation

OpenMaya.MFnNurbsSurface.__init__ ( )
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Member Function Documentation

OpenMaya.MFnNurbsSurface.area ( )
area(space=kObject, tolerance=kPointTolerance) -> float

Returns the surface's area, or 0.0 if the area cannot be determined.
OpenMaya.MFnNurbsSurface.assignUV ( )
assignUV(patchId, cornerIndex, uvId) -> self

Maps a texture coordinate (uv) to a the specified corner of a patch.

Note that API methods that modify uv data will work correctly when
called through a plug-in node that is in the history of the shape,
or when used on a surface shape that does not have history.
Modifying uvs directly on a shape with history will result in the
modifications getting over-written by the next evaluation of the
history attached to the shape.

* patchId     (int) - Patch to map to.
* cornerIndex (int) - Corner of the patch to map to.
* uvId        (int) - Index into the uv list of the UV to map.
OpenMaya.MFnNurbsSurface.assignUVs ( )
assignUVs(uvCounts, uvIds) -> self

Maps all texture coordinates for the surface. setUV() and setUVs()
are used to create the texture coordinate table for the surface.
After the table is created, this method is used to map those values
to each patch on a per-corner basis.

The uvCounts array should contain the number of uvs per patch.
Since uvs are mapped per-patch per-corner, the entries in this array
should match the corner counts for each patch in the surface.
If an entry in this array is '0' then the corresponding patch will
not be mapped.

The sum of all the entries in the uvCounts array must be equal to
the size of the uvIds array or this method will fail.

The uvIds array should contain the UV indices that will be mapped to
each patch-corner in the surface. The entries in this array specify
which uvs in the surface's uv table are mapped to each patch-corner.
Each entry in the uvIds array must be less than numUVs().
The size of the uvIds array is equivalent to adding up all of the
entries in the uvCounts array, so for a cube with all patches mapped
there would be 24 entries.

Note that API methods that modify uv data will work correctly when
called through a plug-in node that is in the history of the shape,
or when used on a surface shape that does not have history.
Modifying uvs directly on a shape with history will result in the
modifications getting over-written by the next evaluation of the
history attached to the shape.

* uvCounts (MIntArray or seq of int)
 - UV counts for each patch in the surface.
* uvIds    (MIntArray or seq of int)
 - UV indices to be mapped to each patch-corner.
OpenMaya.MFnNurbsSurface.boundaryType ( )
boundaryType(region, boundary) -> int

Returns the type of the specified boundary. The surface must be a
trimmed surface. Valid boundary types are:

    kInner           - an inner (clockwise) boundary
    kOuter           - an outser (counter clockwise) boundary
    kSegment         - a curve on a patch
    kClosedSegment   - a closed curve on a patch
    kInvalidBoundary - an invalid boundary type

* region (int)   - Region containing the boundary
* boundary (int) - Index of the boundary within the region.
OpenMaya.MFnNurbsSurface.clearUVs ( )
clearUVs() -> self

Clears out all texture coordinates for the nurbsSurface, and leaves
behind an empty UVset.

This method should be used if it is needed to shrink the size of the
UV table. In this case, the user should call clearUVs, setUVs and
then assignUVs to rebuild the mapping info.

When called on a dataNurbsSurface the UVs are removed. When called
on a shape with no history, the UVs are removed and the attributes
are set on the shape. When called on a shape with history, the
polyDelMap command is invoked and a polyMapDel node is created.
OpenMaya.MFnNurbsSurface.closestPoint ( )
closestPoint(testPoint, uStart=None, vStart=None,
    ignoreTrimBoundaries=False, tolerance=kPointTolerance,
    space=kObject) -> (MPoint, float, float)

Returns the closest point on the surface to the specified test point
The return value is a tuple containing the position of the point and
and its U and V texture parameters.

Performance can be greatly increased by supplying starting U and V
parameter values which are reasonably close to the final point.
Specifying these values will invoke a special algorithm which will
begin to search for the closest point at the given parameter value,
and will check the local surface to see which direction will bring
it closer to the given point. It then offsets in this direction and
repeats the process, iteratively traversing the surface until it
finds the closest point.
This algorithm will fail if it encounters a seam before reaching
the closest point, or if it finds a local closest point, such as a
bulge on a mesh where an offset in any direction will take it
further from the given point, even if that is not the true closest
point on the mesh. For this reason it is advisable to avoid using
this option unless absolutely sure that the initial point will be
a good enough approximation to the final point that these
conditions will not occur.

* testPoint (MPoint) - Position of the point to be checked
* uStart     (float) - Initial guess of a U parameter near where the
           where the closest point is expected to be.
* vStart     (float) - Initial guess of a V parameter near where the
           where the closest point is expected to be.
* ignoreTrimBoundaries (bool)
         - For trimmed surfaces, if this is true the
           trim curves will be ignored and the entire
           untrimmed surface searched.
* tolerance  (float) - How close to the surface must a point be to
           be considered 'on' the surface.
* space        (int) - an MSpace constant giving the coordinate
           space which 'testPoint' is in. The returned
           point will be in the same space.
OpenMaya.MFnNurbsSurface.copy ( )
copy(source, parent=kNullObj) -> MObject

Returns a new NURBS surface, which is a copy of the source surface,
and sets the functionset to operate on it.

* source (MObject)- The surface to copy.
* parent (MObject)- The parent/owner of the new surface. If it's a
        NURBS surface data wrapper (MFn.kNurbsSurfaceData)
        then the created surface will be returned as a
        geometry object (MFn.kNurbsSurfaceGeom) owned by
        the wrapper. If 'parent' is a DAG node then the
        new surface will be returned as nurbsSurface node
        parented under it. If 'parent' is not provided
        then a new top-level transform will be created
        with the new surface parented beneath it as a
        nurbsSurface node. In this last case it will be
        the transform node which is returned.
OpenMaya.MFnNurbsSurface.create ( )
create(cvs, uKnots, vKnots, uDegree, vDegree, uForm, vForm,
    rational, parent=kNullObj) -> MObject

Returns a new NURBS surface created from the specified data and sets
the function set to operate on it.

* cvs (MPointArray or seq of MPoint)
      - The control vertices.
* uKnots (MDoubleArray or seq of float)
      - Parameter values for the knots in the U direction.
* vKnots (MDoubleArray or seq of float)
      - Parameter values for the knots in the V direction.
* uDegree   (int) - Degree of the basis functions in the U direction.
* vDegree   (int) - Degree of the basis functions in the V direction.
* uForm     (int) - A Form constant (kOpen, kClosed, kPeriodic) giving
        the surface's form in the U direction.
* vForm     (int) - A Form constant (kOpen, kClosed, kPeriodic) giving
        the surface's form in the V direction.
* rational (bool) - Create as rational (True) or non-rational (False)
        surface.
* parent (MObject)- The parent/owner of the new surface. If it's a
        NURBS surface data wrapper (MFn.kNurbsSurfaceData)
        then the created surface will be returned as a
        geometry object (MFn.kNurbsSurfaceGeom) owned by
        the wrapper. If 'parent' is a DAG node then the
        new surface will be returned as nurbsSurface node
        parented under it. If 'parent' is not provided
        then a new top-level transform will be created
        with the new surface parented beneath it as a
        nurbsSurface node. In this last case it will be
        the transform node which is returned.
OpenMaya.MFnNurbsSurface.cv ( )
cv(uIndex, vIndex) -> MObject

Returns a component for the specified control vertex.

* uIndex (int) - U index of the CV.
* vIndex (int) - V index of the CV.
OpenMaya.MFnNurbsSurface.cvPosition ( )
cvPosition(uIndex, vIndex, space=kObject) -> MPoint

Returns the position of the specified control vertex.

* uIndex (int) - U index of the CV.
* vIndex (int) - V index of the CV.
* space  (int) - an MSpace constant giving the coordinate
     space which the point should be returned.
OpenMaya.MFnNurbsSurface.cvPositions ( )
cvPositions(space=kObject) -> MPointArray

Returns the positions of all the surface's control vertices.

* space  (int) - an MSpace constant giving the coordinate
     space which the points should be returned.
OpenMaya.MFnNurbsSurface.cvsInU ( )
cvsInU(startUIndex, endUIndex, vIndex) -> MObject

Returns a component for a set of control vertices in the U direction.

* startUIndex (int) - U index of the first CV to return.
* endUIndex   (int) - U index of the last CV to return.
* vIndex      (int) - V index for all of the returned CVs.
OpenMaya.MFnNurbsSurface.cvsInV ( )
cvsInV(startVIndex, endVIndex, uIndex) -> MObject

Returns a component for a set of control vertices in the V direction.

* startVIndex (int) - V index of the first CV to return.
* endVIndex   (int) - V index of the last CV to return.
* uIndex      (int) - U index for all of the returned CVs.
OpenMaya.MFnNurbsSurface.distanceToPoint ( )
distanceToPoint(point, space=kObject) -> float

Returns the distance from the given point to the closest point on
the surface.

* point (MPoint) - Point to calculate distance to.
* space  (int)   - An MSpace constant giving the coordinate space in
       which the point has been specified.
OpenMaya.MFnNurbsSurface.edge ( )
edge(region, boundary, edge, paramEdge=False) -> MObjectArray

Return the specified edge of a trim boundary.

For each region of a trimmed surface there may be several boundary
curves: an outer curve and possibly several inner boundary curves
(which define holes). These boundary curves are made up of one or
more curves called edges.

The edge is returned as an MObjectArray as it may consist of more
than one curve. The returned edge, or trim curve, can be a 2D parameter
edge or a 3D edge curve. Note that for closed surfaces some of the
3d edges may be 0 length in which case an empty MObjectArray is
returned. An example of this is the poles of a sphere.

* region     (int) - Index of trimmed region containing the edge.
* boundary   (int) - Index of boundary within trimmed region.
* edge       (int) - Index of the edge within the boundary.
* paramEdge (bool) - If True a 2D parameter edge is returned,
         otherwise a 3D edge is returned.
OpenMaya.MFnNurbsSurface.getAssignedUVs ( )
getAssignedUVs() -> (MIntArray, MIntArray)

Returns the indices of all UVs which have been mapped to the surface.
The return value is a tuple with an array containing the number
of UVs for each patch in the surface, and a second array containing
the indices of the UVs mapped to each corner of those patches. This
is the same format as the arrays taken by the assignUVs() method.
OpenMaya.MFnNurbsSurface.getConnectedShaders ( )
getConnectedShaders(instanceNumber) -> (MObjectArray, MIntArray)

Returns a tuple containing an array of all the shaders (sets)
connected to the specified instance of this surface, and an array of
patch/shader assignments. The second array will hold, for each patch
in the surface, an index into the first array. If a patch does not
have a shader assigned to it, the value of the index will be -1.
The shader objects can be derived from the sets returned.

Note: This method will only work with a MFnNurbsSurface function set
      which has been initialized with an MFn::kNurbsSurface.

See also getConnectedSetsAndMembers.

* instanceNumber (int) - Determines which instance of the surface to
             query. This will be zero if there is only
             one instance.
OpenMaya.MFnNurbsSurface.getDerivativesAtParam ( )
getDerivativesAtParam(uParam, vParam, space=kObject, secondOrder=False)
    -> (MPoint, MVector, MVector)
    -> (MPoint, MVector, MVector, MVector, MVector, MVector)

Evaluates the surface at the given (u,v) coordinates, returning a
tuple containing the position at that point, the first derivative
vector in U, and the first derivative vector in V. If 'secondOrder'
is True then the tuple will also contain three additional vectors:
the second order partial derivative with respect to U (dUU), the
second order partial derivative with respect to V (dVV), and the
second order partial derivative with respect to U then V (dUV).
None of the vectors will be normalized.

* uParam (float) - U parameter value at which to do the evaluation.
* vParam (float) - V parameter value at which to do the evaluation.
* space    (int) - An MSpace constant giving the coordinate space in
       which to perform the calculation.
* secondOrder (bool)
     - If True, second order derivatives will be included
       in the result. Note that this will increase
       computation time.
OpenMaya.MFnNurbsSurface.getParamAtPoint ( )
getParamAtPoint(point, ignoreTrimBoundaries, tolerance=kPointTolerance,
    space=kObject) -> (float, float)

Returns a tuple containing the parameter values corresponding to the
given point on the surface (or underlying surface).

* point    (MPoint) - Location of the parameter to obtain.
* ignoreTrimBoundaries (bool)
        - For trimmed surfaces, if this is true the
          trim curves will be ignored and the entire
          untrimmed surface searched.
* tolerance (float) - Accuracy to be used in the operation.
* space       (int) - An MSpace constant giving the coordinate space
          in which to perform the operation.
OpenMaya.MFnNurbsSurface.getPatchUV ( )
getPatchUV(patchId, cornerIndex) -> (float, float)

Returns a tuple containing the texture texture coordinate for a
corner of a patch. Since texture coordinates (UVs) are stored
per-patch per-corner you must specify both the patch and the corner
that the u and v values are mapped to.
* patchId (int)     - Patch of interest.
* cornerIndex (int) - Corner of interest.
OpenMaya.MFnNurbsSurface.getPatchUVid ( )
getPatchUVid(patchId, cornerIndex) -> int

Returns the id of the texture coordinate for a single corner of a patch.

* patchId (int)     - Patch of interest.
* cornerIndex (int) - Corner of interest.
OpenMaya.MFnNurbsSurface.getPatchUVs ( )
getPatchUVs(patchId) -> (MFloatArray, MFloatArray)

Returns a tuple containing the values of the texture coordinates on
all corners of the specified patch. The tuple contains an array of U
coordinates and an array of V coordinates, both the same length.

* patchId (int)     - Patch of interest.
OpenMaya.MFnNurbsSurface.getPointAtParam ( )
getPointAtParam(uParam, vParam, space=kObject) -> MPoint
OpenMaya.MFnNurbsSurface.getUV ( )
getUV(uvId) -> (float, float)

Returns a tuple containing the U and V values for the a texture coordinate

* uvId (int) - Id of the texture coordinate of intest.
OpenMaya.MFnNurbsSurface.getUVs ( )
getUVs() -> (MFloatArray, MFloatArray)

Returns all of the surface's texture coordinates as a tuple containing
an array of U values and an array of V values.
OpenMaya.MFnNurbsSurface.intersect ( )
intersect(rayStart, rayDir, tolerance=kPointTolerance, space=kObject,
    distance=False, exactHit=False, all=False)
    -> (MPoint, float, float[, float][, bool])
    -> (MPointArray, MDoubleArray, MDoubleArray[, MDoubleArray][, bool])
    -> None

Returns the closest point of intersection of a ray with the surface
as a tuple containing the point of intersection and the U and V
parameters at that point.
* rayStart (MPoint) - Starting point for the ray.
* rayDir  (MVector) - Direction of the ray
* tolerance (float) - Accuracy to be used in the operation.
* space       (int) - An MSpace constant giving the coordinate space
          in which to perform the operation.* distance   (bool) - If True the distance from 'rayStart' to the
          point of intersection will be appended to the
          returned tuple.
* exactHit   (bool) - If True then a boolean value indicating if the
          point of intersection was an exact hit will be
          appended to the returned tuple.
* all        (bool) - If True then all points of intersection will
          be returned. In this case the point of
          intersection, U and V parameters, and distance
          (if requested) will all be returned as arrays.
OpenMaya.MFnNurbsSurface.isFlipNorm ( )
isFlipNorm(region) -> bool

Checks whether the normal for the specified region is flipped
This method is only valid for trimmed surfaces.

region (int) - Region to check.
OpenMaya.MFnNurbsSurface.isKnotU ( )
isKnotU(param) -> bool

Checks if the specified parameter value is a knot value in the U
direction.

* param (float) - Parameter value to check.
OpenMaya.MFnNurbsSurface.isKnotV ( )
isKnotV(param) -> bool

Checks if the specified parameter value is a knot value in the V
direction.

* param (float) - Parameter value to check.
OpenMaya.MFnNurbsSurface.isParamOnSurface ( )
isParamOnSurface(uParam, vParam) -> bool

Checks if the specified parameter point is on this surface.

* uParam (float) - U parameter value.
* vParam (float) - V parameter value.
OpenMaya.MFnNurbsSurface.isPointInTrimmedRegion ( )
isPointInTrimmedRegion(uParam, vParam) -> bool

Checks if the given point is in a trimmed away region of a trimmed
surface. A trimmed away region is the part of the surface that is
cut away as a result of a trim operation.

* uParam (float) - U parameter of the point to check.
* vParam (float) - V parameter of the point to check.
OpenMaya.MFnNurbsSurface.isPointOnSurface ( )
isPointOnSurface(point, tolerance=kPointTolerance, space=kObject) -> bool

Checks if the given point is on this surface.

* point    (MPoint) - Point to check.
* tolerance (float) - Accuracy to be used in the operation.
* space       (int) - An MSpace constant giving the coordinate space
          in which to perform the operation
OpenMaya.MFnNurbsSurface.knotInU ( )
knotInU(index) -> float

Returns the knot value at the specified U index. U knots are indexed
from 0 to numKnotsInU-1.
* index (int) - Index of the U knot to return.
OpenMaya.MFnNurbsSurface.knotInV ( )
knotInV(index) -> float

Returns the knot value at the specified V index. V knots are indexed
from 0 to numKnotsInV-1.
* index (int) - Index of the V knot to return.
OpenMaya.MFnNurbsSurface.knotsInU ( )
knotsInU() -> MDoubleArray

Returns all of the surface's knots in the U direction.
OpenMaya.MFnNurbsSurface.knotsInV ( )
knotsInV() -> MDoubleArray

Returns all of the surface's knots in the V direction.
OpenMaya.MFnNurbsSurface.normal ( )
normal(uParam, vParam, space=kObject) -> MVector

Returns the normal at the given parameter value on the surface.

* uParam (float) - U parameter at which to obtain normal.
* vParam (float) - V parameter at which to obtain normal.
* space    (int) - An MSpace constant giving the coordinate space
       in which to perform the operation
OpenMaya.MFnNurbsSurface.numBoundaries ( )
numBoundaries(region) -> unsigned int

Returns the number of boundaries for the specified region. The
surface must be a trimmed surface.

For each region there may be several boundary curves, an outer curve
and possibly several inner boundary curves which define holes. These
boundary curves are made up of one or more curves called edges.

* region (int) - Region of interest.
OpenMaya.MFnNurbsSurface.numEdges ( )
numEdges(region, boundary) -> unsigned int

Returns the number of edges for the specified trim boundary.
For each region there may be several boundary curves, an outer curve
and possibly several inner boundary curves which define holes. These
boundary curves are made up of one or more curves called edges.

* region   (int) - Region of interest.
* boundary (int) - Boundary of interest
OpenMaya.MFnNurbsSurface.projectCurve ( )
projectCurve(curve[, direction], keepHistory=False) -> self

Projects the given curve onto the surface, creating a curve on surface.

* direction (MVector) - Direction of projection. If not supplied
            then surface normals will be used.
* keepHistory  (bool) - Determines whether the construction history
            of the projection should be retained.
OpenMaya.MFnNurbsSurface.removeKnotInU ( )
removeKnotInU(param, removeAll=False) -> self

Removes one or more U knots at the specified parameter value from
from the surface.

* param    (float) - U parameter value of the knot to remove.
* removeAll (bool) - If True and there are multiple knots at the
         parameter value then they will all be removed.
         Otherwise, all but one will be removed.
OpenMaya.MFnNurbsSurface.removeKnotInV ( )
removeKnotInV(param, removeAll=False) -> self

Removes one or more V knots at the specified parameter value from
from the surface.

* param    (float) - V parameter value of the knot to remove.
* removeAll (bool) - If True and there are multiple knots at the
         parameter value then they will all be removed.
         Otherwise, all but one will be removed.
OpenMaya.MFnNurbsSurface.removeOneKnotInU ( )
removeOneKnotInU(param) -> self

Removes one U knot at the specified parameter value. If there are
multiple knots at that the value the others are retained.

* param (float) - U parameter value of the knot to remove.
OpenMaya.MFnNurbsSurface.removeOneKnotInV ( )
removeOneKnotInV(param) -> self

Removes one V knot at the specified parameter value. If there are
multiple knots at that the value the others are retained.

* param (float) - V parameter value of the knot to remove.
OpenMaya.MFnNurbsSurface.setCVPosition ( )
setCVPosition(uIndex, vIndex, point, space=kObject) -> self
OpenMaya.MFnNurbsSurface.setCVPositions ( )
setCVPositions(points, space=kObject) -> self

Set the positions of all of the surface's CVs.
(numCVsInU * numCVsInV) points must be provided. Converting from
U and V indices to array indices is done by:

        array index = numCVsInV * U index + V index

To keep this method as fast as possible, no checking of the data is
performed beyond ensuring that the total number of CVs passed in is
correct. It is up to the caller to ensure that the CVs provide a
valid surface, for example by ensuring that overlapping CVs in
periodic surfaces have the same positions.

* points (MPointArray or seq of MPoint)
   - Positions of the CVs.
* space  (int) - An MSpace constant giving the coordinate space
     in which to perform the operation
OpenMaya.MFnNurbsSurface.setKnotInU ( )
setKnotInU(index, param) -> self

Sets the value of an existing U knot. U knots are indexed from 0 to
numKnotsInU-1. Note that this method does not insert a new knot, it
simply changes the value of an existing knot.

If a knot value is set that breaks the non-decreasing requirement
for the knot array, the knot value will be changed and an exception
raised.

* index   (int) - U index of the knot to set.
* param (float) - New parameter value for the knot.
OpenMaya.MFnNurbsSurface.setKnotInV ( )
setKnotInV(index, param) -> self

Sets the value of an existing V knot. V knots are indexed from 0 to
numKnotsInV-1. Note that this method does not insert a new knot, it
simply changes the value of an existing knot.

If a knot value is set that breaks the non-decreasing requirement
for the knot array, the knot value will be changed and an exception
raised.

* index   (int) - V index of the knot to set.
* param (float) - New parameter value for the knot.
OpenMaya.MFnNurbsSurface.setKnotsInU ( )
setKnotsInU(params, startIndex, endIndex) -> self

Sets the values of a range of U knots.

* params     (MDoubleArray or seq of float)
       - Parameter values to set at the knots. One value
         per knot in the range.
* startIndex (int) - Index of the first U knot to set.
* endIndex   (int) - Index of the last U knot to set.
OpenMaya.MFnNurbsSurface.setKnotsInV ( )
setKnotsInV(params, startIndex, endIndex) -> self

Sets the values of a range of V knots.

* params     (MDoubleArray or seq of float)
       - Parameter values to set at the knots. One value
         per knot in the range.
* startIndex (int) - Index of the first V knot to set.
* endIndex   (int) - Index of the last V knot to set.
OpenMaya.MFnNurbsSurface.setUV ( )
setUV(uvId, u, v) -> self

Sets a single texture coordinate. If 'uvId' is greater than or equal
to numUVs then the surface's uv list will be grown to accommodate it.

Note that API methods that modify uv data work correctly either when
called through a plug-in node that is in the history of the shape,
or when used on a surface shape that does not have history.
Modifying uvs directly on a shape with history will result in the
modifications getting over-written by the next evaluation of the
history attached to the shape.

* uvId (int) - Index of the element in the surface's uv list to set.
* u  (float) - U value to set the uv to.
* v  (float) - V value to set the uv to.
OpenMaya.MFnNurbsSurface.setUVs ( )
setUVs(uList, vList) -> self

Sets all of the texture coordinates (uvs) for this surface. The 
arrays must be of equal length and must be at least of length numUVs.
If the arrays are larger than numUVs then the uv list for this surface
will be grown to accommodate the new uv values.

After using this method to set the UV values, you can call
assignUVs to assign the corresponding UVids to the geometry.

Note that API methods that modify uv data work correctly either when
called through a plug-in node that is in the history of the shape,
or when used on a surface shape that does not have history.
Modifying uvs directly on a shape with history will result in the
modifications getting over-written by the next evaluation of the
history attached to the shape.

* uList (MFloatArray or seq of float) - U values to set
* vList (MFloatArray or seq of float) - V values to set
OpenMaya.MFnNurbsSurface.tangents ( )
tangents(uParam, vParam, space=kObject) -> (MVector, MVector)

Returns the tangents in the U and V directions at a given parameter
value on the surface. The returned tangent vectors are normalized.

This method does not fail if the given parameter lies within a
trimmed away region of a trimmed surface. Use isPointInTrimmedRegion()
to determine if the uv point lies within such a region.

* uParam (float) - U parameter value at which to obtain the tangents.
* vParam (float) - V parameter value at which to obtain the tangents.
* space    (int) - An MSpace constant giving the coordinate space
       in which to perform the operation
OpenMaya.MFnNurbsSurface.trim ( )
trim(regionsToKeepU, regionsToKeepV, keepHistory=False) -> self

Trims the surface to its curves on surface. Regions which are kept
are specified by passing in arrays of u,v parameters.

This method will create a new trimmed surface in the DAG. The surface
attached to this function set will remain unchanged.

* regionsToKeepU (MDoubleArray or seq of float)
            - U parameters of points within the regions
              to be kept.
* regionsToKeepV (MDoubleArray or seq of float)
            - V parameters of points within the regions
              to be kept.
* keepHistory    (bool) - Determines whether the construction history
              of the operation should be retained.
OpenMaya.MFnNurbsSurface.updateSurface ( )
updateSurface() -> self

Signals that this surface has changed and needs to be recalculated.

This method is useful when a large number of CVs for the surface are
being modified. Instead of updating the surface every time a CV is
changed it is more efficient to call this method once after all the
updates are complete.

Property Documentation

OpenMaya.MFnNurbsSurface.dataObject
static
 If the functionset was created using an MFn.kNurbsSurfaceData object
 then this attribute will contain an MObject which references that
 data object. Otherwise it will contain MObject.kNullObj.
OpenMaya.MFnNurbsSurface.degreeInU
static
 The degree of the surface in the U direction or 0 if the degree
 cannot be determined.
OpenMaya.MFnNurbsSurface.degreeInV
static
 The degree of the surface in the V direction or 0 if the degree
 cannot be determined.
OpenMaya.MFnNurbsSurface.formInU
static
 Form of the surface in the U direction. Can be one of kOpen,
 kClosed, kPeriodic or kInvalid.
OpenMaya.MFnNurbsSurface.formInV
static
 Form of the surface in the V direction. Can be one of kOpen,
 kClosed, kPeriodic or kInvalid.
OpenMaya.MFnNurbsSurface.hasHistoryOnCreate
static
 True if the surface was created with history.
OpenMaya.MFnNurbsSurface.isBezier
static
 True if the knot spacing gives a Bezier surface.
OpenMaya.MFnNurbsSurface.isFoldedOnBispan
static
 True if surface contains are any folds or creases on bispan
 boundaries, including trimmed regions.
OpenMaya.MFnNurbsSurface.isTrimmedSurface
static
 True if the surface is a trimmed surface.
OpenMaya.MFnNurbsSurface.isUniform
static
 True if the knot spacing is uniform.
OpenMaya.MFnNurbsSurface.knotDomainInU
static
 A tuple containing a pair of floats corresponding to the maximum and
 minimum U parameter values for this surface.
OpenMaya.MFnNurbsSurface.knotDomainInV
static
 A tuple containing a pair of floats corresponding to the maximum and
 minimum V parameter values for this surface.
OpenMaya.MFnNurbsSurface.numCVsInU
static
 Number of CVs in the surface in the U direction or 0 if the number
 of CVs cannot be determined.
OpenMaya.MFnNurbsSurface.numCVsInV
static
 Number of CVs in the surface in the V direction or 0 if the number
 of CVs cannot be determined.
OpenMaya.MFnNurbsSurface.numKnotsInU
static
 Number of knots in the surface in the U direction or 0 if the number
 of knots cannot be determined.
OpenMaya.MFnNurbsSurface.numKnotsInV
static
 Number of knots in the surface in the V direction or 0 if the number
 of knots cannot be determined.
OpenMaya.MFnNurbsSurface.numNonZeroSpansInU
static
 Number of spans in the U direction which are non-zero (i.e. their
 max param value is greater than their min param value).
OpenMaya.MFnNurbsSurface.numNonZeroSpansInV
static
 Number of spans in the V direction which are non-zero (i.e. their
 max param value is greater than their min param value).
OpenMaya.MFnNurbsSurface.numPatches
static
 Number of non-zero patches on the surface.
OpenMaya.MFnNurbsSurface.numPatchesInU
static
 Number of non-zero patches in the U direction.
OpenMaya.MFnNurbsSurface.numPatchesInV
static
 Number of non-zero patches in the V direction.
OpenMaya.MFnNurbsSurface.numRegions
static
 Number of trimmed regions for this surface or 0 if the surface is
 not a trimmed surface.
OpenMaya.MFnNurbsSurface.numSpansInU
static
 Number of spans in the U direction, including zero-length spans.
OpenMaya.MFnNurbsSurface.numSpansInV
static
 Number of spans in the V direction, including zero-length spans.
OpenMaya.MFnNurbsSurface.numUVs
static
 Number of texture (uv) coordinates for this surface. The uvs are
 stored in a list which is referenced by patches requiring textures
 on a per-patch per-patchCorner basis. This attribute contains the
 number of elements in this list.