Maya .net Api Question

Hey all,

Been a long time since I’ve been on due to work and general stuff, glad to be back.

I was just trying out the .Net api for Maya and I was wondering if anyone could help me out.

I am converting an old python plugin to .net just to compare the two and I am having a problem with setting the type of the input parameter.

In Python I did this:


tAttr = OpenMaya.MFnTypedAttribute ()
SpiralCurveNode.inputCurve = tAttr.create( "inputCurve", "ic", OpenMaya.MFnData.kNurbsCurve)

In the .net api they do this:

[MPxNodeNumeric("in", "input", MFnNumericData.Type.kFloat, Storable = false, Writable = false)]
public static MObject input = null;

I can’t seem to see how to change it the type to a nurbs curve. I’m guessing its something pretty simple that I’m just overlooking.

Can anyone offer any guidance?

Cheers.

MPxNodeNumeric is a shortcut attribute that simplifies adding numeric attributes without the need of having a node initializer method. You’ll need to implement the initialize method and create the attributes just like you would in C++/Python.


class Node : ...
{
   ...
   public static MObject inputCurve = null;

   [MPxNodeInitializer()]
   public static bool initialize()
   {
      // Create the attribute like normal 
   }
   ...
}

Cheers, I wasn’t sure if there was a shorthand way to do it via attributes like with numeric ones,