class MFnNurbsSurface

Jump to documentation

: public MFnDagNode NURBS surface function set. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnNurbsSurface < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnNurbsSurface ( const MObject & object, MStatus * ReturnStatus = NULL )
enum Form
kInvalid
kOpen
kClosed
kPeriodic
kLast
MObject create ( const MPointArray &controlVertices, const MDoubleArray &uKnotSequences, const MDoubleArray &vKnotSequences, unsigned int degreeInU, unsigned int degreeInV, Form formU, Form formV, bool createRational, MObject parentOrOwner = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject copy ( const MObject &source, MObject parentOrOwner = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject cv ( unsigned int indexU, unsigned int indexV, MStatus * ReturnStatus = NULL )
MObject cvsInU ( unsigned int startIndex, unsigned int endIndex, unsigned int rowIndex, MStatus * ReturnStatus = NULL )
MObject cvsInV ( unsigned int startIndex, unsigned int endIndex, unsigned int rowIndex, MStatus * ReturnStatus = NULL )
MStatus getCVs ( MPointArray & array, MSpace::Space space = MSpace::kObject ) const
MStatus setCVs ( const MPointArray & array, MSpace::Space space = MSpace::kObject )
MStatus getCV ( unsigned int indexU, unsigned int indexV, MPoint & pnt, MSpace::Space space = MSpace::kObject ) const
MStatus setCV ( unsigned int indexU, unsigned int indexV, MPoint & pnt, MSpace::Space space = MSpace::kObject ) const
Form formInU ( MStatus * ReturnStatus = NULL ) const
Form formInV ( MStatus * ReturnStatus = NULL ) const
bool isBezier ( MStatus * ReturnStatus = NULL ) const
bool isUniform ( MStatus * ReturnStatus = NULL ) const
bool isKnotU ( double param, MStatus * ReturnStatus = NULL ) const
bool isKnotV ( double param, MStatus * ReturnStatus = NULL ) const
bool isParamOnSurface ( double paramU, double paramV, MStatus * ReturnStatus = NULL ) const
MStatus getKnotDomain ( double &startU, double &endU, double &startV, double &endV ) const
int degreeU ( MStatus * ReturnStatus = NULL ) const
int degreeV ( MStatus * ReturnStatus = NULL ) const
int numSpansInU ( MStatus * ReturnStatus = NULL ) const
int numSpansInV ( MStatus * ReturnStatus = NULL ) const
int numNonZeroSpansInU ( MStatus * ReturnStatus = NULL ) const
int numNonZeroSpansInV ( MStatus * ReturnStatus = NULL ) const
int numCVsInU ( MStatus * ReturnStatus = NULL ) const
int numCVsInV ( MStatus * ReturnStatus = NULL ) const
int numKnotsInU ( MStatus * ReturnStatus = NULL ) const
int numKnotsInV ( MStatus * ReturnStatus = NULL ) const
MStatus getKnotsInU ( MDoubleArray &array ) const
MStatus getKnotsInV ( MDoubleArray &array ) const
MStatus setKnotsInU ( const MDoubleArray &array, unsigned int startIndex, unsigned int endIndex )
MStatus setKnotsInV ( const MDoubleArray &array, unsigned int startIndex, unsigned int endIndex )
double knotInU ( unsigned int index, MStatus * ReturnStatus = NULL ) const
double knotInV ( unsigned int index, MStatus * ReturnStatus = NULL ) const
MStatus setKnotInU ( unsigned int index, double param )
MStatus setKnotInV ( unsigned int index, double param )
MStatus removeKnotInU ( double atThisParam, bool removeAll = false )
MStatus removeKnotInV ( double atThisParam, bool removeAll = false )
MStatus removeOneKnotInU ( double atThisParam )
MStatus removeOneKnotInV ( double atThisParam )
MVector normal ( double paramInU, double paramInV, MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MStatus getTangents ( double paramInU, double paramInV, MVector &vectorInU, MVector &vectorInV, MSpace::Space space = MSpace::kObject ) const
MStatus getDerivativesAtParm ( double paramInU, double paramInV, MPoint &pos, MVector &dU, MVector &dV, MSpace::Space space, MVector * dUU = NULL, MVector * dVV = NULL, MVector * dUV = NULL) const
bool isFoldedOnBispan () const
double area ( double tolerance = kMFnNurbsEpsilon, MStatus * ReturnStatus = NULL ) const
double area ( MSpace::Space space, double tolerance = kMFnNurbsEpsilon, MStatus * ReturnStatus = NULL ) const
MPoint closestPoint ( const MPoint &toThisPoint, double * paramU = NULL, double * paramV = NULL, bool ignoreTrimBoundaries = false, double tolerance = kMFnNurbsEpsilon, MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MPoint closestPoint ( const MPoint &toThisPoint, bool paramAsStart, double * paramU = NULL, double * paramV = NULL, bool ignoreTrimBoundaries = false, double tolerance = kMFnNurbsEpsilon, MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
bool isPointOnSurface ( const MPoint &point, double tolerance = kMFnNurbsEpsilon, MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MStatus getParamAtPoint ( const MPoint & atThisPoint, double &paramU, double &paramV, MSpace::Space space = MSpace::kObject ) const
OBSOLETE
MStatus getParamAtPoint ( const MPoint & atThisPoint, double &paramU, double &paramV, bool ignoreTrimBoundaries, MSpace::Space space = MSpace::kObject , double tolerance = kMFnNurbsEpsilon) const
MStatus getPointAtParam ( double paramU, double paramV, MPoint &point, MSpace::Space space = MSpace::kObject ) const
double distanceToPoint ( const MPoint &pt, MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MObject tesselate ( MTesselationParams & parms = MTesselationParams::fsDefaultTesselationParams , MObject parentOrOwner = MObject::kNullObj , MStatus * ReturnStatus = NULL )
bool intersect ( const MPoint &rayStartingPoint, const MVector &alongThisDirection, double &u, double &v, MPoint &intersectionData, double tolerance = kMFnNurbsEpsilon, MSpace::Space space = MSpace::kObject , bool calculateDistance = false, double * distance = NULL, bool calculateExactHit = false, bool* wasExactHit = NULL, MStatus * ReturnStatus = NULL ) const
bool intersect ( const MPoint &rayStartingPoint, const MVector &alongThisDirection, MDoubleArray &u, MDoubleArray &v, MPointArray &intersectionData, double tolerance = kMFnNurbsEpsilon, MSpace::Space space = MSpace::kObject , bool calculateDistance = false, MDoubleArray * distances = NULL, bool calculateExactHit = false, bool* wasExactHit = NULL, MStatus * ReturnStatus = NULL ) const
bool hasHistoryOnCreate ( MStatus * ReturnStatus = NULL )
MStatus updateSurface ()
enum BoundaryType
kInvalidBoundary
kOuter
kInner
kSegment
kClosedSegment
bool isTrimmedSurface ( MStatus * ReturnStatus = NULL )
unsigned int numRegions ( MStatus * ReturnStatus = NULL )
bool isFlipNorm ( unsigned int region, MStatus * ReturnStatus = NULL )
unsigned int numBoundaries ( unsigned int region, MStatus * ReturnStatus = NULL)
BoundaryType boundaryType ( unsigned int region, unsigned int boundary, MStatus * ReturnStatus = NULL )
unsigned int numEdges ( unsigned int region, unsigned int boundary, MStatus * ReturnStatus = NULL )
MObjectArray edge ( unsigned int region, unsigned int boundary, unsigned int edge , bool paramEdge = false, MStatus * ReturnStatus = NULL )
bool isPointInTrimmedRegion ( double u, double v, MStatus * ReturnStatus = NULL )
MStatus getTrimBoundaries ( MTrimBoundaryArray & result, unsigned int region, bool paramEdge = true)
MStatus trimWithBoundaries (const MTrimBoundaryArray & mBoundaries, bool flipNormal = false, double e_tol = 1e-3, double pe_tol = 1e-5)
MStatus projectCurve ( MDagPath & curve, MVector * direction = NULL, bool constructionHistory = false )
MStatus trim ( MDoubleArray & locatorU, MDoubleArray & locatorV, bool constructionHistory = false )
unsigned int numPatches ( MStatus * ReturnStatus = NULL ) const
unsigned int numPatchesInU ( MStatus * ReturnStatus = NULL ) const
unsigned int numPatchesInV ( MStatus * ReturnStatus = NULL ) const
int numUVs ( MStatus * ReturnStatus = NULL ) const
MStatus setUVs ( const MFloatArray & uArray, const MFloatArray & vArray)
MStatus getUVs ( MFloatArray & uArray, MFloatArray & vArray ) const
MStatus setUV ( int uvId, float u, float v )
MStatus getUV ( int uvId, float & u, float & v ) const
MStatus getPatchUV ( int patchId, int cornerIndex, float & u, float & v ) const
MStatus getPatchUVs ( int patchId, MFloatArray & uArray, MFloatArray & vArray) const
MStatus getPatchUVid ( int patchId, int cornerIndex, int &uvId ) const
MStatus assignUV ( int patchId, int cornerIndex, int uvId )
MStatus assignUVs ( const MIntArray & uvCounts, const MIntArray & uvIds )
MStatus clearUVs ( )
MStatus getAssignedUVs ( MIntArray & uvCounts, MIntArray & uvIds) const
MObject tesselate ( MTesselationParams & parms, MStatus * ReturnStatus )
OBSOLETE

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Description

This is the function set for NURBS (Non-Uniform Rational B-spline) surfaces.

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 and 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.

Functions

MFnNurbsSurface:: MFnNurbsSurface ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnNurbsSurface:: MFnNurbsSurface ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnNurbsSurface:: MFnNurbsSurface ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnNurbsSurface:: MFnNurbsSurface ( const MDagPath & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MDagPath object.

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFn::Type MFnNurbsSurface:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kNurbsSurface

MFnNurbsSurface:: ~MFnNurbsSurface ()

Description

Destructor.

MObject MFnNurbsSurface:: create ( const MPointArray &controlVertices, const MDoubleArray &uKnotSequences, const MDoubleArray &vKnotSequences, unsigned int degreeInU, unsigned int degreeInV, MFnNurbsSurface::Form formU, MFnNurbsSurface::Form formV, bool createRational, MObject parentOrOwner, MStatus * ReturnStatus )

Description

Creates a nurbs surface from the specified data and sets this function set to operate on the new surface.

The parentOrOwner argument is used to specify the owner of the new surface.

If the parentOrOwner is kNurbsSurfaceData then the created surface will be of type kNurbsSurfaceGeom and will be returned. The parentOrOwner will become the owner of the new surface.

If parentOrOwner is NULL then a new transform will be created and returned which will be the parent for the surface. The new transform will be added to the DAG.

If parentOrOwner is a DAG node then the new surface will be returned and the parentOrOwner will become its parent.

Note that the knot vectors must be of length spans + 2*degree - 1.

Arguments

  • controlVertices an array of control vertices
  • uKnotSequences an array of U knot values
  • vKnotSequences an array of V knot values
  • degreeInU degree of first set of basis functions
  • degreeInV degree of second set of basis functions
  • formU open, closed, periodic in U
  • formV open, closed, periodic in V
  • createRational create as rational (true) or non-rational (false) surface
  • parentOrOwner specifies what to do with the surface. If a DAG object or NULL is given then a transform will be created for the new surface and placed under the specified (optional)parent. If kNurbsSurfaceData is given then the surface will become its data.
  • ReturnStatus Status code

Return Value

  • If parentOrOwner is NULL then the transform for this surface is returned
  • If parentOrOwner is a DAG object then the new surface shape is returned
  • The surface geometry is returned if parentOrOwner is of type kNurbsSurfaceData

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid parameters were specified.
  • MS::kInsufficientMemory No memory available.
  • MS::kLicenseFailure Application not licensed for attempted operation
  • MS::kFailure An object error has occurred.
  • MS::kInvalidForm Form was not one of the MFnNurbsSurface::Form types
  • MS::kInvalidNumberOfCVs Number of CVs doesn't match the number of knots. The number of CVs must be (numberOfUSpans+degreeInU)*(numberOfVSpans+degreeInV)
  • MS::kInvalidNumberOfKnots Number of knots in one direction is zero.
  • MS::kNotEnoughSpans Number of spans in one direction is zero. It should be (numberOfKnotsInU-(2*degreeInU)+1) or (numberOfKnotsInV-(2*degreeInV)+1)
  • MS::kDecreasingKnots Knot vector was found to be decreasing. eg. (0,0,0,1,1,0.9) It should be non-decreasing, ie. same or increasing is okay, eg. (0,0,0,1,1,1.1)
  • MS::kKnotMultiplicityTooHigh Knot vector has more than more than "degree" knots that are the same. It should have at most "degree" knots that are the same.

MObject MFnNurbsSurface:: copy (const MObject &source, MObject parentOrOwner, MStatus * ReturnStatus )

Description

This method creates a copy of a nurbs surface.

The parentOrOwner argument is used to specify the owner of the new surface.

If the parentOrOwner is kNurbsSurfaceData then the created surface will be of type kNurbsSurfaceGeom and will be returned. The parentOrOwner will become the owner of the new surface.

If parentOrOwner is NULL then a new transform will be created and returned which will be the parent for the surface. The new transform will be added to the DAG.

If parentOrOwner is a DAG node then the new surface will be returned and the parentOrOwner will become its parent.

Arguments

  • source the surface to be copied
  • parentOrOwner the DAG parent or kNurbsSurfaceData the new surface will belong to
  • ReturnStatus Status code

Return Value

  • If parentOrOwner is NULL then the transform for this surface is returned
  • If parentOrOwner is a DAG object then the new surface shape is returned
  • The surface geometry is returned if parentOrOwner is of type kNurbsSurfaceData

Status Codes

  • MS::kSuccess Surface was successfully created
  • MS::kInvalidParameter Invalid parameter specified
  • MS::kLicenseFailure Application not licensed for attempted operation
  • MS::kFailure Error creating surface

MObject MFnNurbsSurface:: cv ( unsigned int indexU, unsigned int indexV, MStatus * ReturnStatus )

Description

Returns a component for the specified CV.

Components are used to specify one or more CVs and are usefull in operating on groups of non-contiguous CVs for a curve or surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • indexU U index of CV
  • indexV V index of CV
  • ReturnStatus Status code

Return Value

  • The cv component

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid CV indicies specified.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MObject MFnNurbsSurface:: cvsInU ( unsigned int startIndex, unsigned int endIndex, unsigned int rowIndex, MStatus * ReturnStatus )

Description

Returns a component for the specified CVs.

Components are used to specify one or more CVs and are usefull in operating on groups of non-contiguous CVs for a curve or surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • startIndex start CV index in U
  • endIndex end CV index in U
  • rowIndex row index
  • ReturnStatus Status code

Return Value

  • The component for the CVs on the given U direction.

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid CV indicies specified.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MObject MFnNurbsSurface:: cvsInV ( unsigned int startIndex, unsigned int endIndex, unsigned int rowIndex, MStatus * ReturnStatus )

Description

Returns a component for the specified CVs on the given V direction.

Components are used to specify one or more CVs and are usefull in operating on groups of non-contiguous CVs for a curve or surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • startIndex start CV index in U
  • endIndex end CV index in U
  • rowIndex row index
  • ReturnStatus Status code

Return Value

  • The component for the CVs

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid CV indicies specified.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getCVs ( MPointArray &array, MSpace::Space space ) const

Description

Get the positions of the CVs on this surface. The returned group can be accessed via the MPointArray class. numCVsInU() * numCVsInV() points will be returned. Converting from uIndex, vIndex is done by "index = numCVsInV() * uIndex + vIndex".

Any modifications to these CVs will not affect this surface. setCVs should be called to modify the original surface. updateSurface should be called to cause the surface to redraw itself.

Arguments

  • array the array of point values for the CVs
  • space specifies the coordinate system for this operation

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setCVs ( const MPointArray &array, MSpace::Space space )

Description

Set the CVs for this surface to the given points. numCVsInU() * numCVsInV() points must be provided. Converting from uIndex, vIndex is done by "index = numCVsInV() * uIndex + vIndex".

Arguments

  • array The array of point values of the CVs
  • space specifies the coordinate system for this operation

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getCV ( unsigned int indexU, unsigned int indexV, MPoint & pnt, MSpace::Space space ) const

Description

Get the location of the specified CV.

Arguments

  • indexU U index of CV
  • indexV V index of CV
  • pnt storage for the CV location
  • space coordinate space for the CV
  • ReturnStatus Status code

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setCV ( unsigned int indexU, unsigned int indexV, MPoint & pt, MSpace::Space space ) const

Description

Set the location of the specified CV.

If the surface is periodic then overlapping CVs will be ignored, that is, only indices in U and V that are less that the number of spans in U and V respectively will be considered.

Arguments

  • indexU U index of CV
  • indexV V index of CV
  • pt new location for the CV
  • space coordinate space for the CV
  • ReturnStatus Status code

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid parameter specified.
  • MS::kFailure An object error has occurred.

MFnNurbsSurface::Form MFnNurbsSurface:: formInU ( MStatus * ReturnStatus ) const

Description

Return the form of this surface in U. Form can be kOpen, kClosed, kPeriodic, or kUnknownForm.

Arguments

  • ReturnStatus Status code

Return Value

  • The form of this surface in U

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MFnNurbsSurface::Form MFnNurbsSurface:: formInV ( MStatus * ReturnStatus ) const

Description

Return the form of this surface in V. Form can be kOpen, kClosed, kPeriodic, or kUnknownForm.

Arguments

  • ReturnStatus Status code

Return Value

  • The form of this surface in V

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isUniform ( MStatus * ReturnStatus ) const

Description

Determine if the knot spacing is uniform.

Arguments

  • ReturnStatus Status code

Return Value

  • true Uniform knot spacing
  • false Non-uniform knot spacing

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isBezier ( MStatus * ReturnStatus ) const

Description

Determine if the knot spacing gives us Bezier surface.

Arguments

  • ReturnStatus Status code

Return Value

  • true Bezier surface
  • false B-spline surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isKnotU ( double param, MStatus * ReturnStatus ) const

Description

Check if the specified parameter value is a knot value.

Arguments

  • param parameter value to test
  • ReturnStatus Status code

Return Value

  • true parameter value is a knot value
  • false parameter value is not a knot value

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Knot value is out of range.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isKnotV ( double param, MStatus * ReturnStatus ) const

Description

Check if the specified parameter value is a knot value.

Arguments

  • param parameter value to test
  • ReturnStatus Status code

Return Value

  • true parameter value is a knot value
  • false parameter value is not a knot value

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Knot value is out of range.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isParamOnSurface ( double paramU, double paramV, MStatus * ReturnStatus) const

Description

Check if the specified parameter is on this surface.

Arguments

  • paramU U pararmter value
  • paramV V pararmter value
  • ReturnStatus Status code

Return Value

  • true parameter value is on this surface
  • false parameter value is not on this surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getKnotDomain ( double &startU, double &endU, double &startV, double &endV ) const

Description

Returns the maximum and minimum U and V paramter values for this surface.

Arguments

  • startU Start U parameter value
  • endU End U parameter value
  • startV Start V parameter value
  • endV End V parameter value

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: degreeU ( MStatus * ReturnStatus ) const

Description

Returns the degree of the surface in U (1 - 3).

Arguments

  • ReturnStatus Status code

Return Value

  • The degree in U

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: degreeV ( MStatus * ReturnStatus ) const

Description

Returns the degree of the surface in V (1 - 3).

Arguments

  • ReturnStatus Status code

Return Value

  • The degree in V

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numSpansInU ( MStatus * ReturnStatus ) const

Description

Returns the number of spans in the u direction.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of spans in U

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numSpansInV ( MStatus * ReturnStatus ) const

Description

Returns the number of spans in the v direction.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of spans in V

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numNonZeroSpansInU ( MStatus * ReturnStatus ) const

Description

Returns the number of non-zero spans in the U direction. This value will be equivalent to the value returned by numSpansInU() if all of the internal (non-end) knots are of multiplicity 1. If some of the internal knots have higher multiplicity, this value will be lower than that returned by numSpansInU(). You can use the number of non-zero spans to count the number of visual spans on the surface in the U direction, since the empty (zero) spans do not appear as a separate span/patch in the display.

Further, the NURBS face components have the valid index range bounded by this value in U direction (i.e., the NURBS face component index runs from 0 to numNonEmptySpansInU()-1 inclusivelly.)

Arguments

  • ReturnStatus Status code

Return Value

  • The number of non-empty (non-zero, visual) spans in U

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numNonZeroSpansInV ( MStatus * ReturnStatus ) const

Description

Returns the number of non-zero spans in the V direction. This value will be equivalent to the value returned by numSpansInV() if all of the internal (non-end) knots are of multiplicity 1. If some of the internal knots have higher multiplicity, this value will be lower than that returned by numSpansInV(). You can use the number of non-zero spans to count the number of visual spans on the surface in the V direction, since the empty (zero) spans do not appear as a separate span/patch in the display.

Further, the NURBS face components have the valid index range bounded by this value in V direction (i.e., the NURBS face component index runs from 0 to numNonEmptySpansInV()-1 inclusivelly.)

Arguments

  • ReturnStatus Status code

Return Value

  • The number of non-empty (non-zero, visual) spans in V

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numCVsInU ( MStatus * ReturnStatus ) const

Description

Returns the number of CVs in the U direction (degree + spans).

Arguments

  • ReturnStatus Status code

Return Value

  • The number of CVs in U

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numCVsInV ( MStatus * ReturnStatus ) const

Description

Returns the number of CVs in the V direction (degree + spans).

Arguments

  • ReturnStatus Status code

Return Value

  • The number of CVs in V

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numKnotsInU ( MStatus * ReturnStatus ) const

Description

Returns the number of knots in U including multiple end knots (spans + 2 * degree - 1).

Arguments

  • ReturnStatus Status code

Return Value

  • The number of knots in U

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numKnotsInV ( MStatus * ReturnStatus ) const

Description

Returns the number of knots in V including multiple end knots (spans + 2 * degree - 1).

Arguments

  • ReturnStatus Status code

Return Value

  • The number of knots in V

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getKnotsInU ( MDoubleArray &array ) const

Description

Get the knots along the U direction for this surface.

Arguments

  • array Storage for the knot values

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getKnotsInV ( MDoubleArray &array ) const

Description

Get the knots along the V direction for this surface.

Arguments

  • array Storage for the knot values

Return Value Status code

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setKnotsInU ( const MDoubleArray &array, unsigned int startIndex, unsigned int endIndex )

Description

Set the specified U knot values for this surface.

Arguments

  • array The knot values to be set
  • startIndex The start knot index
  • endIndex The end knot index

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Knots are in decreasing order or the knot index values are invalid.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setKnotsInV ( const MDoubleArray &array, unsigned int startIndex, unsigned int endIndex )

Description

Set the specified V knot values for this surface.

Arguments

  • array The knot values to be set
  • startIndex The start knot index
  • endIndex The end knot index

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Knots are in decreasing order or the knot index values are invalid.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: removeKnotInU ( double atThisParam, bool removeAll )

Description

Remove the U knot(s) at the specified parameter value from this surface. If there are multiple knots at this parameter then removeAll is used to specify how to do the removal.

Arguments

  • atThisParam Parameter of knot to be removed
  • removeAll If true then remove all the knots at the given parameter, otherwise remove all except one knot

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: removeKnotInV ( double atThisParam, bool removeAll )

Description

Remove the V knot(s) at the specified parameter value from this surface. If there are multiple knots at this parameter then removeAll is used to specify how to do the removal.

Arguments

  • atThisParam Parameter of knot to be removed
  • removeAll If true then remove all the knots at the given parameter, otherwise remove all except one knot

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: removeOneKnotInU ( double atThisParam )

Description

Remove one U knot at the specified parameter value from this surface.

Arguments

  • atThisParam Parameter of knot to be removed

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: removeOneKnotInV ( double atThisParam )

Description

Remove one V knot at the specified parameter value from this surface.

Arguments

  • atThisParam Parameter of knot to be removed

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

double MFnNurbsSurface:: knotInU ( unsigned int index, MStatus * ReturnStatus) const

Description

Retrieve the given knot value from this surface at the specified U index. Knots are indexed from 0 to numKnots-1.

Arguments

  • index The U index of the knot value to get
  • ReturnStatus Status code

Return Value

  • The knot value

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

double MFnNurbsSurface:: knotInV ( unsigned int index, MStatus * ReturnStatus) const

Description

Retrieve the given knot value from this surface at the specified V index. Knots are indexed from 0 to numKnots-1.

Arguments

  • index The V index of the knot value to get
  • ReturnStatus Status code

Return Value

  • The knot value

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setKnotInU ( unsigned int index, double param )

Description

Set the value of the given existing knot at the specified U index. Knots are indexed from 0 to numKnots-1. Note that this routine does not insert a new knot, it simply changes the value of a knot that already exists.

If a knot value is set that breaks the non-decreasing requirement for the knot array, the knot value will be changed and a kInvalidParameter error will be returned.

Arguments

  • index The U index of the existing knot to be set
  • param The new parameter value for the knot

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Knot index out of range or new knot value breaks the non-decreasing requirement for the knot array.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setKnotInV ( unsigned int index, double param )

Description

Set the value of the given existing knot at the specified V index. Knots are indexed from 0 to numKnots-1. Note that this routine does not insert a new knot, it simply changes the value of a knot that already exists.

If a knot value is set that breaks the non-decreasing requirement for the knot array, the knot value will be changed and a kInvalidParameter error will be returned.

Arguments

  • index The V index of the existing knot to be set
  • param The new value for the knot

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Knot index out of range or new knot value breaks the non-decreasing requirement for the knot array.
  • MS::kFailure An object error has occurred.

MVector MFnNurbsSurface:: normal ( double paramInU, double paramInV, MSpace::Space space, MStatus * ReturnStatus ) const

Description

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

Arguments

  • paramInU U parameter to to obtain normal at
  • paramInV V parameter to to obtain normal at
  • space Coordinate space for the returned vector
  • ReturnStatus Status code

Return Value

  • The normal vector

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Error getting normal.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getTangents ( double paramInU, double paramInV, MVector &vectorInU, MVector &vectorInV, MSpace::Space space ) const

Description

Retrieve the tangents in the U and V directions at the 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 the 'isPointInTrimmedRegion' method to determine if the uv point lies within such a region.

Arguments

  • paramInU U parameter value to obtain tangents at
  • paramInV V parameter value to obtain tangents at
  • vectorInU Storage for the U tangent vector
  • vectorInV Storage for the V tangent vector
  • space Coordinate space for the returned vectors

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Error getting tangents.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getDerivativesAtParm ( double paramInU, double paramInV, MPoint & pos, MVector &dU, MVector &dV, MSpace::Space space, MVector * dUU, MVector * dVV, MVector * dUV) const

Description

Evaluate the surface at the given (u,v) coordinate returning position, first derivatives and optionally second derivative information. The returned derivative vectors are not normalized. If either dUU, dVV, or dUV is set to NULL, the second derivatives will not be computed and execution time wil be faster.

Arguments

  • paramInU U parameter value to evaluate
  • paramInV V parameter value to evaluate
  • pos Storage for the XYZ position of (u,v)
  • du Storage for the first order partial derivative with respect to u
  • dv Storage for the first order partial derivative with respect to v
  • space Coordinate space for the returned vectors
  • duu Pointer to storage for the second order partial derivative with respect to u
  • dvv Pointer to storage for the second order partial derivative with respect to v
  • duv Pointer to storage for the second order partial derivative with respect to u then v

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Parameters do not define a point on the surface
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isFoldedOnBispan ( ) const

Description

Evaluate the surface to determine if it contains any folds or creases. The entire surface including trimmed regions is examined. This function will only check for folds on bispan boundaries and thus will not catch all cases.

Return Value

  • true There are folds or creases detected
  • false The surface is believed to have continuous curvature

double MFnNurbsSurface:: area ( double tolerance, MStatus * ReturnStatus ) const

Description

Calculates the surface area of this nurbs surface. A value of 0.0 will be returned if the area cannot be determined successfully.

Arguments

  • tolerance tolerance value to be used for computations
  • ReturnStatus Status code

Return Value

  • The area of this surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

double MFnNurbsSurface:: area ( MSpace::Space space, double tolerance, MStatus * ReturnStatus ) const

Description

Calculates the surface area of this nurbs surface in world or local space. A value of 0.0 will be returned if the area cannot be determined successfully.

Arguments

  • space Coordinate space for the returned vectors
  • tolerance Tolerance value to be used for computations
  • ReturnStatus Status code

Return Value

  • The area of this surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MPoint MFnNurbsSurface:: closestPoint ( const MPoint &toThisPoint, double * paramU, double * paramV, bool ignoreTrimBoundaries, double tolerance, MSpace::Space space, MStatus * ReturnStatus ) const

Description

Return the closest point on this surface to the given point.

Arguments

  • toThisPoint Point to be compared
  • paramU pointer to a double. If non-null, on successful returns this will contain the U parameter value of the returned point.
  • paramV pointer to a double. If non-null, on successful returns this will contain the V parameter value of the returned point.
  • ignoreTrimBoundaries if this is true and the surface is trimmed, look for the point on the entire, untrimmed surface ignoring any trim curves.
  • tolerance tolerance value to be used for computations
  • space Coordinate space in which perform this operation
  • ReturnStatus Status code

Return Value

  • The closest point on this surface to the given point

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

MPoint MFnNurbsSurface:: closestPoint ( const MPoint &toThisPoint, bool paramAsStart, double * paramU, double * paramV, bool ignoreTrimBoundaries, double tolerance, MSpace::Space space, MStatus * ReturnStatus ) const

Description

Return the closest point on this surface to the given point.

Performance can be greatly increased by supplying a starting parameter value that is reasonably close to the final point and setting {em paramAsStart} to true. However great care must be taken with the use of this parameter and the choice of starting value.

If {em paramAsStart} is true, the algorithm 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.

Arguments

  • toThisPoint Point to be compared
  • paramAsStart If true use the value pointed to by paramU and paramV as a starting point for the search
  • paramU pointer to a double. If non-null, on successful returns this will contain the U parameter value of the returned point.
  • paramV pointer to a double. If non-null, on successful returns this will contain the V parameter value of the returned point.
  • ignoreTrimBoundaries if this is true and the surface is trimmed, look for the point on the entire, untrimmed surface ignoring any trim curves.
  • tolerance tolerance value to be used for computations
  • space Coordinate space in which perform this operation
  • ReturnStatus Status code

Return Value

  • The closest point on this surface to the given point

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isPointOnSurface ( const MPoint &point, double tolerance, MSpace::Space space, MStatus * ReturnStatus ) const

Description

Check if the given point is on this surface.

Arguments

  • point Point to test
  • tolerance tolerance value to be used for computations
  • space Coordinate space for this operation
  • ReturnStatus Status code

Return Value

  • true the given point is on this surface
  • false the given point is not on this surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getParamAtPoint ( const MPoint & atThisPoint, double &paramU, double &paramV, MSpace::Space space ) const

Description

This method is obsolete and simply calles the overloaded getParamAtPoint method with {em ignoreTrimBoundaries} set to false.

MStatus MFnNurbsSurface:: getParamAtPoint ( const MPoint & atThisPoint, double &paramU, double &paramV, bool ignoreTrimBoundaries, MSpace::Space space, double tolerance ) const

Description

Get the parameter value corresponding to the given point on the surface (or underlying surface).

Note, when ignoreTrimBoundaries if false, the UV parameters will still be returned if found on the untrimmed surface even though MS::kFailure is returned. This may be useful in cases where you are walking a trim edge and points are determined to be trimmed away because of slight differences between the trim edge and the actual trimmed surface.

Arguments

  • atThisPoint Location of parameter to obtain
  • paramU storage for the U parameter value
  • paramV storage for the V parameter value
  • ignoreTrimBoundaries if this is true and the surface is trimmed, look for the param on the entire, untrimmed surface ignoring any trim curves.
  • space Coordinate space in which to perform this operation
  • tolerance tolerance used in this operation

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid parameter specified.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getPointAtParam ( double paramU, double paramV, MPoint &point, MSpace::Space space ) const

Description

Finds the point corresponding to the given parameter value on the surface.

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

Arguments

  • paramU U parameter value
  • paramV V parameter value
  • point storage for the found point
  • space Coordinate space in which to perform this operation

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid parameter specified.
  • MS::kFailure An object error has occurred.

double MFnNurbsSurface:: distanceToPoint ( const MPoint &pt, MSpace::Space space, MStatus * ReturnStatus ) const

Description

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

Arguments

  • pt Point to calculate distance from
  • space Coordinate space for which to perform operation
  • ReturnStatus Status code

Return Value

  • The distance to the given point from this surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred.

MObject MFnNurbsSurface:: tesselate ( MTesselationParams & parms, MObject parentOrOwner, MStatus * ReturnStatus )

Description

Performs tesselation on this surface and create a new mesh in the DAG. The type of tesselation can be controlled by providing the tesselation parameters (see MTesselationParams).

The parentOrOwner argument is used to specify the owner of the new surface.

If the parentOrOwner is kMeshData then the created surface will be of type kMeshGeom and will be returned. The parentOrOwner will become the owner of the new mesh.

If parentOrOwner is NULL then a new transform will be created and returned which will be the parent for the mesh. The new transform will be added to the DAG.

If parentOrOwner is a DAG node then the new mesh will be returned and the parentOrOwner will become its parent.

Arguments

  • parms Tesselation parameters
  • parentOrOwner the DAG parent or kMeshData the new mesh will belong to
  • ReturnStatus Status code

Return Value

  • If parentOrOwner is NULL then the transform for this surface is returned
  • If parentOrOwner is a DAG object then the new surface shape is returned
  • The surface geometry is returned if parentOrOwner is of type kMeshData

Status Codes

  • MS::kSuccess Method successful
  • MS::kLicenseFailure Application not licensed for attempted operation
  • MS::kFailure Object error

bool MFnNurbsSurface:: intersect (const MPoint &rayStartingPoint, const MVector &alongThisDirection, double & u, double & v, MPoint &pntOfIntersection, double tolerance, MSpace::Space space, bool calculateDistance, double * distance, bool calculateExactHit, bool * wasExactHit, MStatus * ReturnStatus ) const

Description

This function determines the closest point of intersection of this spline surface with a ray (a vector at a point).

Arguments

  • reyStartingPoint Starting location of ray to test
  • alongThisDirection Direction of ray to test
  • u U parameter of intersection (if any)
  • v V parameter of intersection (if any)
  • pntOfIntersection Storage for closest point of intersection (if any)
  • tolerance The epsilon value in the calculation
  • space Specifies the coordinate system for this operation
  • calculateDistance Specifies whether to calculate the distance of the startPoint to the point of intersection
  • distance Storage for the distance if it is calculated
  • calculateExactHit Specifies whether to determine if the point of intersection actually hit the object or just came within tolerance of it
  • wasExactHit Storage for exact hit calculation
  • ReturnStatus Status code

Return Value

  • true An intersection point has been found
  • false No intersection point found

Status Codes

  • MS::kSuccess Method successful
  • MS::kFailure Object error

bool MFnNurbsSurface:: intersect (const MPoint &rayStartingPoint, const MVector &alongThisDirection, MDoubleArray & uArray, MDoubleArray & vArray, MPointArray &points, double tolerance, MSpace::Space space, bool calculateDistance, MDoubleArray * distances, bool calculateExactHit, bool * wasExactHit, MStatus * ReturnStatus ) const

Description

This function determines all the points of intersection of this spline surface with a ray (a vector at a point).

Arguments

  • reyStartingPoint Starting location of ray to test
  • alongThisDirection Direction of ray to test
  • uArray U parameters of intersection (if any)
  • vArray V parameters of intersection (if any)
  • points Storage for points of intersection (if any)
  • tolerance The epsilon value in the calculation
  • space Specifies the coordinate system for this operation
  • calculateDistance Specifies whether to calculate the distances of the startPoint to the all the points of intersection
  • distances Storage for the distances (if calculated)
  • calculateExactHit Specifies whether to determine if the point of intersection actually hit the object or just came within tolerance of it
  • wasExactHit Storage for exact hit calculation
  • ReturnStatus Status code

Return Value

  • true An intersection point has been found
  • false No intersection point found

Status Codes

  • MS::kSuccess Method successful
  • MS::kFailure Object error

bool MFnNurbsSurface:: hasHistoryOnCreate ( MStatus * ReturnStatus )

Description

This method determines if the shape was created with history.

If the object that this function set is attached to is not a shape then this method will fail.

Arguments

  • ReturnStatus

Return Value

  • true shape has history
  • false shape does not have history

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: updateSurface ()

Description

This method 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 updating all of the CVs.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isTrimmedSurface ( MStatus * ReturnStatus )

Description

This method determines if this surface is a trimmed surface.

Arguments

  • ReturnStatus

Return Value

  • true surface is trimmed
  • false surface is not trimmed

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MFnNurbsSurface:: numRegions ( MStatus * ReturnStatus )

Description

Returns the number of trimmed regions for this surface or 0 if the surface is not 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.

Arguments

  • ReturnStatus

Return Value

  • The number of regions for this surface

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MFnNurbsSurface:: isFlipNorm ( unsigned int region, MStatus * ReturnStatus )

Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • true normal = -dS/du X dS/dv
  • false normal = dS/du X dS/dv

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MFnNurbsSurface:: numBoundaries ( unsigned int region, MStatus * ReturnStatus )

Description

Returns the number of boudaries 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.

Arguments

  • region The trimmed region to examine
  • ReturnStatus status code

Return Value

  • The number of boundaries for the specified region

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MFnNurbsSurface::BoundaryType MFnNurbsSurface:: boundaryType ( unsigned int region, unsigned int boundary, MStatus * ReturnStatus )

Description

Returns the type of the specified boundary. The surface must be a trimmed surface.

Possible boundary types are Inner, kOuter, kSegment, kClosedSegment, and kInvalidBoundary

Arguments

  • region the region to examine
  • boundary the boundary to examine
  • ReturnStatus status code

Return Value

  • The boundary type
    • kInner an inner boundary, clockwise
    • kOuter an outer boundary, counter clockwise
    • kSegment a boundary segment (a curve on face)
    • kClosedSegment a closed boundary segment (a closed curve on face)
    • kInvalidBoundary an invalid boundary type

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MFnNurbsSurface:: numEdges ( unsigned int region, unsigned int boundary, MStatus * ReturnStatus )

Description

Return 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.

Arguments

  • region Region to examine
  • boundary Boundary to examine
  • ReturnStatus Status code

Return Value

  • The number of edges for the specified boundary

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MObjectArray MFnNurbsSurface:: edge ( unsigned int region, unsigned int boundary, unsigned int edge , bool paramEdge, MStatus * ReturnStatus )

Description

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 the edge may consist of more than one curve. The returned edge, or trim curve, can be a 2D parameter edge or a 3D edge curve. To identify an edge you must specify the trimmed region, the boundary of that region, and the edge of that boundary.

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.

Arguments

  • region the trimmed region containing the edge
  • boundary the boundary to examine
  • edge the boundary edge to examine
  • paramEdge if true then 2D param edges are returned, otherwise a 3D edge is returned.
  • ReturnStatus status code

Return Value

  • A curve for the specified edge

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid region, boundary or edge
  • MS::kInsufficientMemory Out of memory.

bool MFnNurbsSurface:: isPointInTrimmedRegion ( double u, double v, MStatus * ReturnStatus )

Description

Returns true 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.

Arguments

  • u u parameter of point on surface to test
  • v v parameter of point on surface to test
  • ReturnStatus status code

Return Value

  • true point on surface is within a trimmed away region
  • false point on surface is not within a trimmed away region

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid parameters were specified.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: projectCurve ( MDagPath & curve, MVector * direction, bool constructionHistory )

Description

Project the given curve onto this surface creating a curve on surface. Projection will be done using the surface normals unless a direction vector to project along is given.

Arguments

  • curve curve to be projected
  • direction direction of projection. If this is null then the surface normals is used
  • constructionHistory keep construction history

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: trim ( MDoubleArray & locatorU, MDoubleArray & locatorV, bool constructionHistory )

Description

Trim this surface to its curves on surface. Regions which are kept are specified by passing in two 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.

Arguments

  • locatorU array of U parameters indicating regions to keep
  • locatorV array of V parameters indicating regions to keep
  • constructionHistory keep construction history

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getTrimBoundaries ( MTrimBoundaryArray & result, unsigned int region, bool paramEdge )

Description

Returns all trim boundaries of a region on this surface.

Arguments

  • region the trimmed region that containing the boundaries

  • paramEdge If true, then 2D curves are returned, otherwise 3D curves.

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

Return Value

  • All trim boundaries of the given region in this surface.

MStatus MFnNurbsSurface:: trimWithBoundaries ( const MTrimBoundaryArray & mBoundaries, bool flipNormal, double e_tol, double pe_tol)

Description

This function trims this surface with given trim boundaries.

NOTE: The curves specified in the MTrimBoundaryArray are in UV space. As a result, they must be 2D curves. The MFnNurbsCurve functionset provides a method for creating 2D curves.

Arguments

  • boundaries The boundaries used for the trim. A boundary may consist of several curves. They must present a closed boundary, must be in UV (parameter) space, and must be on the surface. Boundaries[0] is the outer boundary which goes counterclockwise around the surface normal. All other boundaries must be inner boundaries inside the outer boundary defined region. If an inner boundary goes clockwise, it defines a hole, otherwise it should define an island inside a hole. Boundaries[0] can be empty. In this case, the native boundary is used as outer boundary. The boundaries should not intersect to each other or to itself.
  • flipNormal Whether to flip the trimmed surface normal
  • e_tol The 3d edge tolerance with which to trim
  • pe_tol The parameter edge tolerance with which to trim

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MFnNurbsSurface:: numPatches ( MStatus * ReturnStatus ) const

Description

Returns the number of non-zero patches in this surface.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of non-zero patches in this surface.

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MFnNurbsSurface:: numPatchesInU ( MStatus * ReturnStatus ) const

Description

Returns the number of non-zero patches along u, in this surface.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of non-zero patches along u, in this surface.

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MFnNurbsSurface:: numPatchesInV ( MStatus * ReturnStatus ) const

Description

Returns the number of non-zero patches along v, in this surface.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of non-zero patches along v, in this surface.

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MFnNurbsSurface:: numUVs ( MStatus * ReturnStatus ) const

Description

Returns the number of texture (uv) coordinates for this surface. The uv's are stored in a list which is referenced by patches requiring textures on a per-patch per-patchCorner basis. This method returns the number of elements in this list.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of texture coordinates

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setUVs ( const MFloatArray & uArray, const MFloatArray & vArray )

Description

Sets all of the texture coordinates (uvs) for this surface. The uv arrays must be of equal size 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.

Also, 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.

Arguments

  • uArray The array of u values to be set
  • vArray The array of v values to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter uArray and vArray lengths do not match or the arrays are smaller than numUVs().
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getUVs ( MFloatArray & uArray, MFloatArray & vArray ) const

Description

This method copies the texture coordinate list for this surface into the given uv arrays.

Arguments

  • uArray Storage for the u texture coordinate list
  • vArray Storage for the v texture coordinate list

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: setUV ( int uvId, float u, float v )

Description

Sets the specified texture coordinate. The uvId is the element in the uv list that will be set. If the uvId is greater than or equal to numUVs() then the uv list will be grown to accommodate the specified uv.

Also, 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.

Arguments

  • uvId the element in the uv list to be set
  • u the new u value that is to be set
  • v the new v value that is to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getUV ( int uvId, float & u, float & v ) const

Description

Get the value of the specified texture coordinate from this surface's uv list. The uvId is the element in the uv list that will be retrieved.

Arguments

  • uvId the element in the uv list to examine
  • u storage for the u value
  • v storage for the v value

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid uvId. The uvId should be less than numUVs().
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getPatchUV ( int patchId, int cornerIndex, float & u, float & v ) const

Description

Get the value of the specified texture coordinate for a patch corner in a patch. Since texture coordinates (uv's) are stored per-patch per-corner you must specify both the patch and the corner that the u and v values are mapped to.

Arguments

  • patchId The patch to examine
  • cornerIndex The patch-relative corner to examine
  • u storage for the u value
  • v storage for the v value

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid patchId or cornerIndex specified.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getPatchUVs ( int patchId, MFloatArray & uArray, MFloatArray & vArray) const

Description

Get the values of the texture coordinate on a specified patch. Since texture coordinates (uvs) are stored per-patch per-corner, the u and v values mapped to all corners of the specified patch are returned.

Arguments

  • patchId The patch to examine
  • uArray storage for u values
  • vArray storage for v values

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid patchId specified.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getPatchUVid ( int patchId, int cornerIndex, int &uvId ) const

Description

Get the id of the specified texture coordinate for a corner in a patch.

Arguments

  • patchId The patch to examine
  • cornerIndex The patch-relative corner to examine (local index)
  • uvId storage for the uv index

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid patchId or cornerIndex specified.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: assignUV ( int patchId, int cornerIndex, int uvId )

Description

Maps a texture coordinate to a the specified corner of a patch.

Since texture coordinates (uvs) are stored per-patch per-patchCorner you must specify both the patch and the patchCorner that the uv entry is mapped to.

The cornerIndex is the corner within the patch that the uv will be mapped to. This index must be in the range 0 to patchCornerCount(patchId).

Also, 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.

Arguments

  • patchId The patch to map to
  • cornerIndex The corner of the patch to map to
  • uvId The uv entry from the uv list that will be mapped

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid patchId, cornerIndex, or uvId specified.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: assignUVs ( const MIntArray & uvCounts, const MIntArray & uvIds )

Description

This method maps all texture coordinates for the surface. The setUV/setUVs method is 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 setUV/setUVs method should be called before the assignUVs method.

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.

Also, 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.

Arguments

  • uvCounts The uv counts for each patch in the surface
  • uvIds The uv indices to be mapped to each patch-corner

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid uvCounts array or invalid uvIds array.
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: clearUVs ( )

Description

This method 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 actual 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.

Arguments

  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid uvCounts array or invalid uvIds array.
  • MS::kInvalidIndex Invalid uvSet was specified
  • MS::kFailure An object error has occurred.

MStatus MFnNurbsSurface:: getAssignedUVs ( MIntArray & uvCounts, MIntArray & uvIds ) const

Description

Get assigned UVs. This method finds all texture coordinates for the surface that have been mapped, and returns them in the same format as assignUVs. The setUV/setUVs method is used to create the texture coordinate table for the surface and this method is used to map those values to each patch on a per-corner basis.

The uvCounts array should contain the number of uv's per patch. Since uvs are mapped per-patch per-corner, the entries returned in this array will match the corner counts for each patch in the surface. For example, suppose that we have a cube with 2 of the faces mapped: the array for this cube would be { 4, 4, 0, 0, 0, 0 } since there are 6 patches each with 4 vertices. A face either has all its vertives mapped, or none

The uvIds array will contain the UV indices that will be mapped to each patch-corner in the surface. Use the getUV method to get the actual uv values for these id's.

Arguments

  • uvCounts The uv counts for each patch in the surface
  • uvIds The uv indices to be mapped to each patch-corner

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter Invalid uvCounts array or invalid uvIds array.
  • MS::kFailure An object error has occurred.

MObject MFnNurbsSurface:: tesselate ( MTesselationParams & parms, MStatus * ReturnStatus )

Description

THIS IS AN OBSOLETE METHOD

Performs tesselation on this surface and returns the tesselated polygonal object. The type of tesselation can be controlled by providing the tesselation parameters (see MTesselationParams).

Arguments

  • parms Tesselation parameters
  • ReturnStatus Status code

Return Value

  • A polygonal representation of this surface

Status Codes

  • MS::kSuccess Method successful
  • MS::kFailure Object error

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright