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


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

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


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

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

示例2: addAttribute

// INIT =========================================
MStatus gear_slideCurve2::initialize()
{
	MFnTypedAttribute tAttr;
	MFnMatrixAttribute mAttr;
	MFnNumericAttribute nAttr;
	MStatus stat;

	// INPUTS MESH
	
    master_crv = tAttr.create("master_crv", "mcrv", MFnData::kNurbsCurve);
    stat = addAttribute( master_crv );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	master_mat = mAttr.create( "master_mat", "mmat" );
	mAttr.setStorable(true);
    mAttr.setReadable(false);
	stat = addAttribute( master_mat );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	// SLIDERS
	slave_length = nAttr.create("slave_length", "sl", MFnNumericData::kFloat, 1);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
    stat = addAttribute( slave_length );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	master_length = nAttr.create("master_length", "ml", MFnNumericData::kFloat, 1);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
    stat = addAttribute( master_length );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	position = nAttr.create("position", "p", MFnNumericData::kFloat, 0.0);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(0);
	nAttr.setMax(1);
    stat = addAttribute( position );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	maxstretch = nAttr.create("maxstretch", "mst", MFnNumericData::kFloat, 1.5);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(1);
    stat = addAttribute( maxstretch );
		if (!stat) {stat.perror("addAttribute"); return stat;}
		
	maxsquash = nAttr.create("maxsquash", "msq", MFnNumericData::kFloat, .5);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(0);
	nAttr.setMax(1);
    stat = addAttribute( maxsquash );
		if (!stat) {stat.perror("addAttribute"); return stat;}
		
	softness = nAttr.create("softness", "s", MFnNumericData::kFloat, 0.5);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(0);
	nAttr.setMax(1);
    stat = addAttribute( softness );
		if (!stat) {stat.perror("addAttribute"); return stat;}
		
	// CONNECTIONS
	stat = attributeAffects( master_crv, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}
	stat = attributeAffects( master_mat, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}

	stat = attributeAffects( master_length, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}
	stat = attributeAffects( slave_length, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}
	stat = attributeAffects( position, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}
	stat = attributeAffects( maxstretch, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}
	stat = attributeAffects( maxsquash, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}
	stat = attributeAffects( softness, outputGeom );
		if (!stat) { stat.perror("attributeAffects"); return stat;}

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

示例3: initialize

MStatus curveColliderLocator::initialize()
{ 
	MFnNumericAttribute nAttr;
	MStatus				stat;
	
	colliderRadiusIn = nAttr.create( "radius", "rd", MFnNumericData::kDouble );
	nAttr.setDefault(1.0);
	nAttr.setMin(0);
	nAttr.setKeyable(true);
	nAttr.setArray(true);
	nAttr.setStorable(true);
	nAttr.setWritable(true);
	
	stat = addAttribute(colliderRadiusIn);
	if (!stat) {
		stat.perror("Could not add colliderRadiusIn attribute");
		return stat;
	}
	
	// CREATE AND ADD ".inCurve" ATTRIBUTE:
	
	MFnTypedAttribute inCurveAttrFn;
	colliderCurveIn = inCurveAttrFn.create("colliderCurve", "ic", MFnData::kNurbsCurve);
	inCurveAttrFn.setStorable(true);
	inCurveAttrFn.setKeyable(false);
	inCurveAttrFn.setReadable(true);
	inCurveAttrFn.setWritable(true);
	inCurveAttrFn.setCached(false);

	stat = addAttribute(colliderCurveIn);
	if (!stat) {
		stat.perror("Could not add colliderCurveIn attribute");
		return stat;
	}
	
	MFnMatrixAttribute mAttr;
	colliderXform =mAttr.create("colliderXfm", "cx");
	mAttr.setReadable(false); 
	mAttr.setKeyable(false); 
	mAttr.setConnectable(true);
	stat = addAttribute( colliderXform ); 
	if (!stat) {
		stat.perror("Could not add colliderXform attribute");
		return stat;
	}
	
	colliderColorR = nAttr.create( "colorR", "clr", MFnNumericData::kFloat );
	nAttr.setDefault(0.2f);
	nAttr.setMin(0.0f);
	nAttr.setMax(1.0f);
	nAttr.setKeyable(true);
	nAttr.setStorable(true);
	nAttr.setReadable(true);
	nAttr.setWritable(true);
	stat = addAttribute(colliderColorR);
	if (!stat) {
		stat.perror("Could not add colliderColorR attribute");
		return stat;
	}
	
	colliderColorG = nAttr.create( "colorG", "clg", MFnNumericData::kFloat );
	nAttr.setDefault(0.2f);
	nAttr.setMin(0.0f);
	nAttr.setMax(1.0f);
	nAttr.setKeyable(true);
	nAttr.setStorable(true);
	nAttr.setReadable(true);
	nAttr.setWritable(true);
	stat = addAttribute(colliderColorG);
	if (!stat) {
		stat.perror("Could not add colliderColorG attribute");
		return stat;
	}

	colliderColorB = nAttr.create( "colorB", "clb", MFnNumericData::kFloat );
	nAttr.setDefault(0.8f);
	nAttr.setMin(0.0f);
	nAttr.setMax(1.0f);
	nAttr.setKeyable(true);
	nAttr.setStorable(true);
	nAttr.setReadable(true);
	nAttr.setWritable(true);
	stat = addAttribute(colliderColorB);
	if (!stat) {
		stat.perror("Could not add colliderColorB attribute");
		return stat;
	}
	
	colliderTransparency = nAttr.create( "colorT", "clt", MFnNumericData::kFloat );
	nAttr.setDefault(1.0f);
	nAttr.setMin(0.0f);
	nAttr.setMax(1.0f);
	nAttr.setKeyable(true);
	nAttr.setStorable(true);
	nAttr.setReadable(true);
	nAttr.setWritable(true);
	stat = addAttribute(colliderTransparency);
	if (!stat) {
		stat.perror("Could not add colliderTransparency attribute");
		return stat;
//.........这里部分代码省略.........
开发者ID:UIKit0,项目名称:stretchmesh,代码行数:101,代码来源:curveColliderLocator.cpp

示例4: initialize

// INIT =========================================
MStatus gear_rollSplineKine::initialize()
{
	MFnMatrixAttribute mAttr;
	MFnNumericAttribute nAttr;
	MStatus stat;
	
    // Inputs Matrices
    ctlParent = mAttr.create( "ctlParent", "ctlp", MFnMatrixAttribute::kDouble );
    mAttr.setStorable(true);
    mAttr.setReadable(false);
    mAttr.setIndexMatters(false);
    mAttr.setArray(true);
    addAttribute( ctlParent );
	
    inputs = mAttr.create( "inputs", "in", MFnMatrixAttribute::kDouble );
    mAttr.setStorable(true);
    mAttr.setReadable(false);
    mAttr.setIndexMatters(false);
    mAttr.setArray(true);
    addAttribute( inputs );

    inputsRoll = nAttr.create ( "inputsRoll", "inr", MFnNumericData::kFloat, 0.0 );
    nAttr.setArray(true);
    nAttr.setStorable(true);
    addAttribute ( inputsRoll );
	
	outputParent = mAttr.create( "outputParent", "outp" );
	mAttr.setStorable(true);
	mAttr.setKeyable(true);
	mAttr.setConnectable(true);
	stat = addAttribute( outputParent );
		if (!stat) {stat.perror("addAttribute"); return stat;}

    // Inputs Sliders
	u = nAttr.create("u", "u", MFnNumericData::kFloat, 0.0);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(0);
	nAttr.setMax(1);
    stat = addAttribute( u );
		if (!stat) {stat.perror("addAttribute"); return stat;}
		
	resample = nAttr.create("resample", "re", MFnNumericData::kBoolean, false);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
    stat = addAttribute( resample );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	subdiv = nAttr.create("subdiv", "sd", MFnNumericData::kShort, 10);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(3);
    stat = addAttribute( subdiv );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	absolute = nAttr.create("absolute", "abs", MFnNumericData::kBoolean, false);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
    stat = addAttribute( absolute );
		if (!stat) {stat.perror("addAttribute"); return stat;}

    // Outputs
	output = mAttr.create( "output", "out" );
	mAttr.setStorable(false);
	mAttr.setKeyable(false);
	mAttr.setConnectable(true);
	stat = addAttribute( output );
		if (!stat) {stat.perror("addAttribute"); return stat;}

	// Connections
    stat = attributeAffects ( ctlParent, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
    stat = attributeAffects ( inputs, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
    stat = attributeAffects ( inputsRoll, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
    stat = attributeAffects ( outputParent, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
		
    stat = attributeAffects ( u, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
    stat = attributeAffects ( resample, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
    stat = attributeAffects ( subdiv, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
    stat = attributeAffects ( absolute, output );
		if (!stat) {stat.perror("attributeAffects"); return stat;}
		
   return MS::kSuccess;
}
开发者ID:AtonLerin,项目名称:mgear,代码行数:91,代码来源:rollSplineKine.cpp


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