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


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

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


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

示例1: initialize

MStatus mpBox::initialize()
{

    MFnNumericAttribute nAttr;
    MFnEnumAttribute enumAttr;
    // add the custom attributes for mpBox  //
    _COMMON_ATTR_INIT_;
    aXsize = nAttr.create( "xsize", "xsz", MFnNumericData::kFloat);
    nAttr.setDefault(0.5f);
    nAttr.setKeyable(1);
    nAttr.setReadable(1);
    nAttr.setWritable(1);
    nAttr.setStorable(1);

    aYsize = nAttr.create( "ysize", "ysz", MFnNumericData::kFloat);
    nAttr.setDefault(0.5f);
    nAttr.setKeyable(1);
    nAttr.setReadable(1);
    nAttr.setWritable(1);
    nAttr.setStorable(1);

    aZsize = nAttr.create( "zsize", "zsz", MFnNumericData::kFloat);
    nAttr.setDefault(0.5f);
    nAttr.setKeyable(1);
    nAttr.setReadable(1);
    nAttr.setWritable(1);
    nAttr.setStorable(1);

    aDrawType = enumAttr.create( "drawType" , "dt");
    enumAttr.addField("wireframe", 0);
    enumAttr.addField("shaded", 1);
    enumAttr.addField("normal", 2);
    enumAttr.setHidden(false);
    enumAttr.setKeyable(true);
    enumAttr.setDefault(2);

    addAttribute(aXsize);
    addAttribute(aYsize);
    addAttribute(aZsize);
    addAttribute(aDrawType);

    return MS::kSuccess;
}
开发者ID:scroll,项目名称:mpLocators.c,代码行数:43,代码来源:mpBox.cpp

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

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

示例4: initialize

