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


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

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


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

示例1: initialize

MStatus VolumePushCollider::initialize()
{
    MFnNumericAttribute nAttr;
    MFnMatrixAttribute mAttr;

    // inCollider
    aInCollider = mAttr.create("inCollider", "col");
    mAttr.setArray(true);
    CHECK_MSTATUS(addAttribute(aInCollider));

    // inVolume
    aInVolume = mAttr.create("inVolume", "vol");
    mAttr.setArray(true);
    CHECK_MSTATUS(addAttribute(aInVolume));

    // output
    aOutput = nAttr.create("output", "out", MFnNumericData::kDouble, 0.0);
    nAttr.setArray(true);
    nAttr.setReadable(true);
    nAttr.setWritable(true);
    nAttr.setHidden(true);
    CHECK_MSTATUS(addAttribute(aOutput));

    attributeAffects(aInCollider, aOutput);
    attributeAffects(aInVolume, aOutput);

    return MS::kSuccess;
}
开发者ID:jonntd,项目名称:Public,代码行数:28,代码来源:volumePushCollider.cpp

示例2: initialize

MStatus transRotateCombineMatrix::initialize()
{
	MStatus status;

	MFnMatrixAttribute mAttr;

	aOutputMatrix = mAttr.create( "outputMatrix", "om" );
	mAttr.setStorable( false );
	status = addAttribute( aOutputMatrix );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	aOutputInverseMatrix = mAttr.create( "outputInverseMatrix", "oim" );
	mAttr.setStorable( false );
	status = addAttribute( aOutputInverseMatrix );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	aInputTransMatrix = mAttr.create( "inputTransMatrix", "itm" );
	mAttr.setStorable( true );
	status = addAttribute( aInputTransMatrix );
	CHECK_MSTATUS_AND_RETURN_IT( status );
	status = attributeAffects( aInputTransMatrix, aOutputMatrix );
	status = attributeAffects( aInputTransMatrix, aOutputInverseMatrix );

	aInputRotateMatrix = mAttr.create( "inputRotateMatrix", "irm" );
	mAttr.setStorable( true );
	status = addAttribute( aInputRotateMatrix );
	CHECK_MSTATUS_AND_RETURN_IT( status );
	status = attributeAffects( aInputRotateMatrix, aOutputMatrix );
	status = attributeAffects( aInputRotateMatrix, aOutputInverseMatrix );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	return MS::kSuccess;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:33,代码来源:transRotateCombineMatrix.cpp

示例3: initialize

MStatus sgLockAngleMatrix::initialize()	
{
	MStatus status;

	MFnMatrixAttribute mAttr;
	MFnNumericAttribute nAttr;
	MFnEnumAttribute   eAttr;

	aBaseMatrix = mAttr.create( "baseMatrix", "baseMatrix" );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aBaseMatrix ) );

	aInputMatrix = mAttr.create( "inputMatrix", "inputMatrix" );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMatrix ) );

	aAngleAxis = eAttr.create( "angleAxis", "angleAxis" );
	eAttr.addField( " X", 0 );eAttr.addField( " Y", 1 );eAttr.addField( " Z", 2 );
	eAttr.addField( "-X", 3 );eAttr.addField( "-Y", 4 );eAttr.addField( "-Z", 5 );
	eAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aAngleAxis ) );

	aInputAngle = nAttr.create( "inputAngle", "inputAngle", MFnNumericData::kDouble, 45 );
	nAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputAngle ) );

	aOutputMatrix = mAttr.create( "outputMatrix", "outputMatrix" );
	mAttr.setStorable( false );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutputMatrix ) );

	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aBaseMatrix, aOutputMatrix ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMatrix, aOutputMatrix ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aAngleAxis, aOutputMatrix ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputAngle, aOutputMatrix ) );

	return MS::kSuccess;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:35,代码来源:sgLockAngleMatrix.cpp

示例4: initialize

