本文整理汇总了C++中MFnMesh::cleanupEdgeSmoothing方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnMesh::cleanupEdgeSmoothing方法的具体用法?C++ MFnMesh::cleanupEdgeSmoothing怎么用?C++ MFnMesh::cleanupEdgeSmoothing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnMesh
的用法示例。
在下文中一共展示了MFnMesh::cleanupEdgeSmoothing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeCubes
static void makeCubes(std::vector<cube> &cubes, MString &name, MStatus *stat)
{
MFnMesh fnMesh;
MObject result;
MFloatPointArray points;
MIntArray faceCounts;
MIntArray faceConnects;
int index_offset = 0;
for (std::vector<cube>::iterator cit = cubes.begin(); cit != cubes.end(); ++cit)
{
point3 diag = cit->diagonal();
float scale = diag.x;
point3 pos = cit->start + (diag * .5f);
MFloatVector mpos(pos.x, pos.y, pos.z);
addCube(scale, mpos, index_offset * (8), points, faceCounts, faceConnects);
index_offset += 1;
}
unsigned int vtx_cnt = points.length();
unsigned int face_cnt = faceCounts.length();
MObject newMesh =
fnMesh.create(
/* numVertices */ vtx_cnt,
/* numFaces */ face_cnt,
points,
faceCounts,
faceConnects,
MObject::kNullObj,
stat);
/* Harden all edges. */
int n_edges = fnMesh.numEdges(stat);
for (int i = 0; i < n_edges; ++i)
{
fnMesh.setEdgeSmoothing(i, false);
}
fnMesh.cleanupEdgeSmoothing(); /* Must be called after editing edges. */
fnMesh.updateSurface();
/* Assign Shader. */
MSelectionList sel_list;
if (!MFAIL(sel_list.add("initialShadingGroup")))
{
MObject set_obj;
sel_list.getDependNode(0, set_obj);
MFnSet set(set_obj);
set.addMember(newMesh);
}
/* Give it a swanky name. */
MFnDagNode parent(fnMesh.parent(0));
name = parent.setName("polyMengerSponge", false, stat);
}