MStatus areaLightNode::initialize() { MStatus stat; MFnNumericAttribute numAttr; areaLightColor=numAttr.createColor("LightColor","lico"); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setDefault(0.5,0.5,0.5); areaPower=numAttr.create("Power","ap",MFnNumericData::kFloat,1.0); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setMin(0.0); numAttr.setMax(10000.0); areaSamples=numAttr.create("Samples","as",MFnNumericData::kInt,1); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setMin(0); numAttr.setMax(512); areaMakeGeo=numAttr.create("MakeGeometry","mg",MFnNumericData::kBoolean,0); numAttr.setKeyable(true); numAttr.setStorable(true); addAttribute(areaLightColor); addAttribute(areaPower); addAttribute(areaSamples); addAttribute(areaMakeGeo); return stat; }
MStatus liqCoordSysNode::initialize() { MFnEnumAttribute eAttr; MFnNumericAttribute numAttr; MStatus status; aCoordType = eAttr.create( "type", "t", 0, &status ); eAttr.addField( "Card", 0 ); eAttr.addField( "Sphere", 1 ); eAttr.addField( "Cylinder", 2 ); eAttr.addField( "Cube", 3 ); eAttr.addField( "Deep Card", 4 ); eAttr.addField( "Clipping Plane", 5 ); MAKE_INPUT(eAttr); CHECK_MSTATUS(eAttr.setConnectable(false)); CHECK_MSTATUS( addAttribute( aCoordType ) ); aCoordColor = numAttr.createColor( "coordColor", "cc", &status ); MAKE_INPUT(numAttr); CHECK_MSTATUS( numAttr.setMin( 0.0, 0.0, 0.0 ) ); CHECK_MSTATUS( numAttr.setMax( 1.0, 1.0, 1.0 ) ); CHECK_MSTATUS( numAttr.setDefault( 0.0, 0.0, 0.5) ); CHECK_MSTATUS( addAttribute( aCoordColor ) ); aCoordOpacity = numAttr.create( "coordOpacity", "co", MFnNumericData::kFloat, 0.0, &status ); MAKE_INPUT(numAttr); CHECK_MSTATUS( numAttr.setMin( 0.0 ) ); CHECK_MSTATUS( numAttr.setMax( 1.0 ) ); CHECK_MSTATUS( addAttribute( aCoordOpacity ) ); return MS::kSuccess; }
MStatus blendCurve::initialize() { MStatus status; MFnNumericAttribute nAttr; MFnTypedAttribute tAttr; MFnCompoundAttribute cAttr; aInputs = cAttr.create( "inputs", "inputs" ); aInputCurve = tAttr.create( "inputCurve", "inputCurve", MFnData::kNurbsCurve ); tAttr.setStorable( false ); aWeight = nAttr.create( "weight", "weight", MFnNumericData::kFloat, 1.0 ); nAttr.setMin( 0.0 ); nAttr.setMax( 1.0 ); nAttr.setKeyable( true ); aBlendPosition = nAttr.create( "blendPosition", "blendPosition", MFnNumericData::kFloat, 1.0 ); nAttr.setMin( 0.0 ); nAttr.setMax( 1.0 ); nAttr.setKeyable( true ); aBlendArea = nAttr.create( "blendArea", "blendArea", MFnNumericData::kFloat, 0.5 ); nAttr.setMin( 0.0 ); nAttr.setMax( 1.0 ); nAttr.setKeyable( true ); cAttr.addChild( aInputCurve ); cAttr.addChild( aWeight ); cAttr.addChild( aBlendPosition ); cAttr.addChild( aBlendArea ); cAttr.setArray( true ); CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputs ) ); CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputs, outputGeom ) ); return MS::kSuccess; }
/*! * Initialize attributes in Maya. */ MStatus ffdPlanar::initialize() { // Local attributes. MFnNumericAttribute nAttr; latticeRow1 = nAttr.create( "row1", "r1", MFnNumericData::k3Double ); nAttr.setDefault( 0.0, 0.0, 0.0 ); nAttr.setMin( -100.0, -100.0, -100.0 ); nAttr.setMax( 100.0, 100.0, 100.0 ); nAttr.setKeyable( true ); addAttribute( latticeRow1 ); latticeRow2 = nAttr.create( "row2", "r2", MFnNumericData::k3Double ); nAttr.setDefault( 0.0, 0.0, 0.0 ); nAttr.setMin( -100.0, -100.0, -100.0 ); nAttr.setMax( 100.0, 100.0, 100.0 ); nAttr.setKeyable( true ); addAttribute( latticeRow2 ); latticeRow3 = nAttr.create( "row3", "r3", MFnNumericData::k3Double ); nAttr.setDefault( 0.0, 0.0, 0.0 ); nAttr.setMin( -100.0, -100.0, -100.0 ); nAttr.setMax( 100.0, 100.0, 100.0 ); nAttr.setKeyable( true ); addAttribute( latticeRow3 ); // Attributes affect geometry. attributeAffects( ffdPlanar::latticeRow1, ffdPlanar::outputGeom ); attributeAffects( ffdPlanar::latticeRow2, ffdPlanar::outputGeom ); attributeAffects( ffdPlanar::latticeRow3, ffdPlanar::outputGeom ); return MS::kSuccess; }
// Initialize the plug-in. Called once when the plug-in is loaded. // This mostly involve creating attributes. MStatus hwRefractReflectShader_NV20::initialize() { MFnNumericAttribute nAttr; MStatus status; MFnTypedAttribute sAttr; // For string attributes // Create input attributes colorR = nAttr.create( "colorR", "cr",MFnNumericData::kFloat); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setDefault(1.0f); colorG = nAttr.create( "colorG", "cg",MFnNumericData::kFloat); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setDefault(0.5f); colorB = nAttr.create( "colorB", "cb",MFnNumericData::kFloat); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setDefault(0.5f); color = nAttr.create( "color", "c", colorR, colorG, colorB); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setDefault(1.0f, 0.5f, 0.5f); nAttr.setUsedAsColor(true); refractionIndex = nAttr.create( "refractionIndex", "ri", MFnNumericData::kFloat); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setMin(1.0f); nAttr.setMax(2.0f); nAttr.setDefault(1.1f); reflectivity = nAttr.create( "reflectivity", "rfl", MFnNumericData::kFloat); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setMin(0.0f); nAttr.setMax(1.0f); nAttr.setDefault(0.5f); // Add the attributes here addAttribute(color); addAttribute(refractionIndex); addAttribute(reflectivity); attributeAffects (colorR, outColor); attributeAffects (colorG, outColor); attributeAffects (colorB, outColor); attributeAffects (color, outColor); attributeAffects (refractionIndex, outColor); attributeAffects (reflectivity, outColor); return MS::kSuccess; }
MStatus OpenSubdivShader::initialize() { MStatus stat; MFnTypedAttribute typedAttr; MFnNumericAttribute numAttr; MFnEnumAttribute enumAttr; aLevel = numAttr.create("level", "lv", MFnNumericData::kLong, 1); numAttr.setInternal(true); numAttr.setMin(1); numAttr.setSoftMax(5); aScheme = enumAttr.create("scheme", "sc"); enumAttr.addField("Catmull-Clark", kCatmark); enumAttr.addField("Loop", kLoop); enumAttr.addField("Bilinear", kBilinear); enumAttr.setInternal(true); aKernel = enumAttr.create("kernel", "kn"); enumAttr.addField("CPU", OpenSubdiv::OsdKernelDispatcher::kCPU); if (OpenSubdiv::OsdKernelDispatcher::HasKernelType(OpenSubdiv::OsdKernelDispatcher::kOPENMP)) enumAttr.addField("OpenMP", OpenSubdiv::OsdKernelDispatcher::kOPENMP); if (OpenSubdiv::OsdKernelDispatcher::HasKernelType(OpenSubdiv::OsdKernelDispatcher::kCL)) enumAttr.addField("CL", OpenSubdiv::OsdKernelDispatcher::kCL); if (OpenSubdiv::OsdKernelDispatcher::HasKernelType(OpenSubdiv::OsdKernelDispatcher::kCUDA)) enumAttr.addField("CUDA", OpenSubdiv::OsdKernelDispatcher::kCUDA); enumAttr.setInternal(true); aDiffuse = numAttr.createColor("diffuse", "d"); numAttr.setDefault(1.0f, 1.0f, 1.0f); aSpecular = numAttr.createColor("specular", "s"); numAttr.setDefault(1.0f, 1.0f, 1.0f); aAmbient = numAttr.createColor("ambient", "a"); numAttr.setDefault(1.0f, 1.0f, 1.0f); aShininess = numAttr.create("shininess", "shin", MFnNumericData::kFloat, 16.0f); numAttr.setMin(0); numAttr.setMax(128.0f); aWireframe = numAttr.create("wireframe", "wf", MFnNumericData::kBoolean); addAttribute(aLevel); addAttribute(aScheme); addAttribute(aKernel); addAttribute(aDiffuse); addAttribute(aSpecular); addAttribute(aAmbient); addAttribute(aShininess); addAttribute(aWireframe); return MS::kSuccess; }
// // DESCRIPTION: /////////////////////////////////////////////////////// MStatus depthShader::initialize() { MFnNumericAttribute nAttr; // Create input attributes aColorNear = nAttr.createColor("color", "c"); MAKE_INPUT(nAttr); CHECK_MSTATUS(nAttr.setDefault(0., 1., 0.)); // Green aColorFar = nAttr.createColor("colorFar", "cf"); MAKE_INPUT(nAttr); CHECK_MSTATUS(nAttr.setDefault(0., 0., 1.)); // Blue aNear = nAttr.create("near", "n", MFnNumericData::kFloat); MAKE_INPUT(nAttr); CHECK_MSTATUS(nAttr.setMin(0.0f)); CHECK_MSTATUS(nAttr.setSoftMax(1000.0f)); aFar = nAttr.create("far", "f", MFnNumericData::kFloat); MAKE_INPUT(nAttr); CHECK_MSTATUS(nAttr.setMin(0.0f)); CHECK_MSTATUS(nAttr.setSoftMax(1000.0f)); CHECK_MSTATUS(nAttr.setDefault(2.0f)); aPointCamera = nAttr.createPoint("pointCamera", "p"); MAKE_INPUT(nAttr); CHECK_MSTATUS(nAttr.setHidden(true)); // Create output attributes aOutColor = nAttr.createColor("outColor", "oc"); MAKE_OUTPUT(nAttr); CHECK_MSTATUS(addAttribute(aColorNear)); CHECK_MSTATUS(addAttribute(aColorFar)); CHECK_MSTATUS(addAttribute(aNear) ); CHECK_MSTATUS(addAttribute(aFar)); CHECK_MSTATUS(addAttribute(aPointCamera)); CHECK_MSTATUS(addAttribute(aOutColor)); CHECK_MSTATUS(attributeAffects(aColorNear, aOutColor)); CHECK_MSTATUS(attributeAffects(aColorFar, aOutColor)); CHECK_MSTATUS(attributeAffects(aNear, aOutColor)); CHECK_MSTATUS(attributeAffects(aFar, aOutColor)); CHECK_MSTATUS(attributeAffects(aPointCamera, aOutColor)); return MS::kSuccess; }
MStatus sgBLocator_fromGeo::initialize() { MStatus status; MFnNumericAttribute nAttr; MFnTypedAttribute tAttr; aOutputValue = nAttr.create( "outputValue", "outputValue", MFnNumericData::kInt, 1.0 ); nAttr.setStorable( false ); CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutputValue ) ); CHECK_MSTATUS_AND_RETURN_IT( status ); aInputCurve = tAttr.create( "inputCurve", "inputCurve", MFnData::kNurbsCurve ); tAttr.setStorable( true ); CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputCurve ) ); aLineWidth = nAttr.create( "lineWidth", "lineWidth", MFnNumericData::kInt, 1 ); nAttr.setMin( 1 ); nAttr.setKeyable( true ); nAttr.setStorable( true ); CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aLineWidth ) ); CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputCurve, aOutputValue ) ); CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aLineWidth, aOutputValue ) ); return MS::kSuccess; }
MStatus mapBlendShape::initialize() { MStatus status; MFnNumericAttribute nAttr; MFnTypedAttribute tAttr; aBlendMesh = tAttr.create("blendMesh", "blendMesh", MFnData::kMesh); addAttribute(aBlendMesh); aBlendMap = nAttr.createColor("blendMap", "blendMap"); addAttribute(aBlendMap); aUseBlendMap = nAttr.create("useBlendMap", "useBlendMap", MFnNumericData::kBoolean); nAttr.setDefault(true); addAttribute(aUseBlendMap); aBlendMapMultiplier = nAttr.create("blendMapMultiplier", "blendMapMultiplier", MFnNumericData::kFloat); nAttr.setDefault(1.0); nAttr.setMin(0.0); addAttribute(aBlendMapMultiplier); attributeAffects(aBlendMesh, outputGeom); attributeAffects(aBlendMap, outputGeom); attributeAffects(aUseBlendMap, outputGeom); attributeAffects(aBlendMapMultiplier, outputGeom); MGlobal::executeCommand( "makePaintable -attrType multiFloat -sm deformer blendNode weights;" ); return MS::kSuccess; }
MStatus BasicLocator::initialize() { //standard attribute creation for the locator node MStatus status; MFnNumericAttribute nAttr; MFnEnumAttribute eAttr; //output attribute aIsDrawing = nAttr.create("draw", "d", MFnNumericData::kBoolean, 1); nAttr.setWritable(true); nAttr.setStorable(true); addAttribute(aIsDrawing); aIsTransparent = nAttr.create("transparent", "tpart", MFnNumericData::kFloat, 0.5); nAttr.setMin(0.0); nAttr.setMax(1.0); nAttr.setWritable(true); nAttr.setStorable(true); addAttribute(aIsTransparent); aShapeColor = nAttr.createColor("color", "col"); nAttr.setDefault(0.1, 0.1, 0.8); nAttr.setStorable(true); nAttr.setWritable(true); addAttribute(aShapeColor); aShapeType = eAttr.create("shapeType", "styp", 0); eAttr.setStorable(true); eAttr.setKeyable(true); eAttr.addField("arrow", 0); eAttr.addField("disc", 1); addAttribute(aShapeType); return MS::kSuccess; }
MStatus sgBulgeDeformer::initialize() { MStatus status; MFnNumericAttribute nAttr; MFnTypedAttribute tAttr; MFnMatrixAttribute mAttr; MFnCompoundAttribute cAttr; aBulgeWeight = nAttr.create(nameBulgeWeight, nameBulgeWeight, MFnNumericData::kFloat, 1.0); nAttr.setStorable(false); nAttr.setKeyable(true); addAttribute(aBulgeWeight); aBulgeRadius = nAttr.create(nameBulgeRadius, nameBulgeRadius, MFnNumericData::kDouble, 0); nAttr.setMin(0); nAttr.setStorable(false); nAttr.setKeyable(true); addAttribute(aBulgeRadius); aBulgeInputs = cAttr.create(nameBulgeInputs, nameBulgeInputs); aMatrix = mAttr.create(nameMatrix, nameMatrix); aMesh = tAttr.create(nameMesh, nameMesh, MFnData::kMesh ); cAttr.addChild(aMatrix); cAttr.addChild(aMesh); cAttr.setArray(true); addAttribute(aBulgeInputs); attributeAffects(aBulgeWeight, outputGeom); attributeAffects(aBulgeRadius, outputGeom); attributeAffects(aBulgeInputs, outputGeom); return status; }
MStatus sgIkSmoothStretch::initialize() { MStatus stat; MFnNumericAttribute nAttr; aInputDistance = nAttr.create( "inputDistance", "in", MFnNumericData::kDouble, 0.0 ); nAttr.setArray( true ); nAttr.setUsesArrayDataBuilder( true ); nAttr.setStorable( true ); aInPositionX = nAttr.create( "inPositionX", "ipx", MFnNumericData::kDouble, 0.0 ); nAttr.setStorable( true ); aInPositionY = nAttr.create( "inPositionY", "ipy", MFnNumericData::kDouble, 0.0 ); nAttr.setStorable( true ); aInPositionZ = nAttr.create( "inPositionZ", "ipz", MFnNumericData::kDouble, 0.0 ); nAttr.setStorable( true ); aInPosition = nAttr.create( "inPosition", "ip", aInPositionX, aInPositionY, aInPositionZ ); aOutputDistance = nAttr.create( "outputDistance", "out", MFnNumericData::kDouble, 0,0 ); nAttr.setArray( true ); nAttr.setUsesArrayDataBuilder( true ); nAttr.setStorable( false ); nAttr.setWritable( false ); aSmoothArea = nAttr.create( "smoothArea", "smoothArea", MFnNumericData::kDouble, 0.0 ); nAttr.setStorable( true ); aStretchAble = nAttr.create( "stretchAble", "sa", MFnNumericData::kFloat, 1.0 ); nAttr.setStorable( true ); nAttr.setMin( 0.0 ); nAttr.setMax( 1 ); stat = addAttribute( aInputDistance ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aInPosition ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aOutputDistance ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aStretchAble ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aSmoothArea ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = attributeAffects( aInputDistance, aOutputDistance ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aInPosition, aOutputDistance ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aStretchAble, aOutputDistance ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aSmoothArea, aOutputDistance ); if (!stat) { stat.perror("attributeAffects"); return stat;} return MS::kSuccess; }
MStatus sphereLightNode::initialize() { MStatus stat; MFnNumericAttribute numAttr; sphereColor=numAttr.createColor("LightColor","lico"); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setDefault(1.0,1.0,1.0); spherePower=numAttr.create("Power","pw",MFnNumericData::kFloat,1.0); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setMin(0.0); numAttr.setMax(10000.0); sphereRadius=numAttr.create("Radius","ra",MFnNumericData::kFloat,1.0); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setMin(0.0); numAttr.setMax(100.0); sphereSamples=numAttr.create("Samples","sam",MFnNumericData::kInt,16); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setMin(0); numAttr.setMax(512); sphereMakeGeometry=numAttr.create("MakeGeometry","mg",MFnNumericData::kBoolean,0); numAttr.setKeyable(true); numAttr.setStorable(true); addAttribute(sphereColor); addAttribute(spherePower); addAttribute(sphereRadius); addAttribute(sphereSamples); addAttribute(sphereMakeGeometry); return stat; }
// initializes attribute information MStatus myComp::initialize() { MFnNumericAttribute nAttr; // Create input attributes aForegroundColor = nAttr.createColor("foreground", "fg"); MAKE_INPUT(nAttr); aBackgroundColor = nAttr.createColor("background", "bg"); MAKE_INPUT(nAttr); CHECK_MSTATUS( nAttr.setDefault(1., 1., 1.)); aBackColor = nAttr.createColor("backColor", "bk"); MAKE_INPUT(nAttr); CHECK_MSTATUS( nAttr.setDefault(1., 1., 1.)); aMask = nAttr.create( "mask", "ms", MFnNumericData::kFloat); CHECK_MSTATUS( nAttr.setMin(0.f)); CHECK_MSTATUS( nAttr.setMax(1.f)); MAKE_INPUT(nAttr); // Create output attributes here aOutColor = nAttr.createColor("outColor", "oc"); MAKE_OUTPUT(nAttr); aOutAlpha = nAttr.create( "outAlpha", "oa", MFnNumericData::kFloat); MAKE_OUTPUT(nAttr); // Add the attributes here CHECK_MSTATUS( addAttribute(aForegroundColor) ); CHECK_MSTATUS( addAttribute(aBackgroundColor) ); CHECK_MSTATUS( addAttribute(aBackColor) ); CHECK_MSTATUS( addAttribute(aMask) ); CHECK_MSTATUS( addAttribute(aOutColor) ); CHECK_MSTATUS( addAttribute(aOutAlpha) ); // all input affect the output color and alpha CHECK_MSTATUS( attributeAffects(aForegroundColor, aOutColor) ); CHECK_MSTATUS( attributeAffects(aForegroundColor, aOutAlpha) ); CHECK_MSTATUS( attributeAffects(aBackgroundColor, aOutColor) ); CHECK_MSTATUS( attributeAffects(aBackgroundColor, aOutAlpha) ); CHECK_MSTATUS( attributeAffects(aBackColor, aOutColor) ); CHECK_MSTATUS( attributeAffects(aBackColor, aOutAlpha) ); CHECK_MSTATUS( attributeAffects(aMask, aOutColor) ); CHECK_MSTATUS( attributeAffects(aMask, aOutAlpha) ); return MS::kSuccess; }
MStatus ik2Bsolver::initialize() { MFnNumericAttribute numattr; arestLength1 = numattr.create("restLength1", "rsl1", MFnNumericData::kDouble, 16.0); numattr.setMin(1.0); numattr.setKeyable(true); numattr.setReadable(true); numattr.setConnectable(true); addAttribute(arestLength1); arestLength2 = numattr.create("restLength2", "rsl2", MFnNumericData::kDouble, 16.0); numattr.setMin(1.0); numattr.setKeyable(true); numattr.setReadable(true); numattr.setConnectable(true); addAttribute(arestLength2); asoftDistance = numattr.create("softDistance", "sftd", MFnNumericData::kDouble, 1.0); numattr.setMin(0.01); numattr.setKeyable(true); numattr.setReadable(true); numattr.setConnectable(true); numattr.setStorable(true); addAttribute(asoftDistance); amaxStretching = numattr.create("maxStretching", "mstc", MFnNumericData::kDouble, 4.0); numattr.setMin(0.0); numattr.setKeyable(true); numattr.setReadable(true); numattr.setConnectable(true); numattr.setStorable(true); addAttribute(amaxStretching); attributeAffects(asoftDistance, ik2Bsolver::message); return MS::kSuccess; }
MStatus BasicLocator::initialize() { MFnUnitAttribute unitFn; MFnNumericAttribute numFn; MStatus stat; xWidth = unitFn.create( "xWidth", "xw", MFnUnitAttribute::kDistance ); unitFn.setDefault( MDistance(1.0, MDistance::uiUnit()) ); unitFn.setMin( MDistance(0.0, MDistance::uiUnit()) ); unitFn.setKeyable( true ); stat = addAttribute( xWidth ); if (!stat) { stat.perror( "Unable to add \"xWidth\" attribute" ); return stat; } zWidth = unitFn.create( "zWidth", "zw", MFnUnitAttribute::kDistance ); unitFn.setDefault( MDistance(1.0, MDistance::uiUnit()) ); unitFn.setMin( MDistance(0.0, MDistance::uiUnit()) ); unitFn.setKeyable( true ); stat = addAttribute( zWidth ); if (!stat) { stat.perror( "Unable to add \"zWidth\" attribute" ); return stat; } dispType = numFn.create( "dispType", "att", MFnNumericData::kShort ); numFn.setDefault( 0); numFn.setMin( 0 ); numFn.setMax( 2 ); numFn.setKeyable( true ); stat = addAttribute( dispType ); if (!stat) { stat.perror( "Unable to add \"dispType\" attribute" ); return stat; } // Notify Maya that there is an associated manipulator for this particular type of node MPxManipContainer::addToManipConnectTable( const_cast<MTypeId &>( typeId ) ); return MS::kSuccess; }
MStatus meshCacheNode::initialize() { MFnNumericAttribute numAttr; MStatus stat; stat = zWorks::createTimeAttr(frame, "currentTime", "ct", 1.0); zCheckStatus(stat, "ERROR creating time"); zCheckStatus(addAttribute(frame), "ERROR adding time"); aminframe = numAttr.create( "minFrame", "mnf", MFnNumericData::kInt, 1 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aminframe ); amaxframe = numAttr.create( "maxFrame", "mxf", MFnNumericData::kInt, 24 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( amaxframe ); aframestep = numAttr.create( "frameStep", "fst", MFnNumericData::kInt, 1 ); numAttr.setMin(1); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aframestep ); MFnTypedAttribute stringAttr; input = stringAttr.create( "cachePath", "cp", MFnData::kString ); stringAttr.setStorable(true); addAttribute( input ); MFnTypedAttribute meshAttr; outMesh = meshAttr.create( "outMesh", "o", MFnData::kMesh ); meshAttr.setStorable(false); meshAttr.setWritable(false); addAttribute( outMesh ); attributeAffects( input, outMesh ); attributeAffects( frame, outMesh ); attributeAffects( aminframe, outMesh ); attributeAffects( amaxframe, outMesh ); attributeAffects( aframestep, outMesh ); return MS::kSuccess; }
MStatus PRTAttrs::addFloatParameter(MFnDependencyNode & node, MObject & attr, const MString & name, double value, double min, double max) { MStatus stat; MFnNumericAttribute nAttr; attr = nAttr.create(longName(name), briefName(name), MFnNumericData::kDouble, value, &stat ); if ( stat != MS::kSuccess ) throw stat; if(!isnan(min)) { MCHECK(nAttr.setMin(min)); } if(!isnan(max)) { MCHECK(nAttr.setMax( max )); } MCHECK(addParameter(node, attr, nAttr)); MPlug plug(node.object(), attr); MCHECK(plug.setValue(value)); return MS::kSuccess; }
MStatus vxCacheDeformer::initialize() { MFnNumericAttribute numAttr; MFnTypedAttribute stringAttr; MStatus status; status = zWorks::createTimeAttr(frame, "currentTime", "ct", 1.0); zCheckStatus(status, "ERROR creating time"); zCheckStatus(addAttribute(frame), "ERROR adding time"); path = stringAttr.create( "cachePath", "cp", MFnData::kString ); stringAttr.setStorable(true); addAttribute( path ); aminframe = numAttr.create( "minFrame", "mnf", MFnNumericData::kInt, 1 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aminframe ); amaxframe = numAttr.create( "maxFrame", "mxf", MFnNumericData::kInt, 24 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( amaxframe ); aframestep = numAttr.create( "frameStep", "fst", MFnNumericData::kInt, 1 ); numAttr.setMin(1); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aframestep ); attributeAffects( frame, vxCacheDeformer::outputGeom ); attributeAffects( path, vxCacheDeformer::outputGeom ); attributeAffects( aminframe, vxCacheDeformer::outputGeom ); attributeAffects( amaxframe, vxCacheDeformer::outputGeom ); attributeAffects( aframestep, vxCacheDeformer::outputGeom ); return MStatus::kSuccess; }
MStatus pointLightNode::initialize() { MStatus stat; MFnNumericAttribute numAttr; pointLightColor=numAttr.createColor("LightColor","plico"); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setDefault(1.0,1.0,1.0); pointPower=numAttr.create("Power","pp",MFnNumericData::kFloat,1.0); numAttr.setKeyable(true); numAttr.setStorable(true); numAttr.setMin(0.0); numAttr.setMax(10000.0); addAttribute(pointLightColor); addAttribute(pointPower); return stat=MStatus::kSuccess; }
MStatus MG_curve::initialize() { //This is the curve degree attribute MFnNumericAttribute numFn; degree = numFn.create("degree","d",MFnNumericData::kInt,3); numFn.setMin(1); addAttribute(degree); //Those are all the matrix input MFnMatrixAttribute matrixFn; inputMatrix =matrixFn.create("inputMatrix","im"); matrixFn.setArray(true); matrixFn.setStorable(true); addAttribute(inputMatrix); //This is the curve's matrix used to compensate curve translate transformMatrix =matrixFn.create("transformMatrix","tm"); matrixFn.setStorable(true); addAttribute(transformMatrix); //This is the curve output attribute MFnTypedAttribute typedFn; output = typedFn.create("output","o",MFnData::kNurbsCurve); typedFn.setStorable(false); typedFn.setWritable(false); addAttribute(output); attributeAffects(degree,output); attributeAffects(inputMatrix,output); attributeAffects(transformMatrix,output); return MS::kSuccess; }
MStatus retargetLocator::initialize() { MFnNumericAttribute nAttr; MFnMatrixAttribute mAttr; MFnEnumAttribute eAttr; MFnUnitAttribute uAttr; MFnCompoundAttribute cAttr; MFnTypedAttribute tAttr; aOutput = nAttr.create( "output", "output", MFnNumericData::kDouble ); nAttr.setStorable( false ); CHECK_MSTATUS( addAttribute( aOutput ) ); aDiscMatrix = mAttr.create( "discMatrix", "discMatrix" ); mAttr.setStorable( true ); CHECK_MSTATUS( addAttribute( aDiscMatrix ) ); CHECK_MSTATUS( attributeAffects( aDiscMatrix, aOutput ) ); aDiscAxis = eAttr.create( "discAxis", "discAxis", 0 ); eAttr.addField( "X", 0 ); eAttr.addField( "Y", 1 ); eAttr.addField( "Z", 2 ); eAttr.setStorable( true ); eAttr.setChannelBox( true ); eAttr.setReadable( true ); CHECK_MSTATUS( addAttribute( aDiscAxis ) ); CHECK_MSTATUS( attributeAffects( aDiscAxis, aOutput ) ); aDiscDivision = nAttr.create( "discDivision", "discDivision", MFnNumericData::kInt, 32 ); nAttr.setMin( 1 ); nAttr.setMax( 32 ); nAttr.setStorable( true ); nAttr.setChannelBox( true ); CHECK_MSTATUS( addAttribute( aDiscDivision ) ); CHECK_MSTATUS( attributeAffects( aDiscDivision, aOutput ) ); aDiscAngle = uAttr.create( "discAngle", "discAngle", MFnUnitAttribute::kAngle, 0.0 ); uAttr.setStorable( true ); uAttr.setChannelBox( true ); CHECK_MSTATUS( addAttribute( aDiscAngle ) ); CHECK_MSTATUS( attributeAffects( aDiscAngle, aOutput ) ); aDiscOffsetX = nAttr.create( "discOffsetX", "discOffsetX", MFnNumericData::kDouble, 0.0 ); aDiscOffsetY = nAttr.create( "discOffsetY", "discOffsetY", MFnNumericData::kDouble, 0.0 ); aDiscOffsetZ = nAttr.create( "discOffsetZ", "discOffsetZ", MFnNumericData::kDouble, 0.0 ); aDiscOffset = nAttr.create( "discOffset", "discOffset", aDiscOffsetX, aDiscOffsetY, aDiscOffsetZ ); uAttr.setStorable( true ); uAttr.setChannelBox( true ); CHECK_MSTATUS( addAttribute( aDiscOffset ) ); CHECK_MSTATUS( attributeAffects( aDiscOffset, aOutput ) ); aDiscSizeX = nAttr.create( "discSizeX", "discSizeX", MFnNumericData::kDouble, 1.0 ); aDiscSizeY = nAttr.create( "discSizeY", "discSizeY", MFnNumericData::kDouble, 1.0 ); aDiscSizeZ = nAttr.create( "discSizeZ", "discSizeZ", MFnNumericData::kDouble, 1.0 ); aDiscSize = nAttr.create( "discSize", "discSize", aDiscSizeX, aDiscSizeY, aDiscSizeZ ); uAttr.setStorable( true ); uAttr.setChannelBox( true ); CHECK_MSTATUS( addAttribute( aDiscSize ) ); CHECK_MSTATUS( attributeAffects( aDiscSize, aOutput ) ); aDiscActiveColor = nAttr.createColor( "discActiveColor", "discActiveColor" ); nAttr.setStorable( true ); nAttr.setUsedAsColor(true); nAttr.setDefault(1.0f, 1.0f, 1.0f); CHECK_MSTATUS( addAttribute( aDiscActiveColor ) ); CHECK_MSTATUS( attributeAffects( aDiscActiveColor, aOutput ) ); aDiscLeadColor = nAttr.createColor( "discLeadColor", "discLeadColor" ); nAttr.setStorable( true ); nAttr.setUsedAsColor(true); nAttr.setDefault(.263f, 1.0f, .639f); CHECK_MSTATUS( addAttribute( aDiscLeadColor ) ); CHECK_MSTATUS( attributeAffects( aDiscLeadColor, aOutput ) ); aDiscDefaultColor = nAttr.createColor( "discDefaultColor", "discDefaultColor" ); nAttr.setStorable( true ); nAttr.setUsedAsColor(true); nAttr.setDefault(.0f, .016f, .376f); CHECK_MSTATUS( addAttribute( aDiscDefaultColor ) ); CHECK_MSTATUS( attributeAffects( aDiscDefaultColor, aOutput ) ); aDiscFillAlpha = nAttr.create( "discFillAlpha", "discFillAlpha", MFnNumericData::kFloat, 0.1f ); nAttr.setStorable( true ); nAttr.setMin( 0.0f ); nAttr.setMax( 1.0f ); CHECK_MSTATUS( addAttribute( aDiscFillAlpha ) ); CHECK_MSTATUS( attributeAffects( aDiscFillAlpha, aOutput ) ); aDiscLineAlpha = nAttr.create( "discLineAlpha", "discLineAlpha", MFnNumericData::kFloat, 1.0f ); nAttr.setStorable( true ); nAttr.setMin( 0.0f ); nAttr.setMax( 1.0f ); CHECK_MSTATUS( addAttribute( aDiscLineAlpha ) ); CHECK_MSTATUS( attributeAffects( aDiscLineAlpha, aOutput ) ); aArrow = cAttr.create( "arrow", "arrow" ); aInheritMatrix = nAttr.create( "inheritMatrix", "inheritMatrix", MFnNumericData::kBoolean, false ); aInputMesh = tAttr.create( "inputMesh", "inputMesh", MFnData::kMesh ); aAimMatrix = mAttr.create( "aimMatrix", "aimMatrix" ); aStartSize = nAttr.create( "startSize", "startSize", MFnNumericData::kFloat, 0.5f ); aSize = nAttr.create( "size", "size", MFnNumericData::kFloat, 1.0f ); aActiveColor = nAttr.createColor( "activeColor", "activeColor" ); nAttr.setUsedAsColor(true); nAttr.setDefault(1.0f, 1.0f, 1.0f); aLeadColor = nAttr.createColor( "leadColor", "leadColor" ); nAttr.setUsedAsColor(true); nAttr.setDefault(.263f, 1.0f, .639f); aDefaultColor = nAttr.createColor( "defaultColor", "defaultColor" ); nAttr.setUsedAsColor(true); nAttr.setDefault(.0f, .016f, .376f); aFillAlpha = nAttr.create( "fillAlpha", "fillAlpha", MFnNumericData::kFloat, 0.1f ); aLineAlpha = nAttr.create( "lineAlpha", "lineAlpha", MFnNumericData::kFloat, 1.0f ); aOffsetX = nAttr.create( "offsetX", "offsetX", MFnNumericData::kDouble, 0.0 ); aOffsetY = nAttr.create( "offsetY", "offsetY", MFnNumericData::kDouble, 0.0 ); aOffsetZ = nAttr.create( "offsetZ", "offsetZ", MFnNumericData::kDouble, 0.0 ); aOffset = nAttr.create( "offset", "offset", aOffsetX, aOffsetY, aOffsetZ ); cAttr.addChild( aInheritMatrix ); cAttr.addChild( aAimMatrix ); cAttr.addChild( aInputMesh ); cAttr.addChild( aStartSize ); cAttr.addChild( aSize ); cAttr.addChild( aActiveColor ); cAttr.addChild( aLeadColor ); cAttr.addChild( aDefaultColor ); cAttr.addChild( aFillAlpha ); cAttr.addChild( aLineAlpha ); cAttr.addChild( aOffset ); cAttr.setArray( true ); cAttr.setStorable( true ); CHECK_MSTATUS( addAttribute( aArrow ) ); CHECK_MSTATUS( attributeAffects( aArrow, aOutput ) ); return MS::kSuccess; }
MStatus MG_softIk::initialize() { //This is the nurbs input attribute MFnTypedAttribute typedFn; MFnCompoundAttribute compund; MFnNumericAttribute numFn; MFnMatrixAttribute matrixFn; startMatrix =matrixFn.create("startMatrix","stm"); addAttribute(startMatrix); endMatrix =matrixFn.create("endMatrix","enm"); addAttribute(endMatrix); upInitLength = numFn.create("upInitLength","uil",MFnNumericData::kDouble,0); numFn.setStorable(true); numFn.setKeyable(true); addAttribute(upInitLength); downInitLength = numFn.create("downInitLength","dil",MFnNumericData::kDouble,0); numFn.setStorable(true); numFn.setKeyable(true); addAttribute(downInitLength); globalScale = numFn.create("globalScale","gb",MFnNumericData::kDouble,0); numFn.setStorable(true); numFn.setKeyable(true); numFn.setMin(0.001); addAttribute(globalScale); softDistance = numFn.create("softDistance","sd",MFnNumericData::kDouble,0); numFn.setMin(0.001); numFn.setStorable(true); numFn.setKeyable(true); addAttribute(softDistance); stretch = numFn.create("stretch","str",MFnNumericData::kDouble,0); numFn.setMin(0.0); numFn.setMax(1.0); numFn.setStorable(true); numFn.setKeyable(true); addAttribute(stretch); slide = numFn.create("slide","sld",MFnNumericData::kDouble,0.5); numFn.setMin(0.0); numFn.setMax(1.0); numFn.setStorable(true); numFn.setKeyable(true); addAttribute(slide); upScale = numFn.create("upScale","ups",MFnNumericData::kDouble,1); numFn.setStorable(false); numFn.setKeyable(false); numFn.setWritable(false); addAttribute(upScale); downScale = numFn.create("downScale","dws",MFnNumericData::kDouble,1); numFn.setStorable(false); numFn.setKeyable(false); numFn.setWritable(false); addAttribute(downScale); outputTranslateX = numFn.create("outputTranslateX","otx",MFnNumericData::kDouble,0); numFn.setStorable(false); numFn.setKeyable(false); numFn.setWritable(false); addAttribute(outputTranslateX); outputTranslateY = numFn.create("outputTranslateY","oty",MFnNumericData::kDouble,0); numFn.setStorable(false); numFn.setWritable(false); numFn.setKeyable(false); addAttribute(outputTranslateY); outputTranslateZ = numFn.create("outputTranslateZ","otz",MFnNumericData::kDouble,0); numFn.setStorable(false); numFn.setKeyable(false); numFn.setWritable(false); addAttribute(outputTranslateZ); outputTranslate= compund.create("outputTranslate","ot"); compund.addChild(outputTranslateX); compund.addChild(outputTranslateY); compund.addChild(outputTranslateZ); compund.setStorable(false); compund.setKeyable(false); compund.setWritable(false); addAttribute(outputTranslate); attributeAffects( startMatrix ,outputTranslate) ; attributeAffects( endMatrix ,outputTranslate) ; attributeAffects( softDistance ,outputTranslate) ; attributeAffects( stretch ,outputTranslate) ; attributeAffects( slide ,outputTranslate) ; attributeAffects( globalScale ,outputTranslate) ; attributeAffects( startMatrix ,upScale) ; attributeAffects( endMatrix ,upScale) ; attributeAffects( stretch ,upScale) ; attributeAffects( softDistance ,upScale) ; attributeAffects( slide ,upScale) ; attributeAffects( globalScale ,upScale) ; attributeAffects( startMatrix ,downScale) ; attributeAffects( endMatrix ,downScale) ; attributeAffects( softDistance ,downScale) ; attributeAffects( stretch ,downScale) ; attributeAffects( slide ,downScale) ; attributeAffects( globalScale ,downScale) ; return MS::kSuccess; }
// // Initialize the node // MStatus jhMeshBlur::initialize() { // attribute types MFnUnitAttribute unitAttr; MFnNumericAttribute nAttr; MFnTypedAttribute tAttr; aOldMeshData = tAttr.create("oldMesh","om",MFnData::kPointArray); tAttr.setArray(true); tAttr.setHidden(true); tAttr.setIndexMatters(true); // create the attributes aStrength = nAttr.create( "Strength", "str", MFnNumericData::kFloat,1.0); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setMax(1.0); nAttr.setMin(0.0); aTreshhold = nAttr.create( "Treshold", "tres", MFnNumericData::kFloat,0.0); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setMin(0.0); aShapeFactor = nAttr.create( "ShapeFactor", "shapef", MFnNumericData::kFloat,0.5); nAttr.setStorable(true); nAttr.setKeyable(true); nAttr.setMax(1.0); nAttr.setMin(0.0); aTweakBlur = nAttr.create( "TweakBlur", "tweak", MFnNumericData::kBoolean,false); nAttr.setKeyable(false); nAttr.setChannelBox(true); aQuadInterp = nAttr.create( "QuadInterpolation", "qi", MFnNumericData::kBoolean,true); nAttr.setKeyable(false); nAttr.setChannelBox(true); aInterpPower = nAttr.create( "InterpolationPower", "interp", MFnNumericData::kDouble, 0.75); nAttr.setKeyable(true); nAttr.setMax(1.0); nAttr.setMin(0.0); aTime = unitAttr.create( "time", "tm", MFnUnitAttribute::kTime, 1.0 ); unitAttr.setStorable(true); unitAttr.setCached(true); unitAttr.setReadable(true); unitAttr.setWritable(true); unitAttr.setAffectsAppearance(true); unitAttr.setAffectsWorldSpace(true); // Make the attributes visible to the user addAttribute( aStrength); addAttribute( aTreshhold); addAttribute( aTime); addAttribute( aTweakBlur); addAttribute( aQuadInterp); addAttribute( aInterpPower); addAttribute( aOldMeshData); // Make sure when an attribute changes, the node updates attributeAffects( aTime, outputGeom ); attributeAffects( aStrength, outputGeom ); attributeAffects( aTreshhold, outputGeom ); attributeAffects( aQuadInterp, outputGeom ); attributeAffects( aInterpPower, outputGeom ); // Not implented yet, but make the weights paintable :) MGlobal::executeCommand("makePaintable -attrType multiFloat -sm deformer jhMeshBlur weights;"); return MStatus::kSuccess; }
MStatus OpenSubdivPtexShader::initialize() { MFnTypedAttribute typedAttr; MFnNumericAttribute numAttr; MFnEnumAttribute enumAttr; // level aLevel = numAttr.create("level", "lv", MFnNumericData::kLong, 3); numAttr.setInternal(true); numAttr.setMin(1); numAttr.setSoftMax(5); numAttr.setMax(10); // tessFactor aTessFactor = numAttr.create("tessFactor", "tessf", MFnNumericData::kLong, 2); numAttr.setInternal(true); numAttr.setMin(1); numAttr.setMax(10); // scheme aScheme = enumAttr.create("scheme", "sc", OsdPtexMeshData::kCatmark); enumAttr.addField("Catmull-Clark", OsdPtexMeshData::kCatmark); enumAttr.addField("Loop", OsdPtexMeshData::kLoop); enumAttr.addField("Bilinear", OsdPtexMeshData::kBilinear); enumAttr.setInternal(true); // kernel aKernel = enumAttr.create("kernel", "kn", OsdPtexMeshData::kCPU); enumAttr.addField("CPU", OsdPtexMeshData::kCPU); #ifdef OPENSUBDIV_HAS_OPENMP enumAttr.addField("OpenMP", OsdPtexMeshData::kOPENMP); #endif #ifdef OPENSUBDIV_HAS_OPENCL enumAttr.addField("CL", OsdPtexMeshData::kCL); #endif #ifdef OPENSUBDIV_HAS_CUDA enumAttr.addField("CUDA", OsdPtexMeshData::kCUDA); #endif enumAttr.setInternal(true); // interpolateBoundary aInterpolateBoundary = enumAttr.create("interpolateBoundary", "ib", OsdPtexMeshData::kInterpolateBoundaryNone); enumAttr.addField("None", OsdPtexMeshData::kInterpolateBoundaryNone); enumAttr.addField("Edge Only", OsdPtexMeshData::kInterpolateBoundaryEdgeOnly); enumAttr.addField("Edge and Corner", OsdPtexMeshData::kInterpolateBoundaryEdgeAndCorner); enumAttr.addField("Always Sharp", OsdPtexMeshData::kInterpolateBoundaryAlwaysSharp); enumAttr.setInternal(true); // adaptive aAdaptive = numAttr.create("adaptive", "adp", MFnNumericData::kBoolean, true); numAttr.setInternal(true); // wireframe aWireframe = numAttr.create("wireframe", "wf", MFnNumericData::kBoolean, false); // material attributes aDiffuse = numAttr.createColor("diffuse", "d"); numAttr.setDefault(0.6f, 0.6f, 0.7f); aAmbient = numAttr.createColor("ambient", "a"); numAttr.setDefault(0.1f, 0.1f, 0.1f); aSpecular = numAttr.createColor("specular", "s"); numAttr.setDefault(0.3f, 0.3f, 0.3f); // Ptex Texture Attributes // // diffuseEnvironmentMapFile; aDiffuseEnvironmentMapFile = typedAttr.create("diffuseEnvironmentMap", "difenv", MFnData::kString); typedAttr.setInternal(true); // don't let maya hold on to string when fileNode is disconnected typedAttr.setDisconnectBehavior(MFnAttribute::kReset); // specularEnvironmentMapFile; aSpecularEnvironmentMapFile = typedAttr.create("specularEnvironmentMap", "specenv", MFnData::kString); typedAttr.setInternal(true); // don't let maya hold on to string when fileNode is disconnected typedAttr.setDisconnectBehavior(MFnAttribute::kReset); // colorFile; aColorFile = typedAttr.create("colorFile", "cf", MFnData::kString); typedAttr.setInternal(true); // displacementFile; aDisplacementFile = typedAttr.create("displacementFile", "df", MFnData::kString); typedAttr.setInternal(true); // occlusionFile; aOcclusionFile = typedAttr.create("occlusionFile", "of", MFnData::kString); typedAttr.setInternal(true); // enableDisplacement; aEnableDisplacement = numAttr.create("enableDisplacement", "end", MFnNumericData::kBoolean, 1); numAttr.setInternal(true); // enableColor; aEnableColor = numAttr.create("enableColor", "enc", MFnNumericData::kBoolean, 1); numAttr.setInternal(true); // enableOcclusion; aEnableOcclusion = numAttr.create("enableOcclusion", "eno", MFnNumericData::kBoolean, 1); numAttr.setInternal(true); // enableNormal; aEnableNormal = numAttr.create("enableNormal", "enn", MFnNumericData::kBoolean, 1); numAttr.setInternal(true); // fresnelBias; aFresnelBias = numAttr.create("fresnelBias", "fb", MFnNumericData::kFloat, 0.2f); numAttr.setMin(0); numAttr.setMax(1); // fresnelScale; aFresnelScale = numAttr.create("fresnelScale", "fs", MFnNumericData::kFloat, 1.0f); numAttr.setMin(0); numAttr.setSoftMax(1); // fresnelPower; aFresnelPower = numAttr.create("fresnelPower", "fp", MFnNumericData::kFloat, 5.0f); numAttr.setMin(0); numAttr.setSoftMax(10); // shaderSource; aShaderSource = typedAttr.create("shaderSource", "ssrc", MFnData::kString); typedAttr.setInternal(true); // add attributes addAttribute(aLevel); addAttribute(aTessFactor); addAttribute(aScheme); addAttribute(aKernel); addAttribute(aInterpolateBoundary); addAttribute(aAdaptive); addAttribute(aWireframe); addAttribute(aDiffuse); addAttribute(aAmbient); addAttribute(aSpecular); addAttribute(aShaderSource); addAttribute(aDiffuseEnvironmentMapFile); addAttribute(aSpecularEnvironmentMapFile); addAttribute(aColorFile); addAttribute(aDisplacementFile); addAttribute(aOcclusionFile); addAttribute(aEnableDisplacement); addAttribute(aEnableColor); addAttribute(aEnableOcclusion); addAttribute(aEnableNormal); addAttribute(aFresnelBias); addAttribute(aFresnelScale); addAttribute(aFresnelPower); return MS::kSuccess; }
MStatus blendTwoMatrixDecompose::initialize() { MStatus stat; MFnMatrixAttribute mAttr; MFnNumericAttribute nAttr; MFnUnitAttribute uAttr; aMatrix1 = mAttr.create( "inMatrix1", "i1" ); mAttr.setStorable( true ); aMatrix2 = mAttr.create( "inMatrix2", "i2" ); mAttr.setStorable( true ); aBlender = nAttr.create( "attributeBlender", "ab", MFnNumericData::kFloat, 0.5 ); nAttr.setMin(0); nAttr.setMax(1); nAttr.setStorable( true ); aOutputTranslateX = nAttr.create( "outputTranslateX", "otx", MFnNumericData::kDouble, 0.0 ); aOutputTranslateY = nAttr.create( "outputTranslateY", "oty", MFnNumericData::kDouble, 0.0 ); aOutputTranslateZ = nAttr.create( "outputTranslateZ", "otz", MFnNumericData::kDouble, 0.0 ); aOutputTranslate = nAttr.create( "outputTranslate", "ot", aOutputTranslateX, aOutputTranslateY, aOutputTranslateZ ); nAttr.setStorable( false ); nAttr.setWritable( false ); aOutputRotateX = uAttr.create( "outputRotateX", "orx", MFnUnitAttribute::kAngle, 0.0 ); aOutputRotateY = uAttr.create( "outputRotateY", "ory", MFnUnitAttribute::kAngle, 0.0 ); aOutputRotateZ = uAttr.create( "outputRotateZ", "orz", MFnUnitAttribute::kAngle, 0.0 ); aOutputRotate = nAttr.create( "outputRotate", "or", aOutputRotateX, aOutputRotateY, aOutputRotateZ ); nAttr.setStorable( false ); nAttr.setWritable( false ); aOutputScaleX = nAttr.create( "outputScaleX", "osx", MFnNumericData::kDouble, 0.0 ); aOutputScaleY = nAttr.create( "outputScaleY", "osy", MFnNumericData::kDouble, 0.0 ); aOutputScaleZ = nAttr.create( "outputScaleZ", "osz", MFnNumericData::kDouble, 0.0 ); aOutputScale = nAttr.create( "outputScale", "os", aOutputScaleX, aOutputScaleY, aOutputScaleZ ); nAttr.setStorable( false ); nAttr.setWritable( false ); aOutputShearX = nAttr.create( "outputShearX", "oshx", MFnNumericData::kDouble, 0.0 ); aOutputShearY = nAttr.create( "outputShearY", "oshy", MFnNumericData::kDouble, 0.0 ); aOutputShearZ = nAttr.create( "outputShearZ", "oshz", MFnNumericData::kDouble, 0.0 ); aOutputShear = nAttr.create( "outputShear", "osh", aOutputShearX, aOutputShearY, aOutputShearZ ); nAttr.setStorable( false ); nAttr.setWritable( false ); stat = addAttribute( aMatrix1 ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aMatrix2 ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aBlender ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aOutputTranslate ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aOutputRotate ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aOutputScale ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( aOutputShear ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = attributeAffects( aMatrix1, aOutputTranslate ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix1, aOutputRotate ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix1, aOutputScale ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix1, aOutputShear ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix2, aOutputTranslate ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix2, aOutputRotate ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix2, aOutputScale ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aMatrix2, aOutputShear ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aBlender, aOutputTranslate ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aBlender, aOutputRotate ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aBlender, aOutputScale ); if (!stat) { stat.perror("attributeAffects"); return stat;} stat = attributeAffects( aBlender, aOutputShear ); if (!stat) { stat.perror("attributeAffects"); return stat;} return MS::kSuccess; }
MStatus wingVizNode::initialize() { MStatus stat; MFnNumericAttribute numAttr; MFnTypedAttribute meshAttr; awidth0 = numAttr.create( "width0", "w0", MFnNumericData::kFloat, 0.5 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( awidth0 ); awidth1 = numAttr.create( "width1", "w1", MFnNumericData::kFloat, 0.2 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( awidth1 ); aedge0 = numAttr.create( "edge0", "e0", MFnNumericData::kFloat, 0.9 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aedge0 ); aedge1 = numAttr.create( "edge1", "e1", MFnNumericData::kFloat, 0.2 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aedge1 ); atwist0 = numAttr.create( "twist0", "tw0", MFnNumericData::kFloat, 0.0 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( atwist0 ); atwist1 = numAttr.create( "twist1", "tw1", MFnNumericData::kFloat, 60.0 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( atwist1 ); areverse = numAttr.create( "reverse", "re", MFnNumericData::kInt, 0 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( areverse ); astep = numAttr.create( "step", "st", MFnNumericData::kInt, 4 ); numAttr.setStorable(true); numAttr.setKeyable(true); numAttr.setMin(1); addAttribute( astep ); ashaft0 = numAttr.create( "shaftWidth0", "shw0", MFnNumericData::kFloat, 0.25 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( ashaft0 ); ashaft1 = numAttr.create( "shaftWidth1", "shw1", MFnNumericData::kFloat, 0.20 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( ashaft1 ); aminframe = numAttr.create( "startFrame", "sf", MFnNumericData::kInt, 1 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( aminframe ); amaxframe = numAttr.create( "saveCache", "saveCache", MFnNumericData::kInt, 0 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( amaxframe ); aratio = numAttr.create( "scale", "sc", MFnNumericData::kFloat, 1.0 ); numAttr.setStorable(true); numAttr.setKeyable(true); numAttr.setMin(0.01f); numAttr.setInternal(true); addAttribute( aratio ); awind = numAttr.create( "wind", "wnd", MFnNumericData::kFloat, 1.0 ); numAttr.setStorable(true); numAttr.setKeyable(true); numAttr.setMin(0.01f); numAttr.setInternal(true); addAttribute( awind ); aoutval = numAttr.create( "outval", "ov", MFnNumericData::kInt, 1 ); numAttr.setStorable(false); numAttr.setWritable(false); numAttr.setKeyable(false); addAttribute( aoutval ); MFnTypedAttribute stringAttr; acachename = stringAttr.create( "cachePath", "cp", MFnData::kString ); stringAttr.setStorable(true); stringAttr.setInternal(true); addAttribute( acachename ); zCheckStatus(zWorks::createTypedAttr(agrowth, MString("growMesh"), MString("gm"), MFnData::kNurbsSurface ), "ERROR creating grow mesh"); zCheckStatus(addAttribute(agrowth), "ERROR adding ing base"); zCheckStatus(zWorks::createTypedAttr(acollision, MString("collideMesh"), MString("cm"), MFnData::kMesh), "ERROR creating collide mesh"); zCheckStatus(addAttribute(acollision), "ERROR adding collide mesh"); zCheckStatus(zWorks::createTimeAttr(atime, MString("currentTime"), MString("ct"), 1.0), "ERROR creating time"); zCheckStatus(addAttribute(atime), "ERROR adding time"); zCheckStatus(zWorks::createTypedAttr(outMesh, MString("outMesh"), MString("om"), MFnData::kMesh), "ERROR creating out mesh"); zCheckStatus(addAttribute(outMesh), "ERROR adding out mesh"); aouttexcoordoffsetpp = meshAttr.create( "outTexcoordOffset", "oto", MFnData::kDoubleArray ); meshAttr.setStorable(false); meshAttr.setWritable(false); addAttribute( aouttexcoordoffsetpp ); anoisize = numAttr.create( "noiseSize", "nsz", MFnNumericData::kFloat, 1.0 ); numAttr.setStorable(true); numAttr.setKeyable(true); addAttribute( anoisize ); anoifreq = numAttr.create( "noiseFrequency", "nfq", MFnNumericData::kFloat, 8.0 ); numAttr.setStorable(true); numAttr.setMin(0.01); numAttr.setKeyable(true); addAttribute( anoifreq ); anoiseed = numAttr.create( "noiseSeed", "nsd", MFnNumericData::kInt, 19 ); numAttr.setStorable(true); numAttr.setKeyable(true); numAttr.setMin(10); addAttribute( anoiseed ); attributeAffects( areverse, aoutval ); attributeAffects( awidth0, aoutval ); attributeAffects( awidth1, aoutval ); attributeAffects( aedge0, aoutval ); attributeAffects( aedge1, aoutval ); attributeAffects( atwist0, aoutval ); attributeAffects( atwist1, aoutval ); attributeAffects( ashaft0, aoutval ); attributeAffects( ashaft1, aoutval ); attributeAffects( atime, aoutval ); attributeAffects( aratio, aoutval ); attributeAffects( agrowth, aoutval ); attributeAffects( acollision, aoutval ); attributeAffects( astep, aoutval ); attributeAffects( areverse, outMesh ); attributeAffects( awidth0, outMesh ); attributeAffects( awidth1, outMesh ); attributeAffects( aedge0, outMesh ); attributeAffects( aedge1, outMesh ); attributeAffects( atwist0, outMesh ); attributeAffects( atwist1, outMesh ); attributeAffects( ashaft0, outMesh ); attributeAffects( ashaft1, outMesh ); attributeAffects( atime, outMesh ); attributeAffects( aratio, outMesh ); attributeAffects( agrowth, outMesh ); attributeAffects( acollision, outMesh ); attributeAffects( astep, outMesh ); attributeAffects( anoisize, outMesh ); attributeAffects( anoifreq, outMesh ); attributeAffects( anoiseed, outMesh ); attributeAffects( areverse, aouttexcoordoffsetpp ); attributeAffects( agrowth, aouttexcoordoffsetpp ); attributeAffects( astep, aouttexcoordoffsetpp ); return MS::kSuccess; }
//---------------------------------------------------------------------------------------------------------------------- // this method creates the attributes for our node and sets some default values etc //---------------------------------------------------------------------------------------------------------------------- MStatus OceanNode::initialize(){ // Attributes to check whether the amplitude or wind vector have changed m_wdx = 0.0; m_wdz = 1.0; m_ws = 100.0; m_amp = 100.0; m_res = 0; MStatus status; // an emum attribute for use with the resolution MFnEnumAttribute enumAttr; // resolution m_resolution = enumAttr.create("resolution", "res", 0, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to create \"resolution\" attribute"); enumAttr.addField("128x128", RES128); enumAttr.addField("256x256", RES256); enumAttr.addField("512x512", RES512); enumAttr.addField("1024x1024", RES1024); enumAttr.setKeyable(true); status = addAttribute(m_resolution); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"resolution\" attribute to OceanNode"); // now we are going to add several number attributes MFnNumericAttribute numAttr; // amplitde m_amplitude = numAttr.create( "amplitude", "amp", MFnNumericData::kDouble, 100.0, &status ); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL( status , "Unable to create \"amplitude\" attribute" ); numAttr.setChannelBox( true ); // add attribute status = addAttribute( m_amplitude ); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL( status , "Unable to add \"amplitude\" attribute to OceanNode" ); // frequency m_frequency = numAttr.create("frequency", "frq", MFnNumericData::kDouble, 0.5, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to create \"frequency\" attribute"); numAttr.setChannelBox(true); status = addAttribute(m_frequency); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"frequency\" attribute to OceanNodee"); // the wind speed inputs MFnNumericAttribute windDirectionAttr; m_windDirectionX = windDirectionAttr.create( "windDirectionX", "wdx", MFnNumericData::kDouble, 0.0, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL( status, "Unable to create \"wdx\" attribute"); windDirectionAttr.setChannelBox(true); windDirectionAttr.setMin(0.0); windDirectionAttr.setMax(1.0); // add attribute status = addAttribute( m_windDirectionX ); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"wdx\" attribute to OceanNode") m_windDirectionZ = windDirectionAttr.create( "windDirectionZ", "wdz", MFnNumericData::kDouble, 0.5, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL( status, "Unable to create \"wdy\" attribute"); windDirectionAttr.setChannelBox(true); windDirectionAttr.setMin(0.0); windDirectionAttr.setMax(1.0); // add attribute status = addAttribute( m_windDirectionZ ); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"wdz\" attribute to OceanNode"); m_windSpeed = numAttr.create( "windSpeed", "ws", MFnNumericData::kDouble, 100.0, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL( status, "Unable to create \"ws\" attribute"); numAttr.setChannelBox(true); // add attribute status = addAttribute( m_windSpeed ); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"ws\" attribute to OceanNode"); MFnNumericAttribute chopAttr; m_choppiness = chopAttr.create("chopiness", "chp", MFnNumericData::kDouble, 0.0, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to create \"chopiness\" attribute"); chopAttr.setChannelBox(true); chopAttr.setMax(2.0); chopAttr.setMin(0.0); // add attribute status = addAttribute(m_choppiness); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"choppiness\" attribute to OceanNode"); // now the time inputs MFnNumericAttribute timeAttr; m_time = timeAttr.create("time", "t", MFnNumericData::kDouble, 0.0, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to create \"t\" attribute"); // Add the attribute status = addAttribute(m_time); timeAttr.setHidden(true); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"t\" attribute to OceanNode"); // create the output attribute MFnTypedAttribute typeAttr; m_output = typeAttr.create("output", "out", MFnData::kMesh, &status); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to create \"output\" attribute"); typeAttr.setStorable(false); typeAttr.setHidden(true); status = addAttribute(m_output); CHECK_STATUS_AND_RETURN_MSTATUS_IF_FAIL(status, "Unable to add \"output\" attribute to OceanNode"); // this links the different elements together forcing a re-compute each time the values are changed attributeAffects(m_resolution, m_output); attributeAffects(m_amplitude,m_output); attributeAffects(m_windDirectionX, m_output); attributeAffects(m_windDirectionZ, m_output); attributeAffects(m_windSpeed, m_output); attributeAffects(m_choppiness, m_output); attributeAffects(m_time, m_output); // report all was good return MStatus::kSuccess; }
MStatus woodTexNode::initialize() { MStatus stat; MFnNumericAttribute numAttr; MFnEnumAttribute enumAttr; woodTurbulence=numAttr.create("Turbulence","tl",MFnNumericData::kFloat,5.0); MAKE_INPUT(numAttr); numAttr.setMin(0.0); numAttr.setMax(200.0); woodSize=numAttr.create("WoodSize","ws",MFnNumericData::kFloat,4.0); MAKE_INPUT(numAttr); numAttr.setMin(0.0); numAttr.setMax(32.0); woodHard=numAttr.create("Hard","hr",MFnNumericData::kBoolean,false); MAKE_INPUT(numAttr); woodType=enumAttr.create("WoodType","wt",0); enumAttr.addField("bands",0); enumAttr.addField("rings",1); MAKE_INPUT(enumAttr); woodShape=enumAttr.create("WoodShape","wosh",0); enumAttr.addField("sin",0); enumAttr.addField("saw",1); enumAttr.addField("tri",2); NoiseType=enumAttr.create("NoiseType","noty",0); enumAttr.addField("newperlin",0); enumAttr.addField("stdperlin",1); enumAttr.addField("voronoi_f1",2); enumAttr.addField("voronoi_f2",3); enumAttr.addField("voronoi_f3",4); enumAttr.addField("voronoi_f4",5); enumAttr.addField("voronoi_f2fl",6); enumAttr.addField("voronoi_crackle",7); enumAttr.addField("cellnoise",8); MAKE_INPUT(enumAttr); mappingMethod=enumAttr.create("MappingMethod","mame",0); enumAttr.addField("uv",0); enumAttr.addField("orco",1); enumAttr.addField("global",2); enumAttr.addField("window",3); MAKE_INPUT(enumAttr); texCo=enumAttr.create("TextureCoordinate","texco",0); enumAttr.addField("plain",0); enumAttr.addField("cube",1); enumAttr.addField("tube",2); enumAttr.addField("sphere",3); MAKE_INPUT(enumAttr); //*******************************layer texture attribute*********************************// layerMix=enumAttr.create("MixMethod","mm1",0); enumAttr.addField("mix",0); enumAttr.addField("add",1); enumAttr.addField("multiply",2); enumAttr.addField("subtract",3); enumAttr.addField("screen",4); enumAttr.addField("divide",5); enumAttr.addField("difference",6); enumAttr.addField("darken",7); enumAttr.addField("lighten",8); MAKE_INPUT(enumAttr); textureColor=numAttr.createColor("TextureColor","teco"); numAttr.setDefault(1.0,0.0,1.0); MAKE_INPUT(numAttr); texColorFact=numAttr.create("TextureColorWeight","tcw",MFnNumericData::kFloat,1.0); numAttr.setMin(0.0); numAttr.setMax(1.0); MAKE_INPUT(numAttr); defVal=numAttr.create("DefValue","dev",MFnNumericData::kFloat,1.0); numAttr.setMin(0.0); numAttr.setMax(1.0); MAKE_INPUT(numAttr); valFact=numAttr.create("ValueWeight","vaw",MFnNumericData::kFloat,1.0); numAttr.setMin(0.0); numAttr.setMax(1.0); MAKE_INPUT(numAttr); doColor=numAttr.create("DoColor","doco",MFnNumericData::kBoolean,true); MAKE_INPUT(numAttr); negative=numAttr.create("Negative","nega",MFnNumericData::kBoolean,false); MAKE_INPUT(numAttr); noRGB=numAttr.create("NoRGB","nr",MFnNumericData::kBoolean,false); MAKE_INPUT(numAttr); stencil=numAttr.create("Stencil","sten",MFnNumericData::kBoolean,false); MAKE_INPUT(numAttr); //*******************************layer texture attribute end*********************************// MObject u=numAttr.create("uCoord","u",MFnNumericData::kFloat); MObject v=numAttr.create("vCoord","v",MFnNumericData::kFloat); UV=numAttr.create("uvCoord","uv",u,v); MAKE_INPUT(numAttr); MObject filterX=numAttr.create("uvFilterSizeX", "fsx", MFnNumericData::kFloat); MObject filterY=numAttr.create( "uvFilterSizeY", "fsy", MFnNumericData::kFloat); UVFilterSize=numAttr.create("uvFilterSize", "fs", filterX, filterY); MAKE_INPUT(numAttr); Output=numAttr.createColor("outColor","oc"); numAttr.setHidden(true); MAKE_OUTPUT(numAttr); addAttribute(woodTurbulence); addAttribute(woodSize); addAttribute(woodHard); addAttribute(woodType); addAttribute(woodShape); addAttribute(NoiseType); addAttribute(mappingMethod); addAttribute(texCo); addAttribute(layerMix); addAttribute(textureColor); addAttribute(texColorFact); addAttribute(defVal); addAttribute(valFact); addAttribute(doColor); addAttribute(negative); addAttribute(noRGB); addAttribute(stencil); addAttribute(UV); addAttribute(UVFilterSize); addAttribute(Output); attributeAffects(woodTurbulence,Output); attributeAffects(woodSize,Output); attributeAffects(woodHard,Output); attributeAffects(woodType,Output); attributeAffects(woodShape,Output); attributeAffects(NoiseType,Output); attributeAffects(mappingMethod,Output); attributeAffects(texCo,Output); attributeAffects(layerMix,Output); attributeAffects(textureColor,Output); attributeAffects(texColorFact,Output); attributeAffects(defVal,Output); attributeAffects(valFact,Output); attributeAffects(doColor,Output); attributeAffects(negative,Output); attributeAffects(noRGB,Output); attributeAffects(stencil,Output); attributeAffects(UV,Output); attributeAffects(UVFilterSize,Output); return stat; }
MStatus n_tentacle::initialize() { MFnNumericAttribute numericAttr; MFnMatrixAttribute matrixAttr; MFnTypedAttribute typedAttr; MFnUnitAttribute unitAttribute; MFnEnumAttribute enumAttr; MStatus stat; stretch = numericAttr.create("stretch", "st", MFnNumericData::kDouble, 0.0); numericAttr.setMin(0.0); numericAttr.setMax(1.0); globalScale = numericAttr.create("globalScale", "gs", MFnNumericData::kDouble, 1.0); numericAttr.setMin(0.00001); numericAttr.setMax(10.0); iniLength = numericAttr.create("iniLength", "iln", MFnNumericData::kDouble, 0.01); parameter = numericAttr.create("parameter", "prm", MFnNumericData::kDouble, 0.0); numericAttr.setArray(true); blendRot = numericAttr.create("blendRot", "blr", MFnNumericData::kDouble, 0.0); numericAttr.setArray(true); interval = numericAttr.create("interval", "itv", MFnNumericData::kInt, 0); numericAttr.setArray(true); matrix = matrixAttr.create("matrix", "mtx"); matrixAttr.setArray(true); matrixAttr.setHidden(true); curve = typedAttr.create("curve", "crv", MFnData::kNurbsCurve); outTranslate = numericAttr.create("outTranslate", "ot", MFnNumericData::k3Double); numericAttr.setArray(true); numericAttr.setHidden(true); numericAttr.setUsesArrayDataBuilder(true); numericAttr.setHidden(true); outRotateX = unitAttribute.create("outRotateX", "orx", MFnUnitAttribute::kAngle); outRotateY = unitAttribute.create("outRotateY", "ory", MFnUnitAttribute::kAngle); outRotateZ = unitAttribute.create("outRotateZ", "orz", MFnUnitAttribute::kAngle); outRotate = numericAttr.create("outRotate", "or",outRotateX, outRotateY, outRotateZ); numericAttr.setArray(true); numericAttr.setHidden(true); numericAttr.setUsesArrayDataBuilder(true); numericAttr.setHidden(true); tangentAxis = enumAttr.create("tangentAxis", "tga", 1); enumAttr.addField("X", 0); enumAttr.addField("Y", 1); enumAttr.addField("Z", 2); enumAttr.addField("negativeX", 3); enumAttr.addField("negativeY", 4); enumAttr.addField("negativeZ", 5); // Add the attributes we have created to the node // stat = addAttribute( parameter ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( blendRot ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( interval ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( stretch ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( globalScale ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( iniLength ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( matrix ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( curve ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( outTranslate ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( outRotate ); if (!stat) { stat.perror("addAttribute"); return stat;} stat = addAttribute( tangentAxis ); if (!stat) { stat.perror("addAttribute"); return stat;} attributeAffects( parameter, outTranslate ); attributeAffects( blendRot, outTranslate ); attributeAffects( interval, outTranslate ); attributeAffects( stretch, outTranslate ); attributeAffects( globalScale, outTranslate ); attributeAffects( iniLength, outTranslate ); attributeAffects( matrix, outTranslate ); attributeAffects( curve, outTranslate ); attributeAffects( tangentAxis, outTranslate ); attributeAffects( parameter, outRotate ); attributeAffects( blendRot, outRotate ); attributeAffects( interval, outRotate ); attributeAffects( stretch, outRotate ); attributeAffects( globalScale, outRotate ); attributeAffects( iniLength, outRotate ); attributeAffects( matrix, outRotate ); attributeAffects( curve, outRotate ); attributeAffects( tangentAxis, outRotate ); attributeAffects( parameter, outRotateX ); attributeAffects( blendRot, outRotateX ); attributeAffects( interval, outRotateX ); attributeAffects( stretch, outRotateX ); attributeAffects( globalScale, outRotateX ); attributeAffects( iniLength, outRotateX ); attributeAffects( matrix, outRotateX ); attributeAffects( curve, outRotateX ); attributeAffects( tangentAxis, outRotateX ); attributeAffects( parameter, outRotateY ); attributeAffects( blendRot, outRotateY ); attributeAffects( interval, outRotateY ); attributeAffects( stretch, outRotateY ); attributeAffects( globalScale, outRotateY ); attributeAffects( iniLength, outRotateY ); attributeAffects( matrix, outRotateY ); attributeAffects( curve, outRotateY ); attributeAffects( tangentAxis, outRotateY ); attributeAffects( parameter, outRotateZ ); attributeAffects( blendRot, outRotateZ ); attributeAffects( interval, outRotateZ ); attributeAffects( stretch, outRotateZ ); attributeAffects( globalScale, outRotateZ ); attributeAffects( iniLength, outRotateZ ); attributeAffects( matrix, outRotateZ ); attributeAffects( curve, outRotateZ ); attributeAffects( tangentAxis, outRotateZ ); return MS::kSuccess; }