当前位置: 首页>>代码示例>>C++>>正文


C++ MFnEnumAttribute::create方法代码示例

本文整理汇总了C++中MFnEnumAttribute::create方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnEnumAttribute::create方法的具体用法?C++ MFnEnumAttribute::create怎么用?C++ MFnEnumAttribute::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MFnEnumAttribute的用法示例。


在下文中一共展示了MFnEnumAttribute::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: doIt

MStatus unCreateParticleSystem::doIt( const MArgList& args )
{
	bool create = true;

	MSelectionList activeList;
	MStatus stat = MGlobal::getActiveSelectionList(activeList);
	if (MS::kSuccess != stat)
	{
		MessageBox(0,"please select one joint first!",0,0);
		return MS::kFailure;
	}

	if(activeList.length() != 1)
	{
		MessageBox(0,"please select ONLY one joint!",0,0);
		return MS::kFailure;
	}
	MItSelectionList iter(activeList);
	MDagPath dagPath;
	for ( ; !iter.isDone(); iter.next())
	{
		stat = iter.getDagPath(dagPath);
		break;
	}
	if(!stat)
	{
		MessageBox(0,"can't getDagPath!",0,0);
		return MS::kFailure;
	}

	if(!dagPath.hasFn(MFn::kJoint))
	{
		MessageBox(0,"muse select joint node!",0,0);
		return MS::kFailure;
	}

	MFnIkJoint joint(dagPath);

	if(args.length())
		create = args.asBool(0);

	if(!create)
	{
		if(!joint.hasAttribute("unParticleEnabled"))
		{
			MessageBox(0,"no particle system exists!",0,0);
			return MS::kFailure;
		}
		removeParticleAttributes(joint);
		return MS::kSuccess;
	}

	if(joint.hasAttribute("unParticleEnabled"))
	{
		MessageBox(0,"particle system already exists!",0,0);
		return MS::kSuccess;
	}

	if(joint.hasAttribute("unRibbonEnabled"))
	{
		if(MessageBox(0,"will delete ribbon system and attach a particle system to the joint,continue?",0,MB_YESNO) == IDNO)return MS::kFailure;
		removeRibbonAttributes(joint);
	}

	MFnNumericAttribute attr;
	unParticleEnabled = attr.create("unParticleEnabled","Enabled",MFnNumericData::kBoolean,true);
	attr.setStorable(true);

	unParticleVisible = attr.create("unParticleVisible","Visible",MFnNumericData::kBoolean,true);
	attr.setStorable(true);
	attr.setKeyable(true);

	unParticleSpeed = attr.create("unParticleSpeed","Speed",MFnNumericData::kFloat,40.0f);
	attr.setStorable(true);
	attr.setMin(-1000.0f);
	attr.setMax(1000.0f);
	attr.setKeyable(true);

	unParticleVariation = attr.create("unParticleVariationPercent","VariationPercent",MFnNumericData::kFloat,2.0f);
	attr.setStorable(true);
	attr.setMin(0.0f);
	attr.setMax(100.0f);
	attr.setKeyable(true);

	unParticleConeAngle = attr.create("unParticleConeAngle","ConeAngle",MFnNumericData::kFloat,0.0f);
	attr.setStorable(true);
	attr.setMin(0.0f);
	attr.setMax(180.0f);
	attr.setKeyable(true);

	unParticleGravity = attr.create("unParticleGravity","Gravity",MFnNumericData::kFloat,0.0f);
	attr.setStorable(true);
	attr.setMin(-1000.0f);
	attr.setMax(1000.0f);
	attr.setKeyable(true);

	unParticleExplosiveForce = attr.create("unParticleExplosiveForce","ExplosiveForce",MFnNumericData::kFloat,0.0f);
	attr.setStorable(true);
	attr.setMin(-100.0f);
	attr.setMax(100.0f);
//.........这里部分代码省略.........
开发者ID:cpzhang,项目名称:zen,代码行数:101,代码来源:mayammexport.cpp

示例2: MCHECKERR

// Create and Add Attributes
//
//  Description:
//      This method is called to create and initialize all of the attributes
//      and attribute dependencies for this node type.  This is only called
//      once when the node type is registered with Maya.
//
//  Return Values:
//      MS::kSuccess
//      MS::kFailure
//
MStatus
MayaPolySmooth::initialize() {

    MStatus stat;

    MFnCompoundAttribute  cAttr;
    MFnEnumAttribute      eAttr;
    MFnGenericAttribute   gAttr;
    MFnLightDataAttribute lAttr;
    MFnMatrixAttribute    mAttr;
    MFnMessageAttribute   msgAttr;
    MFnNumericAttribute   nAttr;
    MFnTypedAttribute     tAttr;
    MFnUnitAttribute      uAttr;

    // MAYA_NODE_BUILDER:BEG [ATTRIBUTE CREATION] ==========
    // a_inputPolymesh : This is a description for this attribute
    a_inputPolymesh = tAttr.create("inputPolymesh", "ip", MFnData::kMesh, MObject::kNullObj, &stat);
    MCHECKERR( stat, "cannot create MayaPolySmooth::inputPolymesh" );
    stat = tAttr.setReadable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::inputPolymesh.setReadable()" );
    stat = tAttr.setWritable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::inputPolymesh.setWritable()" );
    stat = tAttr.setHidden(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::inputPolymesh.setHidden()" );
    stat = addAttribute( a_inputPolymesh );
    MCHECKERR( stat, "cannot MayaPolySmooth::addAttribute(a_inputPolymesh)" );

    // a_output : This is a description for this attribute
    a_output = tAttr.create("output", "out", MFnData::kMesh, MObject::kNullObj, &stat);
    MCHECKERR( stat, "cannot create MayaPolySmooth::output" );
    stat = tAttr.setReadable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::output.setReadable()" );
    stat = tAttr.setWritable(false);
    MCHECKERR( stat, "cannot MayaPolySmooth::output.setWritable()" );
    stat = tAttr.setHidden(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::output.setHidden()" );
    stat = addAttribute( a_output );
    MCHECKERR( stat, "cannot MayaPolySmooth::addAttribute(a_output)" );

    // a_subdivisionLevels : The number of recursive quad subdivisions to perform on each face.
    a_subdivisionLevels = nAttr.create("subdivisionLevels", "sl", MFnNumericData::kInt, 0.0, &stat);
    MCHECKERR( stat, "cannot create MayaPolySmooth::subdivisionLevels" );
    stat = nAttr.setDefault(2);
    MCHECKERR( stat, "cannot MayaPolySmooth::subdivisionLevels.setDefault(2)" );
    stat = nAttr.setMin(0);
    MCHECKERR( stat, "cannot MayaPolySmooth::subdivisionLevels.setMin(0)" );
    stat = nAttr.setMax(10);
    MCHECKERR( stat, "cannot MayaPolySmooth::subdivisionLevels.setMax(10)" );
    stat = nAttr.setSoftMax(4);
    MCHECKERR( stat, "cannot MayaPolySmooth::subdivisionLevels.setSoftMax(4)" );
    stat = nAttr.setReadable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::subdivisionLevels.setReadable()" );
    stat = nAttr.setWritable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::subdivisionLevels.setWritable()" );
    stat = addAttribute( a_subdivisionLevels );
    MCHECKERR( stat, "cannot MayaPolySmooth::addAttribute(a_subdivisionLevels)" );

    // a_recommendedIsolation : The number of recursive quad subdivisions to perform on each face.
    a_recommendedIsolation = nAttr.create("recommendedIsolation", "ri", MFnNumericData::kInt, 0.0, &stat);
    MCHECKERR( stat, "cannot create MayaPolySmooth::recommendedIsolation" );
    stat = nAttr.setDefault(2);
    MCHECKERR( stat, "cannot MayaPolySmooth::recommendedIsolation.setDefault(0)" );
    stat = nAttr.setMin(0);
    MCHECKERR( stat, "cannot MayaPolySmooth::recommendedIsolation.setMin(0)" );
    stat = nAttr.setMax(10);
    MCHECKERR( stat, "cannot MayaPolySmooth::recommendedIsolation.setSoftMax(10)" );
    stat = nAttr.setReadable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::recommendedIsolation.setReadable()" );
    stat = nAttr.setWritable(false);
    MCHECKERR( stat, "cannot MayaPolySmooth::recommendedIsolation.setWritable()" );
    stat = nAttr.setHidden(false);
    MCHECKERR( stat, "cannot MayaPolySmooth::recommendedIsolation.setHidden()" );
    stat = addAttribute( a_recommendedIsolation );
    MCHECKERR( stat, "cannot MayaPolySmooth::addAttribute(a_recommendedIsolation)" );

    // a_vertBoundaryMethod : Controls how boundary edges and vertices are interpolated. <ul> <li>Smooth, Edges: Renderman: InterpolateBoundaryEdgeOnly</li> <li>Smooth, Edges and Corners: Renderman: InterpolateBoundaryEdgeAndCorner</li> </ul>
    a_vertBoundaryMethod = eAttr.create("vertBoundaryMethod", "vbm", 0, &stat);
    MCHECKERR( stat, "cannot create MayaPolySmooth::vertBoundaryMethod" );
    stat = eAttr.addField("Interpolate Edges", k_BoundaryMethod_InterpolateBoundaryEdgeOnly);
    MCHECKERR( stat, "cannot MayaPolySmooth::vertBoundaryMethod.addField(Interpolate Edges, k_BoundaryMethod_InterpolateBoundaryEdgeOnly)" );
    stat = eAttr.addField("Interpolate Edges And Corners", k_BoundaryMethod_InterpolateBoundaryEdgeAndCorner);
    MCHECKERR( stat, "cannot MayaPolySmooth::vertBoundaryMethod.addField(Interpolate Edges And Corners, k_BoundaryMethod_InterpolateBoundaryEdgeAndCorner)" );
    stat = eAttr.setDefault(k_BoundaryMethod_InterpolateBoundaryEdgeOnly);
    MCHECKERR( stat, "cannot MayaPolySmooth::vertBoundaryMethod.setDefault(k_BoundaryMethod_InterpolateBoundaryEdgeOnly)" );
    stat = eAttr.setReadable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::vertBoundaryMethod.setReadable()" );
    stat = eAttr.setWritable(true);
    MCHECKERR( stat, "cannot MayaPolySmooth::vertBoundaryMethod.setWritable()" );
//.........这里部分代码省略.........
开发者ID:AiYong,项目名称:OpenSubdiv,代码行数:101,代码来源:mayaPolySmooth.cpp

示例3: initialize

//
// DESCRIPTION:
MStatus marble::initialize()
{
	MFnNumericAttribute nAttr;
	MFnTypedAttribute tAttr;
	MFnGenericAttribute gAttr;
	MFnEnumAttribute eAttr;
	MFnMessageAttribute mAttr;

	MStatus status;

	outColor = nAttr.createColor("outColor", "outColor");
	MAKE_OUTPUT(nAttr);
	CHECK_MSTATUS(addAttribute( outColor ));

//---------------------------- automatically created attributes start ------------------------------------
	scale = nAttr.create("scale", "scale",  MFnNumericData::kFloat, 1);
	MAKE_INPUT(nAttr);
	CHECK_MSTATUS(addAttribute( scale ));

	octaves = nAttr.create("octaves", "octaves",  MFnNumericData::kInt, 8);
	MAKE_INPUT(nAttr);
	CHECK_MSTATUS(addAttribute( octaves ));

	coordinates = eAttr.create("coordinates", "coordinates", 0, &status);
	status = eAttr.addField( "global", 0 );
	status = eAttr.addField( "local", 1 );
	status = eAttr.addField( "global normal", 2 );
	status = eAttr.addField( "localnormal", 3 );
	status = eAttr.addField( "uv", 4 );
	MAKE_INPUT(eAttr);
	CHECK_MSTATUS(addAttribute( coordinates ));

	roughness = nAttr.create("roughness", "roughness",  MFnNumericData::kFloat, 0.5);
	MAKE_INPUT(nAttr);
	CHECK_MSTATUS(addAttribute( roughness ));

	MObject rotateX = nAttr.create("rotateX", "rotatex", MFnNumericData::kDouble, 0.0);
	MObject rotateY = nAttr.create("rotateY", "rotatey", MFnNumericData::kDouble, 0.0);
	MObject rotateZ = nAttr.create("rotateZ", "rotatez", MFnNumericData::kDouble, 0.0);
	rotate = nAttr.create("rotate", "rotate", rotateX, rotateY, rotateZ);
	MAKE_INPUT(nAttr);
	nAttr.setDefault(0,0,0);
	CHECK_MSTATUS(addAttribute( rotate ));

	variation = nAttr.create("variation", "variation",  MFnNumericData::kFloat, 0.2);
	MAKE_INPUT(nAttr);
	CHECK_MSTATUS(addAttribute( variation ));

	MObject translateX = nAttr.create("translateX", "translatex", MFnNumericData::kDouble, 0.0);
	MObject translateY = nAttr.create("translateY", "translatey", MFnNumericData::kDouble, 0.0);
	MObject translateZ = nAttr.create("translateZ", "translatez", MFnNumericData::kDouble, 0.0);
	translate = nAttr.create("translate", "translate", translateX, translateY, translateZ);
	MAKE_INPUT(nAttr);
	nAttr.setDefault(0,0,0);
	CHECK_MSTATUS(addAttribute( translate ));

	luxOutColor = nAttr.createColor("luxOutColor", "luxOutColor");
	MAKE_OUTPUT(nAttr);
	CHECK_MSTATUS(addAttribute( luxOutColor ));

	CHECK_MSTATUS ( attributeAffects( scale, luxOutColor));
	CHECK_MSTATUS ( attributeAffects( scale, outColor));
//---------------------------- automatically created attributes end ------------------------------------

    return MS::kSuccess;
}
开发者ID:UIKit0,项目名称:OpenMaya,代码行数:68,代码来源:marbleTexture.cpp

示例4: addAttribute

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;
//.........这里部分代码省略.........
开发者ID:Len3d,项目名称:OpenSubdiv,代码行数:101,代码来源:OpenSubdivPtexShader.cpp

示例5: initialize

MStatus uiDrawManager::initialize()
{
    MStatus status;

    MFnNumericAttribute nAttr;
    MFnEnumAttribute eAttr;
    MFnTypedAttribute typedAttr;

    // Add ui type attribute
    aUIType = eAttr.create("uiType", "ut", uiDrawManager::kText);
    eAttr.addField("text", uiDrawManager::kText);
    eAttr.addField("line", uiDrawManager::kLine);
    eAttr.addField("point", uiDrawManager::kPoint);
    eAttr.addField("rect", uiDrawManager::kRect);    
    eAttr.addField("quad", uiDrawManager::kQuad);
    eAttr.addField("sphere", uiDrawManager::kSphere);
    eAttr.addField("circle", uiDrawManager::kCircle);    
    eAttr.addField("arc", uiDrawManager::kArc);    
    eAttr.addField("line list", uiDrawManager::kLineList);
    eAttr.addField("line strip", uiDrawManager::kLineStrip);
    eAttr.addField("point list", uiDrawManager::kPointList);
    eAttr.addField("icon", uiDrawManager::kIcon);
    eAttr.addField("cone", uiDrawManager::kCone);
    eAttr.addField("box", uiDrawManager::kBox);
    MPxNode::addAttribute(aUIType);

    // Add color attribute
    aPrimitiveColor = nAttr.create("primitiveColor", "pc", MFnNumericData::k3Float);
    nAttr.setDefault(1.0f, 0.0f, 0.0f);
    nAttr.setUsedAsColor(true);
    MPxNode::addAttribute(aPrimitiveColor);

    // Add transparency attribute
    aPrimitiveTransparency = nAttr.create("primitiveTransparency", "pt", MFnNumericData::kFloat, 0.0);
    nAttr.setSoftMin(0.0);
    nAttr.setSoftMax(1.0);    
    MPxNode::addAttribute(aPrimitiveTransparency);

    // add line width and line style attributes
    aLineWidth = nAttr.create("lineWidth", "lw", MFnNumericData::kFloat, 2.0);
    MPxNode::addAttribute(aLineWidth);

    aLineStyle = eAttr.create("lineStyle", "ls", MUIDrawManager::kSolid);
    eAttr.addField("solid", MUIDrawManager::kSolid);
    eAttr.addField("shortdotted", MUIDrawManager::kShortDotted);
    eAttr.addField("shortdashed", MUIDrawManager::kShortDashed);
    eAttr.addField("dashed", MUIDrawManager::kDashed);
    eAttr.addField("dotted", MUIDrawManager::kDotted);
    MPxNode::addAttribute(aLineStyle);

    // Add filled attribute
    aIsFilled = nAttr.create("isFilled", "if", MFnNumericData::kBoolean, 0);    
    MPxNode::addAttribute(aIsFilled);

    // Add shaded attribute
    aShaded = nAttr.create("shaded", "sd", MFnNumericData::kBoolean, 0);    
    MPxNode::addAttribute(aShaded);

    // Add radius attribute
    aRadius = nAttr.create("radius", "ra", MFnNumericData::kDouble, 1.0);
    MPxNode::addAttribute(aRadius);

    // add 2D attributes
    aDraw2D = nAttr.create("draw2D", "d2", MFnNumericData::kBoolean, 0);
    MPxNode::addAttribute(aDraw2D);

    aPosition = nAttr.create("position", "pos", MFnNumericData::k3Double);
    nAttr.setDefault(0.0, 0.0, 0.001);
    MPxNode::addAttribute(aPosition);

    // Add text attributes.
    MFnStringData stringFn;
    MObject defaultText = stringFn.create("uiDrawManager-Text");
    aText = typedAttr.create("text", "t", MFnData::kString, defaultText);
    MPxNode::addAttribute(aText);    

    aTextFontSize = nAttr.create("textFontSize", "tfs", MFnNumericData::kInt, MUIDrawManager::kDefaultFontSize);
    nAttr.setMin(-1);
    nAttr.setMax(99);    
    MPxNode::addAttribute(aTextFontSize);

    unsigned int nFont = MUIDrawManager::getFontList(uiDrawManagerData::fFontList);
    if (nFont == 0)
    {
        perror("No font available!");
    }
    aFontFaceName = eAttr.create("fontFaceName", "ffn", 0);
    for (unsigned int i = 0; i < nFont; i++)
    {
        MString str = uiDrawManagerData::fFontList[i];
        eAttr.addField(str, (short)i);
    }
    MPxNode::addAttribute(aFontFaceName);

    aTextAlignment = eAttr.create("textAlignment", "ta", MUIDrawManager::kLeft);
    eAttr.addField("left", MUIDrawManager::kLeft);
    eAttr.addField("center", MUIDrawManager::kCenter);
    eAttr.addField("right", MUIDrawManager::kRight);
    MPxNode::addAttribute(aTextAlignment);    

//.........这里部分代码省略.........
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:101,代码来源:uiDrawManager.cpp

示例6: Separately

MStatus	MayaToKrayGlobals::initialize()
{
	MayaRenderGlobalsNode::initialize();

	MFnNumericAttribute nAttr;
	MFnTypedAttribute tAttr;
	MFnGenericAttribute gAttr;
	MFnEnumAttribute eAttr;
	MStatus stat = MStatus::kSuccess;

	//  DOF (depth of field) and motion blur will not work in adaptive mode.
	samplingType = eAttr.create( "samplingType", "samplingType", 0, &stat);
	stat = eAttr.addField( "None", 0 );
	stat = eAttr.addField( "Grid", 1 );
	stat = eAttr.addField( "Qasi Random", 2 );
	stat = eAttr.addField( "Random Full Screen AA", 3 );
	CHECK_MSTATUS(addAttribute( samplingType ));

	rotateGrid = nAttr.create("rotateGrid", "rotateGrid",  MFnNumericData::kBoolean, true);
	CHECK_MSTATUS(addAttribute( rotateGrid ));

	gridSize = nAttr.create("gridSize", "gridSize",  MFnNumericData::kInt, 2);
	CHECK_MSTATUS(addAttribute( gridSize ));

	filterRadius = nAttr.create("filterRadius", "filterRadius",  MFnNumericData::kFloat, 0.7);
	CHECK_MSTATUS(addAttribute( filterRadius ));

	aa_edgeAbsolute = nAttr.create("aa_edgeAbsolute", "aa_edgeAbsolute",  MFnNumericData::kFloat, 0.2);
	CHECK_MSTATUS(addAttribute( aa_edgeAbsolute ));

	aa_relative = nAttr.create("aa_relative", "aa_relative",  MFnNumericData::kFloat, 0.2);
	CHECK_MSTATUS(addAttribute( aa_relative ));

	aa_thickness = nAttr.create("aa_thickness", "aa_thickness",  MFnNumericData::kInt, 1);
	CHECK_MSTATUS(addAttribute( aa_thickness ));

	aa_overburn = nAttr.create("aa_overburn", "aa_overburn",  MFnNumericData::kFloat, 1.0);
	CHECK_MSTATUS(addAttribute( aa_overburn ));

	aa_normal = nAttr.create("aa_normal", "aa_normal",  MFnNumericData::kFloat, 0.1);
	CHECK_MSTATUS(addAttribute( aa_normal ));

	aa_z = nAttr.create("aa_z", "aa_z",  MFnNumericData::kFloat, 0.1);
	CHECK_MSTATUS(addAttribute( aa_z ));

	aa_undersample = nAttr.create("aa_undersample", "aa_undersample",  MFnNumericData::kFloat, 0.2);
	CHECK_MSTATUS(addAttribute( aa_undersample ));

	aa_threshold = nAttr.create("aa_threshold", "aa_threshold",  MFnNumericData::kFloat, 0.01);
	CHECK_MSTATUS(addAttribute( aa_threshold ));

	aa_minRays = nAttr.create("aa_minRays", "aa_minRays",  MFnNumericData::kInt, 2);
	CHECK_MSTATUS(addAttribute( aa_minRays ));

	aa_maxRays = nAttr.create("aa_maxRays", "aa_maxRays",  MFnNumericData::kInt, 2);
	CHECK_MSTATUS(addAttribute( aa_maxRays ));

	aa_rays = nAttr.create("aa_rays", "aa_rays",  MFnNumericData::kInt, 2);
	CHECK_MSTATUS(addAttribute( aa_rays ));

	mb_subframes = nAttr.create("mb_subframes", "mb_subframes",  MFnNumericData::kInt, 2);
	CHECK_MSTATUS(addAttribute( mb_subframes ));

	aa_upsample = nAttr.create("aa_upsample", "aa_upsample",  MFnNumericData::kInt, 2);
	CHECK_MSTATUS(addAttribute( aa_upsample ));

	diffuseModel = eAttr.create( "diffuseModel", "diffuseModel", 2, &stat);
	stat = eAttr.addField( "Raytrace", 0 );
	stat = eAttr.addField( "Photon Estimate", 1 );
	stat = eAttr.addField( "Photon Mapping", 2 );
	stat = eAttr.addField( "Path tracing", 3 );
	//stat = eAttr.addField( "Cache irradiance", 3 );
	//stat = eAttr.addField( "Caustics", 5 );
	CHECK_MSTATUS(addAttribute( diffuseModel ));

	doCaustics = nAttr.create("doCaustics", "doCaustics",  MFnNumericData::kBoolean, false);
	CHECK_MSTATUS(addAttribute( doCaustics ));

	diffuseModelPhoton = eAttr.create( "diffuseModelPhoton", "diffuseModelPhoton", 0, &stat);
	stat = eAttr.addField( "Global Filtered", 0 );
	stat = eAttr.addField( "Global Unfiltered", 1 );
	stat = eAttr.addField( "Precomputed Filtered", 2 );
	stat = eAttr.addField( "Precomputed Unfiltered", 3 );
	CHECK_MSTATUS(addAttribute( diffuseModelPhoton ));

	giMode = eAttr.create( "giMode", "giMode", 0, &stat);
	stat = eAttr.addField( "Independent", 0 );
	stat = eAttr.addField( "Time interpolation", 1 );
	stat = eAttr.addField( "Shared for all frames", 2 );
	CHECK_MSTATUS(addAttribute( giMode ));

	pixelOrder = eAttr.create( "pixelOrder", "pixelOrder", 0, &stat);
	stat = eAttr.addField( "Scanline", 0 );
	stat = eAttr.addField( "Scancolumn", 1 );
	stat = eAttr.addField( "Random", 2 );
	stat = eAttr.addField( "Progressive", 3 );
	stat = eAttr.addField( "RenderWorm", 4 );
	stat = eAttr.addField( "Frost", 5 );
	CHECK_MSTATUS(addAttribute( pixelOrder ));

//.........这里部分代码省略.........
开发者ID:MassW,项目名称:OpenMaya,代码行数:101,代码来源:mtkr_renderGlobalsNode.cpp

示例7: initialize

MStatus disnoiseTexNode::initialize()
{
	MStatus stat;
	MFnNumericAttribute numAttr;
	MFnEnumAttribute enumAttr;

	disnoiseDistort=numAttr.create("Distort","dt",MFnNumericData::kFloat,1.0);
	numAttr.setMin(0.0);
	numAttr.setMax(10.0);
	MAKE_INPUT(numAttr);

	disnoiseSize=numAttr.create("DisnoiseSize","disi",MFnNumericData::kFloat,4.0);
	numAttr.setMin(0.0);
	numAttr.setMax(32.0);
	MAKE_INPUT(numAttr);

	NoiseType1=enumAttr.create("NoiseType1","noty1",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);

	NoiseType2=enumAttr.create("NoiseType2","noty2",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);
//.........这里部分代码省略.........
开发者ID:TheBounty,项目名称:BountyMaya,代码行数:101,代码来源:bNodeTextureDisnoise.cpp

示例8: initialize

//initialize
MStatus Ocio_log_convert::initialize()
{

    //MFnSets
    MFnEnumAttribute eAttr;
    MFnNumericAttribute nAttr;
    MFnTypedAttribute tAttr;


    //a_verbose
    a_verbose = eAttr.create("verbose", "verbose", 1);
    eAttr.addField("no verbose", 0);
    eAttr.addField("verbose", 1);
    addAttribute(a_verbose);

    //a_input_color
    a_input_color = nAttr.createColor("input_color", "input_color");
    nAttr.setUsedAsColor(true);
    nAttr.setStorable(true);
    addAttribute(a_input_color);

    //a_output_color
    a_output_color = nAttr.createColor("output_color", "output_color");
    nAttr.setUsedAsColor(true);
    nAttr.setStorable(false);
    addAttribute(a_output_color);

    //a_env_or_file
    a_env_or_file = eAttr.create("env_or_file", "env_or_file", 0);
    eAttr.addField("OCIO Environment Variable", 0);
    eAttr.addField("Custom Path", 1);
    eAttr.setStorable(true);
    addAttribute(a_env_or_file);

    //a_last_env_or_file
    a_last_env_or_file = nAttr.create("last_env_or_file", "last_env_or_file", MFnNumericData::kInt, 0);
    nAttr.setHidden(true);
    nAttr.setStorable(true);
    addAttribute(a_last_env_or_file);

    //a_config_file_path
    a_config_file_path = tAttr.create("config_file_path", "config_file_path", MFnData::kString);
    tAttr.setUsedAsFilename(true);
    tAttr.setStorable(true);
    addAttribute(a_config_file_path);

    //a_last_config_file_path
    a_last_config_file_path = tAttr.create("last_config_file_path", "last_config_file_path", MFnData::kString);
    tAttr.setHidden(true);
    tAttr.setStorable(true);
    addAttribute(a_last_config_file_path);

    //a_operation
    a_operation = eAttr.create("operation", "operation", 0);
    eAttr.addField("Log to Lin", 0);
    eAttr.addField("Lin to Log", 1);
    addAttribute(a_operation);

    //a_last_operation
    a_last_operation = nAttr.create("last_operation", "last_operation", MFnNumericData::kInt, 0);
    nAttr.setHidden(true);
    nAttr.setStorable(true);
    addAttribute(a_last_operation);






    //Attribute affects
    attributeAffects(a_input_color, a_output_color);
    attributeAffects(a_env_or_file, a_output_color);
    attributeAffects(a_config_file_path, a_output_color);
    attributeAffects(a_operation, a_output_color);




    return MStatus::kSuccess;
}
开发者ID:lucienfostier,项目名称:OpenColorIO_Tools,代码行数:81,代码来源:ocio_log_convert.cpp

示例9: initialize

MStatus CXRayMtl::initialize()
{
	MFnNumericAttribute nAttr; 
	MFnLightDataAttribute lAttr;
	MFnEnumAttribute eAttr;
	MFnTypedAttribute tAttr;

	MStatus status; // Status will be used to hold the MStatus value
	// returned by each api function call. It is important
	// to check the status returned by a call to aid in
	// debugging. Failed API calls can result in subtle 
	// errors that can be difficult to track down, you may
	// wish to use the CHECK_MSTATUS macro for any API
	// call where you do not need to provide your own
	// error handling.
	//

	// Attribute Initialization:
	//
	// create      - The create function creates a new attribute for the
	//				 node, it takes a long name for the attribute, a short
	//				 name for the attribute, the type of the attribute,
	//				 and a status object to determine if the api call was
	//				 successful.
	//
	// setKeyable  - Sets whether this attribute should accept keyframe
	//				 data, Attributes are not keyable by default.
	//
	// setStorable - Sets whether this attribute should be storable. If an
	//				 attribute is storable, then it will be writen out
	//				 when the node is stored to a file. Attributes are 
	//               storable by default.
	//
	// setDefault  - Sets the default value for this attribute.
	//
	// setUsedAsColor - Sets whether this attribute should be presented as
	//				 a color in the UI.
	//
	// setHidden   - Sets whether this attribute should be hidden from the
	//				 UI. This is useful if the attribute is being used for
	//				 blind data, or if it is being used as scratch space
	//				 for a geometry calculation (should also be marked
	//				 non-connectable in that case). Attributes are not
	//				 hidden by default.
	//
	// setReadable - Sets whether this attribute should be readable. If an
	//				 attribute is readable, then it can be used as the
	//				 source in a dependency graph connection. Attributes
	//				 are readable by default.
	//
	// setWritable - Sets whether this attribute should be readable. If an
	//				 attribute is writable, then it can be used as the
	//				 destination in a dependency graph connection. If an
	//			     attribute is not writable then setAttr commands will
	//				 fail to change the attribute. If both keyable and
	//				 writable for an attribute are set to true it will be
	//				 displayed in the channel box when the node is
	//				 selected. Attributes are writable by default.
	//
	// setArray    - Sets whether this attribute should have an array of
	//				 data. This should be set to true if the attribute
	//				 needs to accept multiple incoming connections.
	//				 Attributes are single elements by default.
	//


	// Input Attributes
	//
	aTranslucenceCoeff = nAttr.create( "translucenceCoeff", "tc",
		MFnNumericData::kFloat, 0, &status );
	CHECK_MSTATUS( status );	
	CHECK_MSTATUS( nAttr.setKeyable( true ) );
	CHECK_MSTATUS( nAttr.setStorable( true ) );
	CHECK_MSTATUS( nAttr.setDefault( 0.0f ) );

	aDiffuseReflectivity = nAttr.create( "diffuseReflectivity", "drfl",
		MFnNumericData::kFloat, 0, &status );
	CHECK_MSTATUS( status );
	CHECK_MSTATUS( nAttr.setKeyable( true ) );
	CHECK_MSTATUS( nAttr.setStorable( true ) );
	CHECK_MSTATUS( nAttr.setDefault( 0.8f ) );

	aColorR = nAttr.create( "colorR", "cr",MFnNumericData::kFloat, 0,
		&status );
	CHECK_MSTATUS( status );
	CHECK_MSTATUS( nAttr.setKeyable( true ) );
	CHECK_MSTATUS( nAttr.setStorable( true ) );
	CHECK_MSTATUS( nAttr.setDefault( 0.0f ) );

	aColorG = nAttr.create( "colorG", "cg", MFnNumericData::kFloat, 0,
		&status );
	CHECK_MSTATUS( status );
	CHECK_MSTATUS( nAttr.setKeyable( true ) );
	CHECK_MSTATUS( nAttr.setStorable( true ) );
	CHECK_MSTATUS( nAttr.setDefault( 0.58824f ) );

	aColorB = nAttr.create( "colorB", "cb",MFnNumericData::kFloat, 0,
		&status );
	CHECK_MSTATUS( status );
	CHECK_MSTATUS( nAttr.setKeyable( true ) );
//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:xray,代码行数:101,代码来源:lambertShader.cpp

示例10: initialize

MStatus liqSurfaceNode::initialize()
{
  MFnTypedAttribute   tAttr;
  MFnStringData       tDefault;
  MFnNumericAttribute nAttr;
  MFnEnumAttribute    eAttr;
  MFnMessageAttribute mAttr;
  MFnLightDataAttribute lAttr;
  MStatus status;

  // Create input attributes

  aRmanShader = tAttr.create( MString("rmanShader"), MString("rms"), MFnData::kString, aRmanShader, &status );
  MAKE_INPUT(tAttr);

  aRmanShaderLong = tAttr.create( MString("rmanShaderLong"), MString("rml"), MFnData::kString, aRmanShaderLong, &status );
  MAKE_INPUT(tAttr);

  aRmanShaderLif = tAttr.create(  MString("rmanShaderLif"),  MString("lif"), MFnData::kString, aRmanShaderLif, &status );
  MAKE_INPUT(tAttr);

  aRmanParams = tAttr.create(  MString("rmanParams"),  MString("rpr"), MFnData::kStringArray, aRmanParams, &status );
  MAKE_INPUT(tAttr);

  aRmanDetails = tAttr.create(  MString("rmanDetails"),  MString("rdt"), MFnData::kStringArray, aRmanDetails, &status );
  MAKE_INPUT(tAttr);

  aRmanTypes = tAttr.create(  MString("rmanTypes"),  MString("rty"), MFnData::kStringArray, aRmanTypes, &status );
  MAKE_INPUT(tAttr);

  aRmanDefaults = tAttr.create(  MString("rmanDefaults"),  MString("rdf"), MFnData::kStringArray, aRmanDefaults, &status );
  MAKE_INPUT(tAttr);

  aRmanArraySizes = tAttr.create(  MString("rmanArraySizes"),  MString("ras"), MFnData::kIntArray, aRmanArraySizes, &status );
  MAKE_INPUT(tAttr);

  aRmanLifCmds = tAttr.create(  MString("rmanLifCmds"),  MString("rlc"), MFnData::kStringArray, aRmanLifCmds, &status );
  MAKE_INPUT(tAttr);

  aPreviewPrimitive = eAttr.create( "previewPrimitive", "pvp", 7, &status );
  eAttr.addField( "Sphere",   0 );
  eAttr.addField( "Cube",     1 );
  eAttr.addField( "Cylinder", 2 );
  eAttr.addField( "Torus",    3 );
  eAttr.addField( "Plane",    4 );
  eAttr.addField( "Teapot",   5 );
  eAttr.addField( "Custom",   6 );
  eAttr.addField( "(globals)",7 );
  MAKE_NONKEYABLE_INPUT(eAttr);
  CHECK_MSTATUS(eAttr.setConnectable(false));

  aPreviewCustomPrimitive = tAttr.create(  MString("previewCustomPrimitive"),  MString("pcp"), MFnData::kString, aPreviewCustomPrimitive, &status );
  MAKE_INPUT(tAttr);

  aPreviewCustomBackplane = tAttr.create(  MString("previewCustomBackplane"),  MString("pcb"), MFnData::kString, aPreviewCustomBackplane, &status );
  MAKE_INPUT(tAttr);

  aPreviewCustomLightRig = tAttr.create(  MString("previewCustomLights"),  MString("pcl"), MFnData::kString, aPreviewCustomLightRig, &status );
  MAKE_INPUT(tAttr);

  aPreviewObjectSize = nAttr.create("previewObjectSize", "pos", MFnNumericData::kDouble, 1.0, &status);
  MAKE_NONKEYABLE_INPUT(nAttr);
  CHECK_MSTATUS(nAttr.setConnectable(false));

  aPreviewPixelSamples = nAttr.create("previewPixelSamples", "pxs",  MFnNumericData::kInt, 3, &status);
  MAKE_NONKEYABLE_INPUT(nAttr);
  CHECK_MSTATUS(nAttr.setConnectable(false));

  aPreviewShadingRate = nAttr.create("previewShadingRate", "psr", MFnNumericData::kDouble, 1.0, &status);
  MAKE_NONKEYABLE_INPUT(nAttr);
  CHECK_MSTATUS(nAttr.setConnectable(false));

  aPreviewBackplane = nAttr.create("previewBackplane", "pbp", MFnNumericData::kBoolean, true, &status);
  MAKE_NONKEYABLE_INPUT(nAttr);
  CHECK_MSTATUS(nAttr.setConnectable(false));

  aPreviewIntensity = nAttr.create("previewIntensity", "pi", MFnNumericData::kDouble, 1.0, &status);
  MAKE_NONKEYABLE_INPUT(nAttr);
  CHECK_MSTATUS(nAttr.setConnectable(false));

  aGLPreviewTexture = nAttr.createColor("GLPreviewTexture", "gpt");
  nAttr.setDefault( -1.0, -1.0, -1.0 );
  nAttr.setDisconnectBehavior( MFnAttribute::kReset );
  MAKE_INPUT(nAttr);



  aColor = nAttr.createColor("color", "cs");
  nAttr.setDefault( 1.0, 1.0, 1.0 );
  nAttr.setDisconnectBehavior( MFnAttribute::kReset );
  MAKE_INPUT(nAttr);

  aOpacity = nAttr.createColor("opacity", "os");
  nAttr.setDefault( 1.0, 1.0, 1.0 );
  MAKE_INPUT(nAttr);

  aShaderSpace = tAttr.create( MString("shaderSpace"), MString("ssp"), MFnData::kString, aShaderSpace, &status );
  MAKE_INPUT(tAttr);

  aDisplacementBound = nAttr.create("displacementBound", "db", MFnNumericData::kDouble, 0.0, &status);
//.........这里部分代码省略.........
开发者ID:virtualritz,项目名称:liquidmaya,代码行数:101,代码来源:liqSurfaceNode.cpp

示例11: initialize

MStatus boidsBrain::initialize()
{
	MStatus status;
	
	MFnNumericAttribute		nAttr;
	MFnTypedAttribute		tAttr;
	MFnEnumAttribute		eAttr;
	MFnMessageAttribute		mAttr;
	// MFnUnitAttribute		uAttr;

	// MString				attrOpt;
	
	printf("initializing Boidz Locator node\n");
	MGlobal:: displayInfo("initializing Boidz Locator node");

	nodeCreateAttrNum(simulationLength, sl, kInt, BDZ_SIMLEN );
	nodeCreateAttrNum(framesPerSecond, fps, kInt, BDZ_FPS );
	nodeCreateAttrNum(startFrame, stf, kInt, BDZ_STF );
	particleSystem = mAttr.create("particleSystem", "ps");
	nodeAddAttribute(particleSystem);
	nodeCreateAttrNum(boidsNumber, bn, kInt, BDZ_NUM );
	
	nodeCreateAttrTyp(logFilePath, lp);
	nodeCreateAttrTyp(logFileName, ln);
	// inputSurface = tAttr.create( "inputSurface", "is",MFnData::kNurbsSurface,&stat );
	// nodeCreateAttrTyped(logFileName, ln, BDZ_LOGNAME);
	logFileType = eAttr.create("logFileType", "lt", BDZ_LOGTYPE);
	eAttr.addField("nCache file", 0);
	eAttr.addField("log file", 1);
	eAttr.addField("XML file", 2);
	// eAttr.setStorable(true);
	// nodeCreateAttrNum(logFileType, lt, kDouble, BDZ_LOGTYPE);
	nodeAddAttribute(logFileType);
	
	nodeCreateRuleAttributes(alignment, a)
	nodeCreateRuleAttributes(cohesion, c)
	nodeCreateRuleAttributes(separation, s)
	nodeCreateRuleAttributes(follow, f)
	/*
	nodeCreateAttrNum(distance, d, kDouble, BDZ_DIST)
	nodeCreateAttrNum(repulsionFactor, rf, kDouble, BDZ_REPULSION)
	nodeCreateAttrNum(cohesionFactor, cf, kDouble, BDZ_COHESION)
	nodeCreateAttrNum(separationFactor, sf, kDouble, BDZ_SEPARATION)
	nodeCreateAttrNum(approachFactor, af, kDouble, BDZ_APPROACH)
	*/
	locomotionMode = eAttr.create("locomotionMode", "lm", BDZ_LOCMODE);
	eAttr.addField("physical", 0);
	eAttr.addField("simple", 1);
	nodeAddAttribute(locomotionMode);
	// nodeCreateAttrNum(locomotionMode, lm, kInt, BDZ_LOCMODE)
	nodeCreateAttrNum(maxSpeed, ms, kDouble, BDZ_MAXSPEED)
	nodeCreateAttrNum(maxForce, mf, kDouble, BDZ_MAXACCEL)
	// nodeCreateAttrNum(mass, mss, kDouble, BDZ_MASS)

	// check for error
	if( status != MS::kSuccess ) {
		status.perror("Unable to attach one or more attributes to the boidsBrain node");
		return status;
	}
	
	MGlobal:: displayInfo("boidsBrain node attributes applied");

	return MS::kSuccess;
}
开发者ID:100cells,项目名称:Bad-Boids,代码行数:64,代码来源:boidsBrain.cpp

示例12: initialize

MStatus imageTexNode::initialize()
{
	MStatus stat;
	MFnNumericAttribute numAttr;
	MFnEnumAttribute enumAttr;
	MFnTypedAttribute tAttr;

	imageFile=tAttr.create("ImageFile","if",MFnData::kString);
	MAKE_INPUT(tAttr);

	imageRepeatX=numAttr.create("RepeatX","rx",MFnNumericData::kInt,1);
	MAKE_INPUT(numAttr);
	numAttr.setMin(1);
	numAttr.setMax(512);

	imagerepeatY=numAttr.create("RepeatY","ry",MFnNumericData::kInt,1);
	MAKE_INPUT(numAttr);
	numAttr.setMin(1);
	numAttr.setMax(512);

	imageUseAlpha=numAttr.create("UseAlpha","ua",MFnNumericData::kBoolean,0);
	MAKE_INPUT(numAttr);

	imageCalcAlpha=numAttr.create("CalculateAlpha","ca",MFnNumericData::kBoolean,0);
	MAKE_INPUT(numAttr);

	imageNormalMap=numAttr.create("NormalMap","nm",MFnNumericData::kBoolean,0);
	MAKE_INPUT(numAttr);

	imageMinX=numAttr.create("MinX","minx",MFnNumericData::kFloat,0.0);
	MAKE_INPUT(numAttr);
	numAttr.setMin(-10.0);
	numAttr.setMax(10.0);

	imageMinY=numAttr.create("MinY","miny",MFnNumericData::kFloat,0.0);
	MAKE_INPUT(numAttr);
	numAttr.setMin(-10.0);
	numAttr.setMax(10.0);

	imageMaxX=numAttr.create("MaxX","maxx",MFnNumericData::kFloat,1.0);
	MAKE_INPUT(numAttr);
	numAttr.setMin(-10.0);
	numAttr.setMax(10.0);

	imageMaxY=numAttr.create("MaxY","maxy",MFnNumericData::kFloat,1.0);
	MAKE_INPUT(numAttr);
	numAttr.setMin(-10.0);
	numAttr.setMax(10.0);

	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);
//.........这里部分代码省略.........
开发者ID:Maitreya,项目名称:YafaRay-Maya-Exporter,代码行数:101,代码来源:bNodeTextureImage.cpp

示例13: initialize

MStatus worldSettingNode::initialize()
{
	MStatus stat;
	MFnNumericAttribute numAttr;
	MFnEnumAttribute enumAttr;

	backgroundTypes=enumAttr.create("BackgroundTypes","wbaty",0);
	enumAttr.addField("Single Color",0);
	enumAttr.addField("Gradient",1);
	enumAttr.addField("Texture",2);
	enumAttr.addField("Sunsky",3);
	enumAttr.addField("DarkTide's Sunsky",4);
	//MCHECKERROR(stat, "create background types");
	enumAttr.setKeyable(true);
	enumAttr.setStorable(true);
	enumAttr.setHidden(true);

	volumeInitTypes=enumAttr.create("VolumeTypes","wvoty",0);
	enumAttr.addField("None",0);
	enumAttr.addField("Single Scatter",1);
    enumAttr.addField("Sky",2);
	//MCHECKERROR(stat, "create volume types");
	enumAttr.setKeyable(true);
	enumAttr.setStorable(true);

	DSSkyColorSpaces=enumAttr.create("DarkTideSunskyColorSpaces","wdasu",0);
	enumAttr.addField("CIEE",0);
	enumAttr.addField("CIED50",1);
	enumAttr.addField("sRBGD65",2);
	enumAttr.addField("sRGBD50",3);
	//MCHECKERROR(stat, "create DarkTide's sunsky color spaces");
	enumAttr.setKeyable(true);
	enumAttr.setStorable(true);

	backgroundColor=numAttr.createColor("BackgroundColor","wbaco");
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setDefault(0.0,0.0,0.0);

	//gradient attribute
	horizonColor=numAttr.createColor("HorizonColor","whoco");
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setDefault(0.1,0.8,0.5);

	zenithColor=numAttr.createColor("ZenithColor","wzeco");
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setDefault(0.4,0.5,0.1);

	horGroundColor=numAttr.createColor("HorGroundColor","whgco");
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setDefault(0.4,0.5,0.6);

	zenGroundColor=numAttr.createColor("ZenGroundColor","wzgco");
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setDefault(0.9,0.5,0.2);

	//texture attribute
	texRotation=numAttr.create("TextureRotation","wtero",MFnNumericData::kFloat,0.0);
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setMin(0.0f);
	numAttr.setMax(360.0f);

	//sunsky attribute
	turbidity=numAttr.create("Turbidity","wtu",MFnNumericData::kFloat,1.0);
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setMin(1.0f);
	numAttr.setMax(20.0f);

	AHorBrght=numAttr.create("AHorBrght","wahb",MFnNumericData::kFloat,0.0);
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setMin(0.0f);
	numAttr.setMax(10.0f);

	BHorSprd=numAttr.create("BHorSprd","wbhs",MFnNumericData::kFloat,0.0);
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setMin(0.0f);
	numAttr.setMax(10.0f);

	CSunBrght=numAttr.create("CSunBrght","wcsb",MFnNumericData::kFloat,0.0);
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setMin(0.0f);
	numAttr.setMax(10.0f);

	DSunSize=numAttr.create("DSunsize","wdss",MFnNumericData::kFloat,0.0);
	numAttr.setKeyable(true);
	numAttr.setStorable(true);
	numAttr.setMin(0.0f);
	numAttr.setMax(10.0f);

	EBacklight=numAttr.create("EBacklight","webl",MFnNumericData::kFloat,0.0);
	numAttr.setKeyable(true);
//.........这里部分代码省略.........
开发者ID:Maitreya,项目名称:YafaRay-Maya-Exporter,代码行数:101,代码来源:bWorldSettingNode.cpp

示例14: initialize

// DESCRIPTION:
//
MStatus PtexColorNode::initialize()
{
	MStatus status;

	MFnNumericAttribute numericAttribute;

	// Input attributes

	MFnTypedAttribute fileNameAttribute;
	aPtexFileName = fileNameAttribute.create( "ptexFileName", "f", MFnData::kString );
	MAKE_INPUT( fileNameAttribute );
	fileNameAttribute.setConnectable(false);

	MFnEnumAttribute enumAttribute;
	aPtexFilterType = enumAttribute.create( "ptexFilterType", "t", 0, &status );
	MCHECKERROR( status, "create filterType attribute" );
	enumAttribute.addField( "Point",      0 );
	enumAttribute.addField( "Bilinear",   1 );
	enumAttribute.addField( "Box",        2 );
	enumAttribute.addField( "Gaussian",   3 );
	enumAttribute.addField( "Bicubic",    4 );
	enumAttribute.addField( "BSpline",    5 );
	enumAttribute.addField( "CatmullRom", 6 );
	enumAttribute.addField( "Mitchell",   7 );
	enumAttribute.setHidden( false );
	MAKE_INPUT( enumAttribute );
	enumAttribute.setConnectable(false);
	MCHECKERROR( status, "Error adding shapeType attribute." );

	MFnNumericAttribute filterSizeAttribute;
	aPtexFilterSize = filterSizeAttribute.create( "ptexFilterSize", "s", MFnNumericData::kFloat, 1.0 );
	MAKE_INPUT( filterSizeAttribute );
	filterSizeAttribute.setConnectable(false);

	// Implicit shading network attributes

	MObject child1 = numericAttribute.create( "uCoord", "u", MFnNumericData::kFloat);
	MObject child2 = numericAttribute.create( "vCoord", "v", MFnNumericData::kFloat);
	aUVPos = numericAttribute.create( "uvCoord", "uv", child1, child2);
	MAKE_INPUT( numericAttribute );
	CHECK_MSTATUS( numericAttribute.setHidden(true) );

	child1 = numericAttribute.create( "uvFilterSizeX", "fsx", MFnNumericData::kFloat);
	child2 = numericAttribute.create( "uvFilterSizeY", "fsy", MFnNumericData::kFloat);
	aUVSize = numericAttribute.create( "uvFilterSize", "fs", child1, child2 );
	MAKE_INPUT( numericAttribute );
	CHECK_MSTATUS( numericAttribute.setHidden(true) );

	// Output attributes
	aOutColor = numericAttribute.createColor("outColor", "oc");
	MAKE_OUTPUT(numericAttribute);

	// Add attributes to the node database.
	CHECK_MSTATUS( addAttribute(aPtexFileName) );
	CHECK_MSTATUS( addAttribute(aPtexFilterType) );
	CHECK_MSTATUS( addAttribute(aPtexFilterSize) );
	CHECK_MSTATUS( addAttribute(aUVPos) );
	CHECK_MSTATUS( addAttribute(aUVSize) );

	CHECK_MSTATUS( addAttribute(aOutColor) );

	// All input affect the output color
	CHECK_MSTATUS( attributeAffects( aPtexFileName,   aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aPtexFilterSize, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aPtexFilterType, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aUVPos,          aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aUVSize,         aOutColor ) );

	return MS::kSuccess;
}
开发者ID:Mankua,项目名称:PtexShaders,代码行数:72,代码来源:PtexColorNode.cpp

示例15: initialize

MStatus MG_poseReader::initialize()
	{ 
		//Declaring all the needed attribute function sets
		MFnEnumAttribute enumFn;
		MFnMatrixAttribute matrixFn;
		MFnNumericAttribute numFn;
		MFnCompoundAttribute compA;


		//Aim axis input attribute

		aimAxis = enumFn.create("aimAxis","aa",0);
		enumFn.addField("x",0);
		enumFn.addField("y",1);
		enumFn.addField("z",2);
		enumFn.setKeyable(true);
		enumFn.setStorable(true);
		addAttribute(aimAxis); 

		//Pose matrix input attribute

		
		poseMatrix =matrixFn.create("poseMatrix","psm");
		matrixFn.setKeyable(true);
		matrixFn.setStorable(true);
		addAttribute(poseMatrix); 

		//Reader matrix input attribute

		readerMatrix =matrixFn.create("readerMatrix","rm");
		matrixFn.setKeyable(true);
		matrixFn.setStorable(true);
		addAttribute(readerMatrix); 

		//Aim axis input attribute

		//Arrow size
		size =numFn.create("size","siz",MFnNumericData::kDouble,1);
		numFn.setKeyable(true);
		numFn.setStorable(true);
		addAttribute(size);

		readerOnOff =numFn.create("readerOnOff","rof",MFnNumericData::kBoolean,1);
		numFn.setKeyable(true);
		numFn.setStorable(true);
		addAttribute(readerOnOff);
		

		axisOnOff =numFn.create("axisOnOff","aof",MFnNumericData::kBoolean,1);
		numFn.setKeyable(true);
		numFn.setStorable(true);
		addAttribute(axisOnOff);


		poseOnOff =numFn.create("poseOnOff","pof",MFnNumericData::kBoolean,1);
		numFn.setKeyable(true);
		numFn.setStorable(true);
		addAttribute(poseOnOff);



		xPositive = numFn.create("xPositive","xp",MFnNumericData::kDouble,0);
		numFn.setStorable(false);
		numFn.setWritable(false);
		addAttribute(xPositive);

		xNegative = numFn.create("xNegative","xn",MFnNumericData::kDouble,0);
		numFn.setStorable(false);
		numFn.setWritable(false);
		addAttribute(xNegative);

		yPositive = numFn.create("yPositive","yp",MFnNumericData::kDouble,0);
		numFn.setStorable(false);
		numFn.setWritable(false);
		addAttribute(yPositive);

		yNegative = numFn.create("yNegative","yn",MFnNumericData::kDouble,0);
		numFn.setStorable(false);
		numFn.setWritable(false);
		addAttribute(yNegative);

		zPositive = numFn.create("zPositive","zp",MFnNumericData::kDouble,0);
		numFn.setStorable(false);
		numFn.setWritable(false);
		addAttribute(zPositive);

		zNegative = numFn.create("zNegative","zn",MFnNumericData::kDouble,0);
		numFn.setStorable(false);
		numFn.setWritable(false);
		addAttribute(zNegative);



		attributeAffects (aimAxis,xPositive);
		attributeAffects (poseMatrix,xPositive);
		attributeAffects (readerMatrix,xPositive);
		attributeAffects (size,xPositive);

		attributeAffects (aimAxis,xNegative);
		attributeAffects (poseMatrix,xNegative);
//.........这里部分代码省略.........
开发者ID:bungnoid,项目名称:MG_Tools,代码行数:101,代码来源:MG_poseReader.cpp


注:本文中的MFnEnumAttribute::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。