Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. curve -p 0 10 0 -p 5 0 0 -p 5 0 5 -p 0 0 5;
  2. createNode FurrySystemNode -n furry;
  3. connectAttr time1.outTime furry.time;
  4. connectAttr curveShape1.local furry.input_curve;
  5. connectAttr furry.output_curve curveShape1.create
  6.  
  7. MStatus FurrySystemNode::compute(const MPlug& plug, MDataBlock& data) {
  8. if (plug == output_curve) {
  9. cout << "Computing input_curven";
  10.  
  11. MStatus stat;
  12. MDataHandle handle = data.inputValue(input_curve, &stat);
  13. MDataHandle output_handle = data.outputValue(output_curve, &stat);
  14. McheckErr(stat, "Failed at getting data.inputValuen");
  15. MObject curve_obj = handle.data();
  16.  
  17. MFnNurbsCurve curve_fn(curve_obj, &stat);
  18. McheckErr(stat, "Failed at creating the MFnNurbsCurve function setn"); // Fails here
  19.  
  20. MPointArray cvs;
  21. stat = curve_fn.getCVs(cvs, MSpace::kWorld);
  22. for (int i = 0; i < cvs.length(); i++) {
  23. cvs[i] += MPoint(i, 0, 0);
  24. }
  25.  
  26. curve_fn.setCVs(cvs, MSpace::kWorld);
  27. curve_fn.updateCurve(); // Don't think this one is needed
  28. output_handle.set(curve_obj);
  29. stat = data.setClean(plug);
  30. McheckErr(stat, "Failed at cleaning datan");
  31. }
  32. return MS::kSuccess;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement