We can create an attribute(typed attribute) using the following Maya C++ API MFnTypedAttribute has 2 overload methods for creating attribute. MObject create (const MString &fullName, const MString &briefName, const MTypeId &id, MObject defaultData=MObject::kNullObj, MStatus *ReturnStatus=NULL) MObject create (const MString &fullName, const MString &briefName, MFnData::Type type, MObject defaultData=MObject::kNullObj, MStatus *ReturnStatus=NULL) Here is the sample code MObject fluidType::outGrid; MStatus stat; MFnTypedAttribute tAttr; outGrid = tAttr.create("outGrid", "ogd", MFn::kFluid, MObject::kNullObj, NULL); if (outGrid.isNull()) cerr << "object is null" << endl; tAttr.setWritable(false); tAttr.setStorable(false); If we...
Read more →