MStatus ModifyArrayNode::initialize() { MStatus status; MFnTypedAttribute T; MFnNumericAttribute N; MFnEnumAttribute E; aInput = T.create("input", "i", MFnData::kDoubleArray); T.setKeyable(false); T.setChannelBox(false); T.setStorable(true); T.setWritable(true); aOperation = E.create("operation", "operation"); E.addField("No Operation", kNO_OP); E.addField("Sort", kSORT); E.addField("Absolute Value", kABS); E.addField("Reflect Left", kREFLECT_LEFT); E.addField("Reflect Right", kREFLECT_RIGHT); E.setDefault(kNO_OP); E.setKeyable(true); E.setStorable(true); E.setWritable(true); aReverse = N.create("reverse", "rev", MFnNumericData::kBoolean); N.setKeyable(true); N.setChannelBox(true); N.setStorable(true); N.setWritable(true); aOutput = T.create("output", "o", MFnData::kDoubleArray); T.setKeyable(false); T.setChannelBox(false); T.setWritable(false); T.setStorable(false); addAttribute(aOperation); addAttribute(aInput); addAttribute(aReverse); addAttribute(aOutput); attributeAffects(aOperation, aOutput); attributeAffects(aInput, aOutput); attributeAffects(aReverse, aOutput); return MS::kSuccess; }
MStatus ArrayAngleConstructorNode::initialize() { MStatus status; MFnNumericAttribute N; MFnTypedAttribute T; MFnUnitAttribute U; aSize = N.create("size", "size", MFnNumericData::kInt, 8.0, &status); N.setKeyable(true); N.setStorable(true); N.setWritable(true); N.setDefault(8); aInput = U.create("input", "i", MFnUnitAttribute::kAngle, 0.0, &status); U.setKeyable(false); U.setStorable(true); U.setWritable(true); U.setArray(true); aOutput = T.create("output", "o", MFnData::kDoubleArray, &status); T.setKeyable(false); T.setChannelBox(false); T.setWritable(false); T.setStorable(false); addAttribute(aSize); addAttribute(aInput); addAttribute(aOutput); attributeAffects(aSize, aOutput); attributeAffects(aInput, aOutput); return MS::kSuccess; }
MStatus ReduceArrayNode::initialize() { MStatus status; MFnTypedAttribute T; MFnNumericAttribute N; MFnEnumAttribute E; aInput = T.create("input", "i", MFnData::kDoubleArray); T.setKeyable(false); T.setChannelBox(false); T.setStorable(true); T.setWritable(true); aOutput = N.create("output", "o", MFnNumericData::kDouble, 0.0); T.setKeyable(false); T.setChannelBox(false); T.setWritable(true); T.setStorable(true); aOperation = E.create("operation", "operation"); E.addField("No Operation", kNO_OP); E.addField("Sum", kSUM); E.addField("Difference", kDIFFERENCE); E.addField("Average", kAVERAGE); E.addField("Product", kPRODUCT); E.addField("Quotient", kQUOTIENT); E.addField("Exponent", kEXPONENT); E.addField("Minimum", kMIN); E.addField("Maximum", kMAX); E.addField("Length", kLENGTH); E.setKeyable(true); E.setStorable(true); E.setWritable(true); addAttribute(aOperation); addAttribute(aInput); addAttribute(aOutput); attributeAffects(aOperation, aOutput); attributeAffects(aInput, aOutput); return MS::kSuccess; }
MStatus RemapArrayValuesNode::initialize() { MStatus status; MFnCompoundAttribute C; MFnTypedAttribute T; MFnNumericAttribute N; MFnEnumAttribute E; aInput = T.create("input", "i", MFnData::kDoubleArray, &status); CHECK_MSTATUS_AND_RETURN_IT(status); T.setKeyable(false); T.setChannelBox(false); T.setStorable(true); T.setWritable(true); aInputMin = N.create("inputMin", "imn", MFnNumericData::kDouble, 0.0, &status); CHECK_MSTATUS_AND_RETURN_IT(status); N.setKeyable(true); N.setChannelBox(true); N.setStorable(true); N.setWritable(true); aInputMax = N.create("inputMax", "imx", MFnNumericData::kDouble, 0.0, &status); CHECK_MSTATUS_AND_RETURN_IT(status); N.setKeyable(true); N.setChannelBox(true); N.setStorable(true); N.setWritable(true); N.setDefault(1.0); aOutputMin = N.create("outputMin", "omn", MFnNumericData::kDouble, 0.0, &status); CHECK_MSTATUS_AND_RETURN_IT(status); N.setKeyable(true); N.setChannelBox(true); N.setStorable(true); N.setWritable(true); aOutputMax = N.create("outputMax", "omx", MFnNumericData::kDouble, 0.0, &status); CHECK_MSTATUS_AND_RETURN_IT(status); N.setKeyable(true); N.setChannelBox(true); N.setStorable(true); N.setWritable(true); N.setDefault(1.0); aRamp = MRampAttribute::createCurveRamp("values", "vl", &status); CHECK_MSTATUS_AND_RETURN_IT(status); aOutput = T.create("output", "o", MFnData::kDoubleArray, &status); CHECK_MSTATUS_AND_RETURN_IT(status); T.setKeyable(false); T.setChannelBox(false); T.setWritable(false); T.setStorable(false); addAttribute(aInput); addAttribute(aInputMin); addAttribute(aInputMax); addAttribute(aOutputMin); addAttribute(aOutputMax); addAttribute(aRamp); addAttribute(aOutput); attributeAffects(aInput, aOutput); attributeAffects(aInputMin, aOutput); attributeAffects(aInputMax, aOutput); attributeAffects(aOutputMin, aOutput); attributeAffects(aOutputMax, aOutput); attributeAffects(aRamp, aOutput); return MS::kSuccess; }