MStatus BCIViz::initialize()
{ 
	MFnNumericAttribute numFn;
	MFnMatrixAttribute matAttr;
	MStatus			 stat;
	
	ainput = matAttr.create( "input", "in", MFnMatrixAttribute::kDouble );
	matAttr.setStorable(false);
	matAttr.setWritable(true);
	matAttr.setConnectable(true);
	addAttribute(ainput);
	
	atargets = matAttr.create( "target", "tgt", MFnMatrixAttribute::kDouble );
	matAttr.setStorable(false);
	matAttr.setWritable(true);
	matAttr.setArray(true);
	matAttr.setConnectable(true);
	addAttribute(atargets);
	
	outValue = numFn.create( "outValue", "ov", MFnNumericData::kDouble );
	numFn.setStorable(false);
	numFn.setWritable(false);
	numFn.setReadable(true);
	numFn.setArray(true);
	numFn.setUsesArrayDataBuilder( true );
	addAttribute(outValue);
	
	attributeAffects(ainput, outValue);
	attributeAffects(atargets, outValue);
	return MS::kSuccess;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:31,代码来源:bciosVizNode.cpp

示例5: initialize

MStatus  clusterControledCurve::initialize()
{
	MStatus  status;

	MFnNumericAttribute  nAttr;
	MFnMatrixAttribute   mAttr;
	MFnTypedAttribute    tAttr;
	MFnCompoundAttribute cAttr;

	aInputCurve = tAttr.create( "inputCurve", "inputCurve", MFnData::kNurbsCurve );
	tAttr.setStorable( true );
	CHECK_MSTATUS( addAttribute( aInputCurve ) );

	aInputCurveMatrix = mAttr.create( "inputCurveMatrix", "inputCurveMatrix" );
	mAttr.setStorable( true );
	CHECK_MSTATUS( addAttribute( aInputCurveMatrix ) );

	aDumyMatrix = mAttr.create( "dumyMatrix", "dumyMatrix" );
	mAttr.setStorable( true );
	CHECK_MSTATUS( addAttribute( aDumyMatrix ) );

	aBindPreMatrix = mAttr.create( "bindPreMatrix", "bindPreMatrix" );
	mAttr.setStorable( true );
	mAttr.setArray( true );
	nAttr.setUsesArrayDataBuilder( true );
	CHECK_MSTATUS( addAttribute( aBindPreMatrix ) );

	aMatrix = mAttr.create( "matrix", "matrix" );
	mAttr.setStorable( true );
	mAttr.setArray( true );
	CHECK_MSTATUS( addAttribute( aMatrix ) );

	aWeightList = cAttr.create( "weightList", "weightList" );
	aWeights = nAttr.create( "weights", "weights", MFnNumericData::kFloat, 0.0 );
	nAttr.setArray( true );
	nAttr.setUsesArrayDataBuilder( true );
	cAttr.addChild( aWeights );
	cAttr.setArray( true );
	cAttr.setStorable( true );
	CHECK_MSTATUS( addAttribute( aWeightList ) );

	aUpdate = nAttr.create( "update", "update", MFnNumericData::kBoolean, false );
	nAttr.setStorable( true );
	CHECK_MSTATUS( addAttribute( aUpdate ) );

	aOutputCurve = tAttr.create( "outputCurve", "outputCurve", MFnData::kNurbsCurve );
	CHECK_MSTATUS( addAttribute( aOutputCurve ) );

	CHECK_MSTATUS( attributeAffects( aInputCurve, aOutputCurve ) );
	CHECK_MSTATUS( attributeAffects( aInputCurveMatrix, aOutputCurve ) );
	CHECK_MSTATUS( attributeAffects( aDumyMatrix, aOutputCurve ) );
	CHECK_MSTATUS( attributeAffects( aBindPreMatrix, aOutputCurve ) );
	CHECK_MSTATUS( attributeAffects( aMatrix, aOutputCurve ) );
	CHECK_MSTATUS( attributeAffects( aWeightList, aOutputCurve ) );
	CHECK_MSTATUS( attributeAffects( aUpdate, aOutputCurve ) );

	return MS::kSuccess;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:58,代码来源:clusterControledCurve.cpp

示例6: initialize

MStatus inverseSkinCluster::initialize()
{
	MStatus   status;

	MFnNumericAttribute nAttr;
	MFnMatrixAttribute mAttr;
	MFnMessageAttribute msgAttr;
	MFnTypedAttribute tAttr;

	aInMesh = tAttr.create( "inMesh", "inMesh", MFnData::kMesh );
	tAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInMesh ) );

	aGeomMatrix = mAttr.create( "geomMatrix", "geomMatrix" );
	tAttr.setCached( false );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aGeomMatrix ) );

	aMatrix = mAttr.create( "matrix", "matrix" );
	mAttr.setArray( true );
	mAttr.setStorable( true );
	mAttr.setUsesArrayDataBuilder( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aMatrix ) );

	aBindPreMatrix = mAttr.create( "bindPreMatrix", "bindPreMatrix" );
	mAttr.setArray( true );
	mAttr.setStorable( true );
	mAttr.setUsesArrayDataBuilder( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aBindPreMatrix ) );

	aUpdateMatrix = nAttr.create( "updateMatrix", "updateMatrix", MFnNumericData::kBoolean, false );
	nAttr.setStorable( false );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aUpdateMatrix ) );

	aTargetSkinCluster = msgAttr.create( "targetSkinCluster", "targetSkinCluster" );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aTargetSkinCluster ) );

	aUpdateWeightList = nAttr.create( "updateWeightList", "updateWeightList", MFnNumericData::kBoolean, false );
	nAttr.setStorable( false );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aUpdateWeightList ) );

	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInMesh, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aGeomMatrix, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aMatrix, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aBindPreMatrix, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aUpdateMatrix, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aUpdateWeightList, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aTargetSkinCluster, outputGeom ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aMatrix, outputGeom ) );

	return MS::kSuccess;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:51,代码来源:inverseSkinCluster.cpp

