本文整理汇总了C++中MFnNurbsCurve::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnNurbsCurve::setName方法的具体用法?C++ MFnNurbsCurve::setName怎么用?C++ MFnNurbsCurve::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnNurbsCurve
的用法示例。
在下文中一共展示了MFnNurbsCurve::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mayaPoints
//.........这里部分代码省略.........
// == Convert data
size_t mayaNumVertices = points.size();
MPointArray mayaPoints(mayaNumVertices);
for (size_t i=0; i < mayaNumVertices; i++) {
mayaPoints.set( i, points[i][0], points[i][1], points[i][2] );
}
double *knots=curveKnots.data();
MDoubleArray mayaKnots( knots, curveKnots.size());
int mayaDegree = curveOrder[curveIndex] - 1;
MFnNurbsCurve::Form mayaCurveForm = MFnNurbsCurve::kOpen; // HARDCODED
bool mayaCurveCreate2D = false;
bool mayaCurveCreateRational = true;
// == Create NurbsCurve Shape Node
MFnNurbsCurve curveFn;
MObject curveObj = curveFn.create(mayaPoints,
mayaKnots,
mayaDegree,
mayaCurveForm,
mayaCurveCreate2D,
mayaCurveCreateRational,
mayaNodeTransformObj,
&status
);
if (status != MS::kSuccess) {
return false;
}
MString nodeName( prim.GetName().GetText() );
nodeName += "Shape";
curveFn.setName(nodeName, false, &status);
std::string nodePath( prim.GetPath().GetText() );
nodePath += "/";
nodePath += nodeName.asChar();
if (context) {
context->RegisterNewMayaNode( nodePath, curveObj ); // used for undo/redo
}
// == Animate points ==
// Use blendShapeDeformer so that all the points for a frame are contained in a single node
// Almost identical code as used with MayaMeshReader.cpp
//
if (numTimeSamples > 0) {
MPointArray mayaPoints(mayaNumVertices);
MObject curveAnimObj;
MFnBlendShapeDeformer blendFn;
MObject blendObj = blendFn.create(curveObj);
if (context) {
context->RegisterNewMayaNode(blendFn.name().asChar(), blendObj ); // used for undo/redo
}
for (unsigned int ti=0; ti < numTimeSamples; ++ti) {
curves.GetPointsAttr().Get(&points, pointsTimeSamples[ti]);
for (unsigned int i=0; i < mayaNumVertices; i++) {
mayaPoints.set( i, points[i][0], points[i][1], points[i][2] );
}
// == Create NurbsCurve Shape Node
MFnNurbsCurve curveFn;
if ( curveAnimObj.isNull() ) {