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


C++ MFnMatrixAttribute类代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: addAttribute

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 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

示例6: 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

示例7: 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

示例8: 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

示例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 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

示例11: 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

示例12: 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

示例13: addAttribute

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

示例14: initialize

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

示例15: CHECK_MSTATUS_AND_RETURN_IT

MStatus sphericalBlendShape::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);

	aWarpMatrix = mAttr.create("warpMatrix", "warpMatrix", MFnMatrixAttribute::kDouble, &status);
	CHECK_MSTATUS_AND_RETURN_IT(status);

	aMethod = eAttr.create("conversionMethod", "conversionMethod", 0, &status);
	CHECK_MSTATUS_AND_RETURN_IT(status);
	eAttr.addField("xyzToSpherical", 0);
	eAttr.addField("sphericalToXyz", 1);
	eAttr.setDefault(0);
	eAttr.setKeyable(true);
	eAttr.setStorable(true);
	eAttr.setWritable(true);

	addAttribute(aSpaceMatrix);
	addAttribute(aPoleAxis);
	addAttribute(aSeamAxis);
	addAttribute(aWarpMatrix);
	addAttribute(aMethod);

	attributeAffects(aSpaceMatrix, outputGeom);
	attributeAffects(aPoleAxis, outputGeom);
	attributeAffects(aSeamAxis, outputGeom);
	attributeAffects(aWarpMatrix, outputGeom);
	attributeAffects(aMethod, outputGeom);

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


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