示例7: initialize

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;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:34,代码来源:sgBulgeDeformer.cpp

示例8: initialize

MStatus SwirlDeformer::initialize()
{
MFnMatrixAttribute mAttr;
deformSpace = mAttr.create( "deformSpace", "dSp" );
mAttr.setStorable( false );

MFnUnitAttribute unitFn;    
startDist = unitFn.create( "startDist", "sd", MFnUnitAttribute::kDistance );
unitFn.setDefault( MDistance( 0.0, MDistance::uiUnit() ) );
unitFn.setMin( MDistance( 0.0, MDistance::uiUnit() ) );
unitFn.setKeyable( true );

endDist = unitFn.create( "endDist", "ed", MFnUnitAttribute::kDistance );
unitFn.setDefault( MDistance( 3.0, MDistance::uiUnit() ) );
unitFn.setMin( MDistance( 0.0, MDistance::uiUnit() ) );
unitFn.setKeyable( true );

addAttribute( deformSpace );
addAttribute( startDist );
addAttribute( endDist );

attributeAffects( deformSpace, outputGeom );
attributeAffects( startDist, outputGeom );
attributeAffects( endDist, outputGeom );

return MS::kSuccess;
}
开发者ID:animformed,项目名称:complete-maya-programming-book-files,代码行数:27,代码来源:SwirlDeformer.cpp

示例9: initialize

MStatus sgMeshIntersect::initialize()	
{
	MStatus				status;
	MFnNumericAttribute nAttr;
	MFnTypedAttribute   tAttr;
	MFnMatrixAttribute  mAttr;

	aPointSourceX = nAttr.create( "pointSourceX", "psx", MFnNumericData::kDouble, 0.0 );
	aPointSourceY = nAttr.create( "pointSourceY", "psy", MFnNumericData::kDouble, 0.0 );
	aPointSourceZ = nAttr.create( "pointSourceZ", "psz", MFnNumericData::kDouble, 0.0 );
	aPointSource  = nAttr.create( "pointSource", "ps", aPointSourceX, aPointSourceY, aPointSourceZ );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aPointSource ) );

	aPointDestX = nAttr.create( "pointDestX", "pdx", MFnNumericData::kDouble, 0.0 );
	aPointDestY = nAttr.create( "pointDestY", "pdy", MFnNumericData::kDouble, 0.0 );
	aPointDestZ = nAttr.create( "pointDestZ", "pdz", MFnNumericData::kDouble, 0.0 );
	aPointDest  = nAttr.create( "pointDest", "pd", aPointDestX, aPointDestY, aPointDestZ );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aPointDest ) );

	aInputMesh = tAttr.create( "inputMesh", "inMesh", MFnData::kMesh );
	tAttr.setCached( false );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMesh ) );

	aInputMeshMatrix = mAttr.create( "inputMeshMatrix", "inMatrix" );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMeshMatrix ) );

	aParentInverseMatrix = mAttr.create( "parentInverseMatrix", "pim" );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aParentInverseMatrix ) );

	aOutPointX = nAttr.create( "outPointX", "opx", MFnNumericData::kDouble, 0.0 );
	aOutPointY = nAttr.create( "outPointY", "opy", MFnNumericData::kDouble, 0.0 );
	aOutPointZ = nAttr.create( "outPointZ", "opz", MFnNumericData::kDouble, 0.0 );
	aOutPoint  = nAttr.create( "outPoint", "op", aOutPointX, aOutPointY, aOutPointZ );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutPoint ) );

	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aPointSource, aOutPoint ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aPointDest, aOutPoint ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMesh, aOutPoint ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMeshMatrix, aOutPoint ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aParentInverseMatrix, aOutPoint ) );

	m_nodeNumber = 0;

	return MS::kSuccess;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:45,代码来源:sgMeshIntersect.cpp

示例10: initialize

