本文整理汇总了C++中MFnNurbsCurve::getPath方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnNurbsCurve::getPath方法的具体用法?C++ MFnNurbsCurve::getPath怎么用?C++ MFnNurbsCurve::getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnNurbsCurve
的用法示例。
在下文中一共展示了MFnNurbsCurve::getPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doIt
MStatus InstanceCallbackCmd::doIt( const MArgList& args )
{
MStatus status = MS::kSuccess;
// Draw a circle and get its dagPath
// using an iterator
MGlobal::executeCommand("circle");
MFnNurbsCurve circle;
MDagPath dagPath;
MItDependencyNodes iter( MFn::kNurbsCurve , &status);
for(iter.reset(); !iter.isDone() ; iter.next())
{
MObject item = iter.item();
if(item.hasFn(MFn::kNurbsCurve))
{
circle.setObject(item);
circle.getPath(dagPath);
MGlobal::displayInfo("DAG_PATH is " + dagPath.fullPathName());
if(dagPath.isValid())
{
// register callback for instance add AND remove
//
MDagMessage::addInstanceAddedCallback ( dagPath,addCallbackFunc, NULL, &status);
MDagMessage::addInstanceRemovedCallback ( dagPath,remCallbackFunc, NULL, &status);
MGlobal::displayInfo("CALLBACK ADDED FOR INSTANCE ADD/REMOVE");
}
}
}
if (status != MS::kSuccess)
{
MGlobal::displayInfo("STATUS RETURNED IS NOT SUCCESS");
}
return status;
}
示例2:
MStatus CreateCurves::Curve::create(CreateCurves & instance) {
MStatus status;
MFnNurbsCurve curve;
MObject curveObject = curve.create(points, knots, instance.m_degree, isLoop ? MFnNurbsCurve::kClosed : MFnNurbsCurve::kOpen, false, false, MObject::kNullObj, &status);
if (!status) {
status.perror("MFnNurbsCurve::create");
return status;
}
MDagPath path;
if (!(status = curve.getPath(path))) {
status.perror("MFnNurbsCurve::getPath");
return status;
}
instance.m_curves.append(path.transform());
return MStatus::kSuccess;
}