#include <MMeshSmoothOptions.h>
Options for control of smooth mesh generation.
The MMeshSmoothOptions class encapsulates settings that control the generation of smoothed version of a mesh. Meant for use with MFnMesh::generateSmoothMesh().
Public Types | |
enum | SubdivisionType { kInvalidSubdivision = -1, kCatmullClark = 0, kOpenSubdivCatmullClarkUniform = 2, kOpenSubdivCatmullClarkAdaptive, kLastSubdivision } |
Specifies subdivision algorithm to use for mesh smoothing. More... | |
enum | BoundaryRule { kInvalid = -1, kLegacy = 0, kCreaseAll, kCreaseEdge, kLast } |
Specifies how to apply boundary creasing to subd poly object. More... | |
enum | OpenSubdivVertexBoundary { kInvalidBoundary = -1, kNone = 0, kSharpEdgesAndCorners, kSharpEdges, kAlwaysSharp, kLastBoundary } |
OpenSubdiv vertex boundary rules. More... | |
enum | OpenSubdivCreaseMethod { kInvalidCreaseMethod = -1, kNormal = 0, kChaikin, kLastCreaseMethod } |
OpenSubdiv crease method. More... | |
Public Member Functions | |
MMeshSmoothOptions (void) | |
Constructor. | |
virtual | ~MMeshSmoothOptions (void) |
Destructor. | |
void | setDivisions (int numDivisions, MStatus *ReturnStatus=NULL) |
Sets the number of divisions stored in this options object. More... | |
int | divisions (MStatus *ReturnStatus=NULL) const |
Retrieves the level of smoothing these options specify to perform on the mesh. More... | |
void | setSmoothness (float smoothness, MStatus *ReturnStatus=NULL) |
Sets the the smoothness parameter for this set of smooth options which has range [0,1] where 1 smooths the faces as much as possible. More... | |
float | smoothness (MStatus *ReturnStatus=NULL) const |
Retrieves the smoothness parameter for this set of smooth options which has range [0,1] where 1 smooths the faces as much as possible. More... | |
void | setSmoothUVs (bool smoothUVs, MStatus *ReturnStatus=NULL) |
Sets whether or not these options specify to smooth UVs as well as geometry. More... | |
bool | smoothUVs (MStatus *ReturnStatus=NULL) const |
Retrieves whether or not these options specify to smooth UVs as well as geometry. More... | |
void | setPropEdgeHardness (bool propEdgeHardness, MStatus *ReturnStatus=NULL) |
Sets whether or not these options specify that smooth mesh edges which are a result of edges from the base cage will share the hardness value. More... | |
bool | propEdgeHardness (MStatus *ReturnStatus=NULL) const |
Retrieves whether or not these options specify that the smooth mesh edges which are a result of edges from the base cage will share the same hardness value. More... | |
void | setKeepBorderEdge (bool keepBorderEdge, MStatus *ReturnStatus=NULL) |
Sets whether or not these options specify that border edges will not be smoothed. More... | |
bool | keepBorderEdge (MStatus *ReturnStatus=NULL) const |
Retrieves whether or not these options specify that border edges will not be smoothed. More... | |
void | setKeepHardEdge (bool keepHardEdge, MStatus *ReturnStatus=NULL) |
Sets whether or not these options specify that hard edges will not be smoothed. More... | |
bool | keepHardEdge (MStatus *ReturnStatus=NULL) const |
Retrieves whether or not these options specify that hard edges will not be smoothed. More... | |
void | setBoundaryRule (BoundaryRule rule, MStatus *ReturnStatus=NULL) |
Set the rule used to determine how boundary edges and vertices are creased. More... | |
BoundaryRule | boundaryRule (MStatus *ReturnStatus=NULL) const |
Returns the current value for the boundary rule. More... | |
void | setOpenSubdivVertexBoundary (OpenSubdivVertexBoundary rule, MStatus *ReturnStatus=NULL) |
Set the rule used to determine how boundary edges and vertices are creased. More... | |
OpenSubdivVertexBoundary | openSubdivVertexBoundary (MStatus *ReturnStatus=NULL) const |
Returns the current value for the vertex boundary rule. More... | |
void | setOpenSubdivFaceVaryingBoundary (OpenSubdivVertexBoundary smoothing, MStatus *ReturnStatus=NULL) |
Set the boundary rule used to determine how face varying data is interpolated. More... | |
OpenSubdivVertexBoundary | openSubdivFaceVaryingBoundary (MStatus *ReturnStatus=NULL) const |
Returns the current value for the face varing (UV) boundary rule. More... | |
void | setOpenSubdivSmoothTriangles (bool smoothTriangles, MStatus *ReturnStatus=NULL) |
Sets whether or not "smooth triangles" is enabled. More... | |
bool | openSubdivSmoothTriangles (MStatus *ReturnStatus=NULL) |
Retrieves whether or not smooth triangles is enabled. More... | |
void | setOpenSubdivCreaseMethod (OpenSubdivCreaseMethod method, MStatus *ReturnStatus=NULL) |
Set the OpenSubdiv crease method. More... | |
OpenSubdivCreaseMethod | openSubdivCreaseMethod (MStatus *ReturnStatus=NULL) const |
Returns the current OpenSubdiv crease method. More... | |
void | setSubdivisionType (SubdivisionType subdivision, MStatus *ReturnStatus=NULL) |
Set the subdivision algorithm used to control mesh smoothing. More... | |
SubdivisionType | subdivisionType (MStatus *ReturnStatus=NULL) const |
Returns the current value for the subdivision type. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Friends | |
class | MFnMesh |
enum SubdivisionType |
enum BoundaryRule |
void setDivisions | ( | int | numDivisions, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets the number of divisions stored in this options object.
[in] | numDivisions | Number of divisions. |
[out] | ReturnStatus | Status code (see below) |
int divisions | ( | MStatus * | ReturnStatus = NULL | ) | const |
Retrieves the level of smoothing these options specify to perform on the mesh.
[out] | ReturnStatus | Status code (see below) |
void setSmoothness | ( | float | smoothness, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets the the smoothness parameter for this set of smooth options which has range [0,1] where 1 smooths the faces as much as possible.
[in] | smoothness | The smoothness |
[out] | ReturnStatus | Status code (see below) |
float smoothness | ( | MStatus * | ReturnStatus = NULL | ) | const |
Retrieves the smoothness parameter for this set of smooth options which has range [0,1] where 1 smooths the faces as much as possible.
[out] | ReturnStatus | Status code (see below) |
void setSmoothUVs | ( | bool | smoothUVs, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets whether or not these options specify to smooth UVs as well as geometry.
[in] | smoothUVs | True if UVs should be smoothed |
[out] | ReturnStatus | Status code (see below) |
bool smoothUVs | ( | MStatus * | ReturnStatus = NULL | ) | const |
Retrieves whether or not these options specify to smooth UVs as well as geometry.
[out] | ReturnStatus | Status code (see below) |
void setPropEdgeHardness | ( | bool | propEdgeHardness, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets whether or not these options specify that smooth mesh edges which are a result of edges from the base cage will share the hardness value.
[in] | propEdgeHardness | True if smooth edges should share hardness with the base cage |
[out] | ReturnStatus | Status code (see below) |
bool propEdgeHardness | ( | MStatus * | ReturnStatus = NULL | ) | const |
Retrieves whether or not these options specify that the smooth mesh edges which are a result of edges from the base cage will share the same hardness value.
[out] | ReturnStatus | Status code (see below) |
void setKeepBorderEdge | ( | bool | keepBorderEdge, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets whether or not these options specify that border edges will not be smoothed.
[in] | keepBorderEdge | True if border edges should not be smoothed |
[out] | ReturnStatus | Status code (see below) |
bool keepBorderEdge | ( | MStatus * | ReturnStatus = NULL | ) | const |
Retrieves whether or not these options specify that border edges will not be smoothed.
[out] | ReturnStatus | Status code (see below) |
void setKeepHardEdge | ( | bool | keepHardEdge, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets whether or not these options specify that hard edges will not be smoothed.
[in] | keepHardEdge | True if hard edges should not be smoothed |
[out] | ReturnStatus | Status code (see below) |
bool keepHardEdge | ( | MStatus * | ReturnStatus = NULL | ) | const |
Retrieves whether or not these options specify that hard edges will not be smoothed.
[out] | ReturnStatus | Status code (see below) |
void setBoundaryRule | ( | MMeshSmoothOptions::BoundaryRule | rule, |
MStatus * | ReturnStatus = NULL |
||
) |
Set the rule used to determine how boundary edges and vertices are creased.
By default, creases are automatically applied to all boundary edges and all vertices that have only 2 incident edges prior to being converted to a smooth mesh.
The possible rules are:
[in] | rule | to apply |
[out] | ReturnStatus | Status code |
MMeshSmoothOptions::BoundaryRule boundaryRule | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the current value for the boundary rule.
See setBoundaryRule() for more details.
[out] | ReturnStatus | Status code |
void setOpenSubdivVertexBoundary | ( | MMeshSmoothOptions::OpenSubdivVertexBoundary | rule, |
MStatus * | ReturnStatus = NULL |
||
) |
Set the rule used to determine how boundary edges and vertices are creased.
The possible rules are:
[in] | rule | to apply |
[out] | ReturnStatus | Status code |
MMeshSmoothOptions::OpenSubdivVertexBoundary openSubdivVertexBoundary | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the current value for the vertex boundary rule.
See setOpenSubdivVertexBoundary() for more details.
[out] | ReturnStatus | Status code |
void setOpenSubdivFaceVaryingBoundary | ( | MMeshSmoothOptions::OpenSubdivVertexBoundary | rule, |
MStatus * | ReturnStatus = NULL |
||
) |
Set the boundary rule used to determine how face varying data is interpolated.
Specifically this determines how UVs are smoothed by OpenSubdiv becease UVs are treated as face varying data.
The possible rules are:
[in] | rule | to apply |
[out] | ReturnStatus | Status code |
MMeshSmoothOptions::OpenSubdivVertexBoundary openSubdivFaceVaryingBoundary | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the current value for the face varing (UV) boundary rule.
See setOpenSubdivFaceVaryingBoundary() for more details.
[out] | ReturnStatus | Status code |
void setOpenSubdivSmoothTriangles | ( | bool | smoothTriangles, |
MStatus * | ReturnStatus = NULL |
||
) |
Sets whether or not "smooth triangles" is enabled.
[in] | smoothTriangles | True if smooth triangles is to be enabled. |
[out] | ReturnStatus | Status code (see below) |
bool openSubdivSmoothTriangles | ( | MStatus * | ReturnStatus = NULL | ) |
Retrieves whether or not smooth triangles is enabled.
[out] | ReturnStatus | Status code (see below) |
void setOpenSubdivCreaseMethod | ( | MMeshSmoothOptions::OpenSubdivCreaseMethod | method, |
MStatus * | ReturnStatus = NULL |
||
) |
Set the OpenSubdiv crease method.
The possible rules are:
[in] | method | to apply |
[out] | ReturnStatus | Status code |
MMeshSmoothOptions::OpenSubdivCreaseMethod openSubdivCreaseMethod | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the current OpenSubdiv crease method.
See setOpenSubdivCreaseMethod() for more details.
[out] | ReturnStatus | Status code |
void setSubdivisionType | ( | MMeshSmoothOptions::SubdivisionType | subdivision, |
MStatus * | ReturnStatus = NULL |
||
) |
Set the subdivision algorithm used to control mesh smoothing.
The default subdivision algorithm is Maya Catmull-Clark.
[in] | subdivision | algorithm to use |
[out] | ReturnStatus | Status code |
MMeshSmoothOptions::SubdivisionType subdivisionType | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the current value for the subdivision type.
See setSubdivisionType() for more details.
[out] | ReturnStatus | Status code |
|
static |
Returns the name of this class.