MStatus  matrixFromPolygon::initialize()
{
	MStatus  status;

	MFnNumericAttribute nAttr;
	MFnMatrixAttribute  mAttr;
	MFnTypedAttribute   tAttr;

	aOutputMatrix = mAttr.create( "outputMatrix", "outputMatrix" );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutputMatrix ) );

	aInputMesh = tAttr.create( "inputMesh", "inputMesh", MFnData::kMesh );
	tAttr.setStorable( true );
	tAttr.setCached( false );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMesh ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMesh, aOutputMatrix ) );

	aInputMeshMatrix = mAttr.create( "inputMeshMatrix", "inputMeshMatrix" );
	mAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMeshMatrix ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMeshMatrix, aOutputMatrix ) );

	aPolygonIndex = nAttr.create( "polygonIndex", "polygonIndex", MFnNumericData::kInt, 0 );
	nAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aPolygonIndex ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aPolygonIndex, aOutputMatrix ) );

	aU = nAttr.create( "u", "u", MFnNumericData::kDouble, 0.5 );
	nAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aU ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aU, aOutputMatrix ) );

	aV = nAttr.create( "v", "v", MFnNumericData::kDouble, 0.5 );
	nAttr.setStorable( true );
	CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aV ) );
	CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aV, aOutputMatrix ) );

	return  MS::kSuccess;
}
开发者ID:jonntd,项目名称:mayadev-1,代码行数:39,代码来源:matrixFromPolygon.cpp

示例11: initialize

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;
	}
开发者ID:bungnoid,项目名称:MG_Tools,代码行数:37,代码来源:MG_curve.cpp

示例12: initialize