MStatus VmIslandNode::initialize()
{
    fprintf( stderr, "VmIslandNode::initialize()...\n" );
    
    MStatus status;
    
    //Seed attribute
    {
        MFnNumericAttribute numericAttrFn;
        ia_seed = numericAttrFn.create( "seed", "sD", MFnNumericData::kLong, 0, & status );
        CHECK_MSTATUS( status );
        numericAttrFn.setReadable( true );
        numericAttrFn.setWritable( true );
        numericAttrFn.setStorable( true );
        numericAttrFn.setKeyable( true );
        numericAttrFn.setConnectable( true );
        numericAttrFn.setHidden( false );
        numericAttrFn.setMin( 0 );
        numericAttrFn.setMax( 1000 );
        numericAttrFn.setDefault ( 0 );
        status = addAttribute( ia_seed );
        CHECK_MSTATUS( status );
    }
    
    //Roughness attribute
    {
        MFnNumericAttribute numericAttrFn;
        ia_roughness = numericAttrFn.create( "roughness", "rG", MFnNumericData::kFloat, 0, & status );
        CHECK_MSTATUS( status );
        numericAttrFn.setReadable( true );
        numericAttrFn.setWritable( true );
        numericAttrFn.setStorable( true );
        numericAttrFn.setKeyable( true );
        numericAttrFn.setConnectable( true );
        numericAttrFn.setHidden( false );
        numericAttrFn.setMin( 0 );
        numericAttrFn.setMax( 1 );
        numericAttrFn.setDefault ( 0.75 );
        status = addAttribute( ia_roughness );
        CHECK_MSTATUS( status );
    }
    
    //Plane Height attribute
    {
        MFnNumericAttribute numericAttrFn;
        ia_planeHeight = numericAttrFn.create( "planeHeight", "pH", MFnNumericData::kLong, 0, & status );
        CHECK_MSTATUS( status );
        numericAttrFn.setReadable( true );
        numericAttrFn.setWritable( true );
        numericAttrFn.setStorable( true );
        numericAttrFn.setKeyable( true );
        numericAttrFn.setConnectable( true );
        numericAttrFn.setHidden( false );
        numericAttrFn.setMin( 0 );
        numericAttrFn.setMax( 2000 );
        numericAttrFn.setDefault ( 5 );
        status = addAttribute( ia_planeHeight );
        CHECK_MSTATUS( status );
    }

     //Plane smoothing attribute
    {
        MFnNumericAttribute numericAttrFn;
        ia_smooth = numericAttrFn.create( "smoothingStrength", "sS", MFnNumericData::kLong, 0, & status );
        CHECK_MSTATUS( status );
        numericAttrFn.setReadable( true );
        numericAttrFn.setWritable( true );
        numericAttrFn.setStorable( true );
        numericAttrFn.setKeyable( true );
        numericAttrFn.setConnectable( true );
        numericAttrFn.setHidden( false );
        numericAttrFn.setMin( 0 );
        numericAttrFn.setMax( 6 );
        numericAttrFn.setDefault ( 1 );
        status = addAttribute( ia_smooth );
        CHECK_MSTATUS( status );
    }
    
     //Plane resolution attribute
    {
        MFnNumericAttribute numericAttrFn;
        ia_resolution = numericAttrFn.create( "mayaResolution", "mR", MFnNumericData::kLong, 0, & status );
        CHECK_MSTATUS( status );
        numericAttrFn.setReadable( true );
        numericAttrFn.setWritable( true );
        numericAttrFn.setStorable( true );
        numericAttrFn.setKeyable( true );
        numericAttrFn.setConnectable( true );
        numericAttrFn.setHidden( false );
        numericAttrFn.setMin( 1 );
        numericAttrFn.setMax( 10 );
        numericAttrFn.setDefault ( 1 );
        status = addAttribute( ia_resolution );
        CHECK_MSTATUS( status );
    }

    //Renderman resolution attribute
    {
        MFnNumericAttribute numericAttrFn;
        ia_rmanResolution = numericAttrFn.create( "rendermanResolution", "rR", MFnNumericData::kLong, 0, & status );
//.........这里部分代码省略.........
开发者ID:Mystfit,项目名称:VIslandsGrass,代码行数:101,代码来源:VmIslandNode.cpp

示例5: initialize

MStatus meshOpNode::initialize()
//
//	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				status;

	MFnTypedAttribute attrFn;
	MFnEnumAttribute enumFn;

	cpList = attrFn.create("inputComponents", "ics",
		MFnComponentListData::kComponentList);
	attrFn.setStorable(true);	// To be stored during file-save

	opType = enumFn.create("operationType", "oprt", 0, &status);
	enumFn.addField("subd_edges", 0);
	enumFn.addField("subd_faces", 1);
	enumFn.setHidden(false);
	enumFn.setKeyable(true);
	enumFn.setStorable(true);	// To be stored during file-save

	inMesh = attrFn.create("inMesh", "im", MFnMeshData::kMesh);
	attrFn.setStorable(true);	// To be stored during file-save

	// Attribute is read-only because it is an output attribute
	//
	outMesh = attrFn.create("outMesh", "om", MFnMeshData::kMesh);
	attrFn.setStorable(false);
	attrFn.setWritable(false);

	// Add the attributes we have created to the node
	//
	status = addAttribute( cpList );
		if (!status)
		{
			status.perror("addAttribute");
			return status;
		}
	status = addAttribute( opType );
		if (!status)
		{
			status.perror("addAttribute");
			return status;
		}
	status = addAttribute( inMesh );
		if (!status)
		{
			status.perror("addAttribute");
			return status;
		}
	status = addAttribute( outMesh);
		if (!status)
		{
			status.perror("addAttribute");
			return status;
		}

	// Set up a dependency between the input and the output.  This will cause
	// the output to be marked dirty when the input changes.  The output will
	// then be recomputed the next time the value of the output is requested.
	//
	status = attributeAffects( inMesh, outMesh );
		if (!status)
		{
			status.perror("attributeAffects");
			return status;
		}

	status = attributeAffects( cpList, outMesh );
		if (!status)
		{
			status.perror("attributeAffects");
			return status;
		}

	status = attributeAffects( opType, outMesh );
		if (!status)
		{
			status.perror("attributeAffects");
			return status;
		}

	return MS::kSuccess;

}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:92,代码来源:meshOpNode.cpp

示例6: initialize

MStatus NuiMayaDeviceGrabber::initialize()
//
//	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
//
{
	// This sample creates a single input float attribute and a single
	// output float attribute.
	//
	MFnNumericAttribute nAttr;
	MFnTypedAttribute	typedAttr;
	MFnUnitAttribute	unitAttr;
	MFnEnumAttribute	enumAttr;
	MStatus				stat;

	aTime = unitAttr.create( "time", "tm",
		MFnUnitAttribute::kTime,
		0.0, &stat );
	stat = addAttribute( aTime );
	if (!stat) { stat.perror("addAttribute time"); return stat;}

	aUseCache = nAttr.create( "useCache", "uc", MFnNumericData::kBoolean, false );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
	// Attribute is keyable and will show up in the channel box
	stat = addAttribute( aUseCache );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aDeviceOn = nAttr.create( "deviceOn", "do", MFnNumericData::kBoolean, false );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
	// Attribute is keyable and will show up in the channel box
	stat = addAttribute( aDeviceOn );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aDeviceMode = enumAttr.create( "deviceMode", "dm", NuiRGBDDeviceController::EDeviceMode_VertexColorCamera, &stat );
	if (!stat) { stat.perror("create DeviceMode attribute"); return stat;}
	stat = enumAttr.addField( "Depth,Color", NuiRGBDDeviceController::EDeviceMode_DepthColor );
	if (!stat) { stat.perror("add enum type DepthColor"); return stat;}
	stat = enumAttr.addField( "Depth,Color,Player", NuiRGBDDeviceController::EDeviceMode_VertexColorCamera );
	if (!stat) { stat.perror("add enum type DepthColorPlayer"); return stat;}
	stat = enumAttr.addField( "Depth,Color,Skeleton", NuiRGBDDeviceController::EDeviceMode_VertexColorSkeleton );
	if (!stat) { stat.perror("add enum type DepthColorSkeleton"); return stat;}
	stat = enumAttr.addField( "Depth,Color,Skeleton,Face", NuiRGBDDeviceController::EDeviceMode_VertexColorSkeletonFace );
	if (!stat) { stat.perror("add enum type DepthColorSkeletonFace"); return stat;}
	stat = enumAttr.addField( "Depth,Color,Skeleton,Gesture", NuiRGBDDeviceController::EDeviceMode_VertexColorSkeletonGesture );
	if (!stat) { stat.perror("add enum type DepthColorSkeletonGesture"); return stat;}
	stat = enumAttr.addField( "Color", NuiRGBDDeviceController::EDeviceMode_Color );
	if (!stat) { stat.perror("add enum type Color"); return stat;}
	stat = enumAttr.addField( "Depth", NuiRGBDDeviceController::EDeviceMode_Vertex );
	if (!stat) { stat.perror("add enum type Depth"); return stat;}
	stat = enumAttr.addField( "Skeleton", NuiRGBDDeviceController::EDeviceMode_Skeleton );
	if (!stat) { stat.perror("add enum type Skeleton"); return stat;}
	stat = enumAttr.addField( "Fusion", NuiRGBDDeviceController::EDeviceMode_Fusion );
	if (!stat) { stat.perror("add enum type fusion"); return stat;}
	CHECK_MSTATUS( enumAttr.setHidden( false ) );
	CHECK_MSTATUS( enumAttr.setKeyable( false ) );
	stat = addAttribute( aDeviceMode );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aNearMode = nAttr.create( "nearMode", "ne", MFnNumericData::kBoolean, false );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
	// Attribute is keyable and will show up in the channel box
	stat = addAttribute( aNearMode );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aElevationAngle = nAttr.create( "elevationAngle", "ea", MFnNumericData::kInt, 0 );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setMin(-27);
	nAttr.setMax(27);
	// Attribute is keyable and will show up in the channel box
	stat = addAttribute( aElevationAngle );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aPreviewerOn = nAttr.create( "previewerOn", "po", MFnNumericData::kBoolean, false );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
	// Attribute is keyable and will show up in the channel box
	stat = addAttribute( aPreviewerOn );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aKinFuOn = nAttr.create( "fusionOn", "fo", MFnNumericData::kBoolean, false );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
	// Attribute is keyable and will show up in the channel box
	stat = addAttribute( aKinFuOn );
	if (!stat) { stat.perror("addAttribute"); return stat;}

	aVolumeVoxelSize = nAttr.create( "volumeVoxelSize", "vvs", MFnNumericData::kFloat, 0.01f );
	// Attribute will be written to files when this type of node is stored
	nAttr.setStorable(true);
//.........这里部分代码省略.........
开发者ID:hustztz,项目名称:NatureUserInterfaceStudio,代码行数:101,代码来源:NuiMayaDeviceGrabber.cpp


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