pymel.core.nodetypes.NurbsSurface¶
digraph inheritance62c87e356a { rankdir=TB; ranksep=0.15; nodesep=0.15; size="8.0, 12.0"; "ContainerBase" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.ContainerBase.html#pymel.core.nodetypes.ContainerBase",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "DependNode" -> "ContainerBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ControlPoint" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.ControlPoint.html#pymel.core.nodetypes.ControlPoint",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "DeformableShape" -> "ControlPoint" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DagNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.DagNode.html#pymel.core.nodetypes.DagNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "Entity" -> "DagNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DeformableShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.DeformableShape.html#pymel.core.nodetypes.DeformableShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "GeometryShape" -> "DeformableShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DependNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.DependNode.html#pymel.core.nodetypes.DependNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "PyNode" -> "DependNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Entity" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.Entity.html#pymel.core.nodetypes.Entity",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "ContainerBase" -> "Entity" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeometryShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.GeometryShape.html#pymel.core.nodetypes.GeometryShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "Shape" -> "GeometryShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NurbsSurface" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="#pymel.core.nodetypes.NurbsSurface",style="setlinewidth(0.5)",tooltip="class counterpart of mel function `surface`",height=0.25,shape=box,fontsize=8]; "SurfaceShape" -> "NurbsSurface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProxyUnicode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.util.utilitytypes/pymel.util.utilitytypes.ProxyUnicode.html#pymel.util.utilitytypes.ProxyUnicode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "PyNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.core.general/pymel.core.general.PyNode.html#pymel.core.general.PyNode",style="setlinewidth(0.5)",tooltip="Abstract class that is base for all pymel nodes classes.",height=0.25,shape=box,fontsize=8]; "ProxyUnicode" -> "PyNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Shape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.Shape.html#pymel.core.nodetypes.Shape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "DagNode" -> "Shape" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SurfaceShape" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="pymel.core.nodetypes.SurfaceShape.html#pymel.core.nodetypes.SurfaceShape",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8]; "ControlPoint" -> "SurfaceShape" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
- class NurbsSurface(*args, **kwargs)¶
class counterpart of mel function surface
The cmd creates a NURBS spline surface (rational or non rational). The surface is created by specifying control vertices (CV’s) and knot sequences in the U and V direction. You cannot query the properties of the surface using this command. See examples below.
- BoundaryType = Enum( EnumValue('BoundaryType', 0, 'invalidBoundary'), EnumValue('BoundaryType', 1, 'outer'), EnumValue('BoundaryType', 2, 'inner'), EnumValue('BoundaryType', 3, 'segment'), EnumValue('BoundaryType', 4, 'closedSegment'))¶
- Form = Enum( EnumValue('Form', 0, 'invalid'), EnumValue('Form', 1, 'open'), EnumValue('Form', 2, 'closed'), EnumValue('Form', 3, 'periodic'), EnumValue('Form', 4, 'last'))¶
- area(tolerance=0.001)¶
Calculates the surface area of this nurbs surface. A value of 0.0 will be returned if the area cannot be determined successfully.
Parameters: - tolerance : float
tolerance value to be used for computations
Return type: float
Derived from api method maya.OpenMaya.MFnNurbsSurface.area
- assignUV(patchId, cornerIndex, uvId)¶
Maps a texture coordinate to a the specified corner of a patch.
Parameters: - patchId : int
The patch to map to
- cornerIndex : int
The corner of the patch to map to
- uvId : int
The uv entry from the uv list that will be mapped
Derived from api method maya.OpenMaya.MFnNurbsSurface.assignUV
Undo is not currently supported for this method
- assignUVs(uvCounts, uvIds)¶
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.
Parameters: - uvCounts : int list
The uv counts for each patch in the surface
- uvIds : int list
The uv indices to be mapped to each patch-corner
Derived from api method maya.OpenMaya.MFnNurbsSurface.assignUVs
Undo is not currently supported for this method
- boundaryType(region, boundary)¶
Returns the type of the specified boundary. The surface must be a trimmed surface.
Parameters: - region : int
the region to examine
- boundary : int
the boundary to examine
Return type: Derived from api method maya.OpenMaya.MFnNurbsSurface.boundaryType
- clearUVs()¶
This method clears out all texture coordinates for the nurbsSurface, and leaves behind an empty UVset. Derived from api method maya.OpenMaya.MFnNurbsSurface.clearUVs
Undo is not currently supported for this method
- closestPoint(toThisPoint, ignoreTrimBoundaries=False, tolerance=0.001, space='preTransform')¶
Return the closest point on this surface to the given point.
Parameters: - toThisPoint : Point
Point to be compared.
- ignoreTrimBoundaries : bool
If this is true and the surface is trimmed, look for the point on the entire, untrimmed surface ignoring any trim curves.
- tolerance : float
Tolerance value to be used for computations.
- space : Space.Space
Coordinate space in which perform this operation,
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: (Point, float, float)
Derived from api method maya.OpenMaya.MSpace.closestPoint
- copy(source, parentOrOwner='MObject::kNullObj')¶
This method creates a copy of a nurbs surface.
Parameters: - source : PyNode
the surface to be copied
- parentOrOwner : PyNode
the DAG parent or kNurbsSurfaceData the new surface will belong to
Return type: PyNode
Derived from api method maya.OpenMaya.MFnNurbsSurface.copy
- cvsInU(startIndex, endIndex, rowIndex)¶
Returns a component for the specified CVs.
Parameters: - startIndex : int
start CV index in U
- endIndex : int
end CV index in U
- rowIndex : int
row index
Return type: PyNode
Derived from api method maya.OpenMaya.MFnNurbsSurface.cvsInU
- cvsInV(startIndex, endIndex, rowIndex)¶
Returns a component for the specified CVs on the given V direction.
Parameters: - startIndex : int
start CV index in V
- endIndex : int
end CV index in V
- rowIndex : int
row index
Return type: PyNode
Derived from api method maya.OpenMaya.MFnNurbsSurface.cvsInV
- degreeU()¶
Returns the degree of the surface in U (1 - 3).
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.degreeU
- degreeV()¶
Returns the degree of the surface in V (1 - 3).
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.degreeV
- distanceToPoint(pt, space='preTransform')¶
Returns the distance from the given point to the closest point on the surface.
Parameters: - pt : Point
Point to calculate distance from
- space : Space.Space
Coordinate space for which to perform operation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: float
Derived from api method maya.OpenMaya.MSpace.distanceToPoint
- edge(region, boundary, edge, paramEdge=False)¶
Return the specified edge of a trim boundary.
Parameters: - region : int
the trimmed region containing the edge
- boundary : int
the boundary to examine
- edge : int
the boundary edge to examine
- paramEdge : bool
if true then 2D param edges are returned, otherwise a 3D edge is returned.
Return type: PyNode list
Derived from api method maya.OpenMaya.MFnNurbsSurface.edge
- formInU()¶
Return the form of this surface in U. Form can be kOpen, kClosed, kPeriodic, or kUnknownForm.
Return type: NurbsSurface.Form Derived from api method maya.OpenMaya.MFnNurbsSurface.formInU
- formInV()¶
Return the form of this surface in V. Form can be kOpen, kClosed, kPeriodic, or kUnknownForm.
Return type: NurbsSurface.Form Derived from api method maya.OpenMaya.MFnNurbsSurface.formInV
- getAssignedUVs()¶
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.
Return type: (int list, int list) Derived from api method maya.OpenMaya.MFnNurbsSurface.getAssignedUVs
- getCV(indexU, indexV, space='preTransform')¶
Get the location of the specified CV.
Parameters: - indexU : int
U index of CV
- indexV : int
V index of CV
- space : Space.Space
coordinate space for the CV
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Point
Derived from api method maya.OpenMaya.MSpace.getCV
- getCVs(space='preTransform')¶
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”.
Parameters: - space : Space.Space
specifies the coordinate system for this operation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Point list
Derived from api method maya.OpenMaya.MSpace.getCVs
- getConnectedShaders(instanceNumber)¶
Returns all the shaders (sets) connected to the specified instance of this surface, as well as an array of patch/shader assignments. The indices array will hold, for each patch in the surface, an index into the shaders array. If a patch does not have a shader assigned to it, the value of the index will be -1.
Parameters: - instanceNumber : int
The instance number of the surface to query
Return type: (PyNode list, int list)
Derived from api method maya.OpenMaya.MFnNurbsSurface.getConnectedShaders
- getDataObject()¶
Returns an MObject if the class has been constructed with an MFn::kNurbsSurfaceData entity, otherwise MObject::kNullObj is returned.
Return type: PyNode Derived from api method maya.OpenMaya.MFnNurbsSurface.getDataObject
- getDerivativesAtParm(paramInU, paramInV, space)¶
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 nullptr, the second derivatives will not be computed and execution time wil be faster.
Parameters: - paramInU : float
U parameter value to evaluate
- paramInV : float
V parameter value to evaluate
- space : Space.Space
Coordinate space for the returned vectors
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: (Point, Vector, Vector, Vector, Vector, Vector)
Derived from api method maya.OpenMaya.MSpace.getDerivativesAtParm
- getKnotDomain()¶
Returns the maximum and minimum U and V paramter values for this surface.
Return type: (float, float, float, float) Derived from api method maya.OpenMaya.MFnNurbsSurface.getKnotDomain
- getKnotInU(index)¶
Retrieve the given knot value from this surface at the specified U index. U knots are indexed from 0 to numKnotsInU() -1.
Parameters: - index : int
The U index of the knot value to get
Return type: float
Derived from api method maya.OpenMaya.MFnNurbsSurface.knotInU
- getKnotInV(index)¶
Retrieve the given knot value from this surface at the specified V index. V knots are indexed from 0 to numKnotsInV() -1.
Parameters: - index : int
The V index of the knot value to get
Return type: float
Derived from api method maya.OpenMaya.MFnNurbsSurface.knotInV
- getKnotsInU()¶
Get the knots along the U direction for this surface.
Return type: float list Derived from api method maya.OpenMaya.MFnNurbsSurface.getKnotsInU
- getKnotsInV()¶
Get the knots along the V direction for this surface.
Return type: float list Derived from api method maya.OpenMaya.MFnNurbsSurface.getKnotsInV
- getParamAtPoint(*args, **kwargs)¶
- getPatchUV(patchId, cornerIndex)¶
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.
Parameters: - patchId : int
The patch to examine
- cornerIndex : int
The patch-relative corner to examine
Return type: (float, float)
Derived from api method maya.OpenMaya.MFnNurbsSurface.getPatchUV
- getPatchUVid(patchId, cornerIndex)¶
Get the id of the specified texture coordinate for a corner in a patch.
Parameters: - patchId : int
The patch to examine
- cornerIndex : int
The patch-relative corner to examine (local index)
Return type: int
Derived from api method maya.OpenMaya.MFnNurbsSurface.getPatchUVid
- getPatchUVs(patchId)¶
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.
Parameters: - patchId : int
The patch to examine
Return type: (float list, float list)
Derived from api method maya.OpenMaya.MFnNurbsSurface.getPatchUVs
- getPointAtParam(paramU, paramV, space='preTransform')¶
Finds the point corresponding to the given parameter value on the surface.
Parameters: - paramU : float
U parameter value
- paramV : float
V parameter value
- space : Space.Space
Coordinate space in which to perform this operation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Point
Derived from api method maya.OpenMaya.MSpace.getPointAtParam
- getTangents(paramInU, paramInV, space='preTransform')¶
Retrieve the tangents in the U and V directions at the given parameter value on the surface. The returned tangent vectors are normalized.
Parameters: - paramInU : float
U parameter value at which to obtain tangents
- paramInV : float
V parameter value at which to obtain tangents
- space : Space.Space
Coordinate space for the returned vectors
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: (Vector, Vector)
Derived from api method maya.OpenMaya.MSpace.getTangents
- hasHistoryOnCreate()¶
This method determines if the shape was created with history.
Return type: bool Derived from api method maya.OpenMaya.MFnNurbsSurface.hasHistoryOnCreate
- intersect(rayStartingPoint, alongThisDirection, tolerance=0.001, space='preTransform', calculateDistance=False, calculateExactHit=False)¶
This function determines the closest point of intersection of this spline surface with a ray (a vector at a point).
Parameters: - rayStartingPoint : Point
Starting location of ray to test.
- alongThisDirection : Vector
Direction of ray to test.
- tolerance : float
The epsilon value in the calculation.
- space : Space.Space
Specifies the coordinate system for this operation.
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
- calculateDistance : bool
Specifies whether to calculate the distance of the startPoint to the point of intersection
- calculateExactHit : bool
Specifies whether to determine if the point of intersection actually hit the object or just came within tolerance of it.
Return type: (bool, float, float, Point, float, bool)
Derived from api method maya.OpenMaya.MSpace.intersect
- isBezier()¶
Determine if the knot spacing gives us Bezier surface.
Return type: bool Derived from api method maya.OpenMaya.MFnNurbsSurface.isBezier
- isFlipNorm(region)¶
Determines whether the normal for the specified region is flipped. This method is only valid for trimmed surfaces.
Parameters: - region : int
Trimmed region to check. Must be in the range 0 to numRegions() - 1.
Return type: bool
Derived from api method maya.OpenMaya.MFnNurbsSurface.isFlipNorm
- isFoldedOnBispan()¶
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 type: bool Derived from api method maya.OpenMaya.MFnNurbsSurface.isFoldedOnBispan
- isKnotU(param)¶
Check if the specified parameter value is a knot value.
Parameters: - param : float
parameter value to test
Return type: bool
Derived from api method maya.OpenMaya.MFnNurbsSurface.isKnotU
- isKnotV(param)¶
Check if the specified parameter value is a knot value.
Parameters: - param : float
parameter value to test
Return type: bool
Derived from api method maya.OpenMaya.MFnNurbsSurface.isKnotV
- isParamOnSurface(paramU, paramV)¶
Check if the specified parameter is on this surface.
Parameters: - paramU : float
U parameter value
- paramV : float
V parameter value
Return type: bool
Derived from api method maya.OpenMaya.MFnNurbsSurface.isParamOnSurface
- isPointInTrimmedRegion(u, v)¶
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.
Parameters: - u : float
u parameter of point on surface to test
- v : float
v parameter of point on surface to test
Return type: bool
Derived from api method maya.OpenMaya.MFnNurbsSurface.isPointInTrimmedRegion
- isPointOnSurface(point, tolerance=0.001, space='preTransform')¶
Check if the given point is on this surface.
Parameters: - point : Point
Point to test
- tolerance : float
tolerance value to be used for computations
- space : Space.Space
Coordinate space for this operation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: bool
Derived from api method maya.OpenMaya.MSpace.isPointOnSurface
- isTrimmedSurface()¶
This method determines if this surface is a trimmed surface.
Return type: bool Derived from api method maya.OpenMaya.MFnNurbsSurface.isTrimmedSurface
- isUniform()¶
Determine if the knot spacing is uniform.
Return type: bool Derived from api method maya.OpenMaya.MFnNurbsSurface.isUniform
- normal(paramInU, paramInV, space='preTransform')¶
Retrieve the normal at the given parameter value on the surface.
Parameters: - paramInU : float
U parameter at which to obtain normal
- paramInV : float
V parameter at which to obtain normal
- space : Space.Space
Coordinate space for the returned vector
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Vector
Derived from api method maya.OpenMaya.MSpace.normal
- numBoundaries(region)¶
Returns the number of boundaries for the specified region. The surface must be a trimmed surface.
Parameters: - region : int
The trimmed region to examine
Return type: int
Derived from api method maya.OpenMaya.MFnNurbsSurface.numBoundaries
- numCVsInU(editableOnly=True)¶
Returns the number of CVs in the U direction.
Parameters: - editableOnly : bool
If editableOnly evaluates to True (default), then this will return the number of cvs that can be actually edited (and also the highest index that may be used for u - ie, if
mySurf.numCVsInU(editableOnly=True) == 4- then allowable u indices go from
- mySurf.cv[0][*] to mySurf.cv[3][*]
If editablyOnly is False, then this will return the underlying number of cvs used to define the mathematical curve in u - degreeU + numSpansInU.
These will only differ if the form in u is ‘periodic’, in which case the editable number will be numSpansInU (as the last ‘degree’ cv’s are ‘locked’ to be the same as the first ‘degree’ cvs). In all other cases, the number of cvs will be degreeU + numSpansInU.
Examples: >>> from pymel.core import * >>> # a periodic surface >>> mySurf = surface(name='periodicSurf1', du=3, dv=1, fu='periodic', fv='open', ku=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), kv=(0, 1), pw=[(4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1), (0, 5.5, 0, 1), (0, 5.5, -2.5, 1), (-4, 4, 0, 1), (-4, 4, -2.5, 1), (-5.5, 0, 0, 1), (-5.5, 0, -2.5, 1), (-4, -4, 0, 1), (-4, -4, -2.5, 1), (0, -5.5, 0, 1), (0, -5.5, -2.5, 1), (4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.cv[:][0].indices()) [ComponentIndex((0, 0), ... ComponentIndex((7, 0), label=None)] >>> mySurf.numCVsInU() 8 >>> mySurf.numCVsInU(editableOnly=False) 11 >>> >>> # an open surface >>> mySurf = surface(name='openSurf1', du=3, dv=1, fu='open', fv='open', ku=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), kv=(0, 1), pw=((4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1), (0, 5.5, 0, 1), (0, 5.5, -2.5, 1), (-4, 4, 0, 1), (-4, 4, -2.5, 1), (-5.5, 0, 0, 1), (-5.5, 0, -2.5, 1), (-4, -4, 0, 1), (-4, -4, -2.5, 1), (0, -5.5, 0, 1), (0, -5.5, -2.5, 1), (4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1)) ) >>> sorted(mySurf.cv[:][0].indices()) [ComponentIndex((0, 0), ... ComponentIndex((10, 0), label=None)] >>> mySurf.numCVsInU() 11 >>> mySurf.numCVsInU(editableOnly=False) 11
Return type: int
- numCVsInV(editableOnly=True)¶
Returns the number of CVs in the V direction.
Parameters: - editableOnly : bool
If editableOnly evaluates to True (default), then this will return the number of cvs that can be actually edited (and also the highest index that may be used for v - ie, if
mySurf.numCVsInV(editableOnly=True) == 4- then allowable v indices go from
- mySurf.cv[*][0] to mySurf.cv[*][3]
If editablyOnly is False, then this will return the underlying number of cvs used to define the mathematical curve in v - degreeV + numSpansInV.
These will only differ if the form in v is ‘periodic’, in which case the editable number will be numSpansInV (as the last ‘degree’ cv’s are ‘locked’ to be the same as the first ‘degree’ cvs). In all other cases, the number of cvs will be degreeV + numSpansInV.
Examples: >>> from pymel.core import * >>> # a periodic surface >>> mySurf = surface(name='periodicSurf2', du=1, dv=3, fu='open', fv='periodic', ku=(0, 1), kv=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1), (0, 5.5, -2.5, 1), (-4, 4, -2.5, 1), (-5.5, 0, -2.5, 1), (-4, -4, -2.5, 1), (0, -5.5, -2.5, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.cv[0].indices()) [ComponentIndex((0, 0), ... ComponentIndex((0, 7), label='cv')] >>> mySurf.numCVsInV() 8 >>> mySurf.numCVsInV(editableOnly=False) 11 >>> >>> # an open surface >>> mySurf = surface(name='openSurf2', du=1, dv=3, fu='open', fv='open', ku=(0, 1), kv=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1), (0, 5.5, -2.5, 1), (-4, 4, -2.5, 1), (-5.5, 0, -2.5, 1), (-4, -4, -2.5, 1), (0, -5.5, -2.5, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.cv[0].indices()) [ComponentIndex((0, 0), ... ComponentIndex((0, 10), label='cv')] >>> mySurf.numCVsInV() 11 >>> mySurf.numCVsInV(editableOnly=False) 11
Return type: int
- numEPsInU(editableOnly=True)¶
Returns the number of EPs in the U direction.
Examples: >>> from pymel.core import * >>> # a periodic surface >>> mySurf = surface(name='periodicSurf3', du=3, dv=1, fu='periodic', fv='open', ku=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), kv=(0, 1), pw=[(4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1), (0, 5.5, 0, 1), (0, 5.5, -2.5, 1), (-4, 4, 0, 1), (-4, 4, -2.5, 1), (-5.5, 0, 0, 1), (-5.5, 0, -2.5, 1), (-4, -4, 0, 1), (-4, -4, -2.5, 1), (0, -5.5, 0, 1), (0, -5.5, -2.5, 1), (4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.ep[:][0].indices()) [ComponentIndex((0, 0), ... ComponentIndex((7, 0), label=None)] >>> mySurf.numEPsInU() 8 >>> >>> # an open surface >>> mySurf = surface(name='openSurf3', du=3, dv=1, fu='open', fv='open', ku=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), kv=(0, 1), pw=[(4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1), (0, 5.5, 0, 1), (0, 5.5, -2.5, 1), (-4, 4, 0, 1), (-4, 4, -2.5, 1), (-5.5, 0, 0, 1), (-5.5, 0, -2.5, 1), (-4, -4, 0, 1), (-4, -4, -2.5, 1), (0, -5.5, 0, 1), (0, -5.5, -2.5, 1), (4, -4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, 0, 1), (5.5, 0, -2.5, 1), (4, 4, 0, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.ep[:][0].indices()) [ComponentIndex((0, 0), ... ComponentIndex((8, 0), label=None)] >>> mySurf.numEPsInU() 9
Return type: int
- numEPsInV(editableOnly=True)¶
Returns the number of EPs in the V direction.
Examples: >>> from pymel.core import * >>> # a periodic surface >>> mySurf = surface(name='periodicSurf4', du=1, dv=3, fu='open', fv='periodic', ku=(0, 1), kv=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1), (0, 5.5, -2.5, 1), (-4, 4, -2.5, 1), (-5.5, 0, -2.5, 1), (-4, -4, -2.5, 1), (0, -5.5, -2.5, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.ep[0][:].indices()) [ComponentIndex((0, 0), ... ComponentIndex((0, 7), label=None)] >>> mySurf.numEPsInV() 8 >>> >>> # an open surface >>> mySurf = surface(name='openSurf4', du=1, dv=3, fu='open', fv='open', ku=(0, 1), kv=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1), (0, 5.5, -2.5, 1), (-4, 4, -2.5, 1), (-5.5, 0, -2.5, 1), (-4, -4, -2.5, 1), (0, -5.5, -2.5, 1), (4, -4, -2.5, 1), (5.5, 0, -2.5, 1), (4, 4, -2.5, 1)] ) >>> sorted(mySurf.ep[0][:].indices()) [ComponentIndex((0, 0), ... ComponentIndex((0, 8), label=None)] >>> mySurf.numEPsInV() 9
Return type: int
- numEdges(region, boundary)¶
Return the number of edges for the specified trim boundary.
Parameters: - region : int
Region to examine
- boundary : int
Boundary to examine
Return type: int
Derived from api method maya.OpenMaya.MFnNurbsSurface.numEdges
- numKnotsInU()¶
Returns the number of knots in U including multiple end knots (spans + 2 * degree - 1).
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numKnotsInU
- numKnotsInV()¶
Returns the number of knots in V including multiple end knots (spans + 2 * degree - 1).
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numKnotsInV
- numNonZeroSpansInU()¶
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.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numNonZeroSpansInU
- numNonZeroSpansInV()¶
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.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numNonZeroSpansInV
- numPatches()¶
Returns the number of non-zero patches in this surface.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numPatches
- numPatchesInU()¶
Returns the number of non-zero patches along u, in this surface.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numPatchesInU
- numPatchesInV()¶
Returns the number of non-zero patches along v, in this surface.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numPatchesInV
- numRegions()¶
Returns the number of trimmed regions for this surface or 0 if the surface is not a trimmed surface.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numRegions
- numSpansInU()¶
Returns the number of spans in the u direction.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numSpansInU
- numSpansInV()¶
Returns the number of spans in the v direction.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numSpansInV
- numUVs()¶
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.
Return type: int Derived from api method maya.OpenMaya.MFnNurbsSurface.numUVs
- projectCurve(curve, direction=None, constructionHistory=False)¶
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.
Parameters: - curve : PyNode
curve to be projected
- direction : Vector
direction of projection. If this is null then the surface normals is used
- constructionHistory : bool
keep construction history
Derived from api method maya.OpenMaya.MFnNurbsSurface.projectCurve
Undo is not currently supported for this method
- removeKnotInU(atThisParam, removeAll=False)¶
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.
Parameters: - atThisParam : float
Parameter of knot to be removed
- removeAll : bool
If true then remove all the knots at the given parameter, otherwise remove all except one knot
Derived from api method maya.OpenMaya.MFnNurbsSurface.removeKnotInU
Undo is not currently supported for this method
- removeKnotInV(atThisParam, removeAll=False)¶
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.
Parameters: - atThisParam : float
Parameter of knot to be removed
- removeAll : bool
If true then remove all the knots at the given parameter, otherwise remove all except one knot
Derived from api method maya.OpenMaya.MFnNurbsSurface.removeKnotInV
Undo is not currently supported for this method
- removeOneKnotInU(atThisParam)¶
Remove one U knot at the specified parameter value from this surface.
Parameters: - atThisParam : float
Parameter of knot to be removed
Derived from api method maya.OpenMaya.MFnNurbsSurface.removeOneKnotInU
Undo is not currently supported for this method
- removeOneKnotInV(atThisParam)¶
Remove one V knot at the specified parameter value from this surface.
Parameters: - atThisParam : float
Parameter of knot to be removed
Derived from api method maya.OpenMaya.MFnNurbsSurface.removeOneKnotInV
Undo is not currently supported for this method
- setCV(indexU, indexV, pt, space='preTransform')¶
Set the location of the specified CV.
Parameters: - indexU : int
U index of CV
- indexV : int
V index of CV
- pt : Point
new location for the CV
- space : Space.Space
coordinate space for the CV
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setCV
- setCVs(array, space='preTransform')¶
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”.
Parameters: - array : Point list
The array of point values of the CVs
- space : Space.Space
specifies the coordinate system for this operation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setCVs
- setKnotInU(index, param)¶
Set the value of the given existing knot at the specified U index. 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 a knot that already exists.
Parameters: - index : int
The U index of the existing knot to be set
- param : float
The new parameter value for the knot
Derived from api method maya.OpenMaya.MFnNurbsSurface.setKnotInU
- setKnotInV(index, param)¶
Set the value of the given existing knot at the specified V index. V knots are indexed from 0 to numKnotsInV() -1. Note that this routine does not insert a new knot, it simply changes the value of a knot that already exists.
Parameters: - index : int
The V index of the existing knot to be set
- param : float
The new value for the knot
Derived from api method maya.OpenMaya.MFnNurbsSurface.setKnotInV
- setKnotsInU(array, startIndex, endIndex)¶
Set the specified U knot values for this surface.
Parameters: - array : float list
The knot values to be set
- startIndex : int
The start knot index
- endIndex : int
The end knot index
Derived from api method maya.OpenMaya.MFnNurbsSurface.setKnotsInU
- setKnotsInV(array, startIndex, endIndex)¶
Set the specified V knot values for this surface.
Parameters: - array : float list
The knot values to be set
- startIndex : int
The start knot index
- endIndex : int
The end knot index
Derived from api method maya.OpenMaya.MFnNurbsSurface.setKnotsInV
- tesselate(parms='MTesselationParams::fsDefaultTesselationParams', parentOrOwner='MObject::kNullObj')¶
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 ).
Parameters: - parms : MTesselationParams
Tesselation parameters
- parentOrOwner : PyNode
the DAG parent or kMeshData the new mesh will belong to
Return type: PyNode
Derived from api method maya.OpenMaya.MFnNurbsSurface.tesselate
- trim(locatorU, locatorV, constructionHistory=False)¶
Trim this surface to its curves on surface. Regions which are kept are specified by passing in two arrays of u,v parameters.
Parameters: - locatorU : float list
array of U parameters indicating regions to keep
- locatorV : float list
array of V parameters indicating regions to keep
- constructionHistory : bool
keep construction history
Derived from api method maya.OpenMaya.MFnNurbsSurface.trim
Undo is not currently supported for this method
- updateSurface()¶
This method signals that this surface has changed and needs to be recalculated. Derived from api method maya.OpenMaya.MFnNurbsSurface.updateSurface
Undo is not currently supported for this method