MStatus offset::initialize()
{
	// local attribute initialization

	MFnMatrixAttribute  mAttr;
	offsetMatrix=mAttr.create( "locateMatrix", "lm");
	    mAttr.setStorable(false);
		mAttr.setConnectable(true);

	//  deformation attributes
	addAttribute( offsetMatrix);

	attributeAffects( offset::offsetMatrix, offset::outputGeom );

	return MStatus::kSuccess;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:16,代码来源:offsetNode.cpp

示例13: initialize

MStatus sphericalBlendShapeVisualizer::initialize()
		
{
	MStatus status;

	MFnMatrixAttribute mAttr;
	MFnEnumAttribute   eAttr;

	aSpaceMatrix = mAttr.create("spaceMatrix", "spaceMatrix", MFnMatrixAttribute::kDouble, &status);
	CHECK_MSTATUS_AND_RETURN_IT(status);

	aPoleAxis = eAttr.create("poleAxis", "poleAxis", 1, &status);
	CHECK_MSTATUS_AND_RETURN_IT(status);
	eAttr.addField("+X", 0);
	eAttr.addField("+Y", 1);
	eAttr.addField("+Z", 2);
	eAttr.addField("-X", 3);
	eAttr.addField("-Y", 4);
	eAttr.addField("-Z", 5);
	eAttr.setDefault(1);
	eAttr.setKeyable(true);
	eAttr.setStorable(true);
	eAttr.setWritable(true);

	aSeamAxis = eAttr.create("seamAxis", "seamAxis", 0, &status);
	CHECK_MSTATUS_AND_RETURN_IT(status);
	eAttr.addField("+X", 0);
	eAttr.addField("+Y", 1);
	eAttr.addField("+Z", 2);
	eAttr.addField("-X", 3);
	eAttr.addField("-Y", 4);
	eAttr.addField("-Z", 5);
	eAttr.setDefault(0);
	eAttr.setKeyable(true);
	eAttr.setStorable(true);
	eAttr.setWritable(true);

	addAttribute(aSpaceMatrix);
	addAttribute(aPoleAxis);
	addAttribute(aSeamAxis);

	return MS::kSuccess;
}
开发者ID:spohle,项目名称:mayaDev,代码行数:43,代码来源:sphericalBlendShapeVisualizeNode.cpp

示例14: initialize

// INIT =========================================
MStatus gear_curveCns::initialize()
{
	MFnMatrixAttribute mAttr;
	MStatus stat;

	// INPUTS
	inputs = mAttr.create( "inputs", "inputs" );
	mAttr.setStorable(true);
    mAttr.setReadable(false);
    mAttr.setIndexMatters(false);
    mAttr.setArray(true);
	stat = addAttribute( inputs );
		if (!stat) {stat.perror("addAttribute"); return stat;}
		
	// CONNECTIONS
	stat = attributeAffects( inputs, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}

    return MS::kSuccess;
}
开发者ID:AtonLerin,项目名称:mgear,代码行数:21,代码来源:curveCns.cpp

示例15: initialize

MStatus SurfaceAttach::initialize() {
    MFnTypedAttribute fnTypeAttr;
    MFnNumericAttribute fnNumAttr;
    MFnUnitAttribute fnUnitAttr;
    MFnCompoundAttribute fnCompoundAttr;
    MFnEnumAttribute fnEnumAttr;
    MFnMatrixAttribute fnMatAttr;

    MStatus stat;

    // Input Attributes
    direction = fnEnumAttr.create("direction", "dire", 0);
    fnEnumAttr.addField("U", 0);
    fnEnumAttr.addField("V", 1);

    surface = fnTypeAttr.create("surface", "surface", MFnData::kNurbsSurface);

    parentInverse = fnMatAttr.create("parentInverse", "ps", MFnMatrixAttribute::kDouble);
    fnMatAttr.setKeyable(true);

    samples = fnNumAttr.create("samples", "samples", MFnNumericData::kInt, 1000);
    fnNumAttr.setKeyable(true);
    fnNumAttr.setMin(1.0);

    staticLength = fnNumAttr.create("staticLength", "staticLength", MFnNumericData::kDouble, 0.0001);
    fnNumAttr.setKeyable(true);
    fnNumAttr.setMin(0.0001);

    offset = fnNumAttr.create("offset", "offset", MFnNumericData::kDouble, 0.0);
    fnNumAttr.setKeyable(true);

    genus = fnEnumAttr.create("type", "type", 0);
    fnEnumAttr.addField("Parametric", 0);

    fnEnumAttr.addField("Percentage", 1);
    fnEnumAttr.addField("FixedLength", 2);
    fnEnumAttr.setKeyable(true);

    reverse = fnNumAttr.create("reverse", "reverse", MFnNumericData::kBoolean, false);
    fnNumAttr.setKeyable(true);

    inU = fnNumAttr.create("inU", "U", MFnNumericData::kDouble, 0.5);
    fnNumAttr.setKeyable(true);

    inV = fnNumAttr.create("inV", "V", MFnNumericData::kDouble, 0.5);
    fnNumAttr.setKeyable(true);

    inUV = fnCompoundAttr.create("inUV", "inUV");
    fnCompoundAttr.setKeyable(true);
    fnCompoundAttr.setArray(true);
    fnCompoundAttr.addChild(inU);
    fnCompoundAttr.addChild(inV);
    fnCompoundAttr.setUsesArrayDataBuilder(true);

    // Output Attributes
    translateX = fnNumAttr.create("translateX", "translateX", MFnNumericData::kDouble);
    fnNumAttr.setWritable(false);
    fnNumAttr.setStorable(false);

    translateY = fnNumAttr.create("translateY", "translateY", MFnNumericData::kDouble);
    fnNumAttr.setWritable(false);
    fnNumAttr.setStorable(false);

    translateZ = fnNumAttr.create("translateZ", "translateZ", MFnNumericData::kDouble);
    fnNumAttr.setWritable(false);
    fnNumAttr.setStorable(false);

    translate = fnNumAttr.create("translate", "translate", translateX, translateY, translateZ);
    fnNumAttr.setWritable(false);
    fnNumAttr.setStorable(false);

    rotateX = fnUnitAttr.create("rotateX", "rotateX", MFnUnitAttribute::kAngle);
    fnUnitAttr.setWritable(false);
    fnUnitAttr.setStorable(false);

    rotateY = fnUnitAttr.create("rotateY", "rotateY", MFnUnitAttribute::kAngle);
    fnUnitAttr.setWritable(false);
    fnUnitAttr.setStorable(false);

    rotateZ = fnUnitAttr.create("rotateZ", "rotateZ", MFnUnitAttribute::kAngle);
    fnUnitAttr.setWritable(false);
    fnUnitAttr.setStorable(false);

    rotate = fnNumAttr.create("rotate", "rotate", rotateX, rotateY, rotateZ);
    fnNumAttr.setWritable(false);

    out = fnCompoundAttr.create("out", "out");
    fnCompoundAttr.setWritable(false);
    fnCompoundAttr.setArray(true);
    fnCompoundAttr.addChild(translate);
    fnCompoundAttr.addChild(rotate);
    fnCompoundAttr.setUsesArrayDataBuilder(true);

    // These aren't going to fail, give me a break :)
    // Add Attributes
    SurfaceAttach::addAttribute(direction);
    SurfaceAttach::addAttribute(surface);
    SurfaceAttach::addAttribute(parentInverse);
    SurfaceAttach::addAttribute(samples);
    SurfaceAttach::addAttribute(staticLength);
//.........这里部分代码省略.........
开发者ID:illmillrig,项目名称:SurfaceAttach,代码行数:101,代码来源:SurfaceAttach.cpp


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