Hi guys,
I have a question about curves manipulation using maya api:
is there a way to delete some CV from a MFnNurbsCurve?
I can’t find any usefull method in the documentation.
It can be done directly from the gui just by selecting the CV and pressing “del”, but how can I process it in a custom context?
thanks
Is this what your looking for?
http://download.autodesk.com/global/docs/mayasdk2012/en_us/cpp_ref/class_m_fn_nurbs_curve.html#ab8dca8c3d0dc0116b9c1e74d0ae1dec4
Since it returns an MObject, there should be information on how to delete these on the internet. my experience with Maya API when it comes to manipulating scenes like this is quite limited…
yeah, I already tried to use setCVs but actually it doesn’t take into account the length of the input cvArray:
when the cvArray’s length is lower the curve cv count, my curve keeps its original count (the remaining CV are so set to world Origin)
using the cv() method may be a solution, but I haven’t been able to find any information on how to manipulate the returned MObject :tear:
I finally found a solution:
I generated a MString with the ‘delete’ mel procedure concatened with the reverse ordered CVs’ dagpath I wanted to delete, then call it with the MGlobal::executeCommand function
It’s far from being the sexiest way to do it, but it does the job.
Anyway, if anybody find a pure c++/python solution to delete CVs, I would be happy to learn it :):