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


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

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


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

示例1: initialize


//.........这里部分代码省略.........
	// Only add the parent of the compound
	CHECK_MSTATUS( addAttribute( aLightData ) );

	// The attributeAffects() method is used to indicate when the input
	// attribute affects the output attribute. This knowledge allows Maya
	// to optimize dependencies in the graph in more complex nodes where
	// there may be several inputs and outputs, but not all the inputs
	// affect all the outputs.
	//
	CHECK_MSTATUS( attributeAffects( aTranslucenceCoeff, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aDiffuseReflectivity, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aColorR, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aColorG, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aColorB, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aColor, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aInTransR, aOutTransparency ) );
	CHECK_MSTATUS( attributeAffects( aInTransG, aOutTransparency ) );
	CHECK_MSTATUS( attributeAffects( aInTransB, aOutTransparency ) );
	CHECK_MSTATUS( attributeAffects( aInTransparency, aOutTransparency ) );
	CHECK_MSTATUS( attributeAffects( aInTransparency, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aIncandescenceR, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aIncandescenceG, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aIncandescenceB, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aIncandescence, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightIntensityR, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightIntensityB, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightIntensityG, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightIntensity, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aNormalCameraX, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aNormalCameraY, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aNormalCameraZ, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aNormalCamera, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightDirectionX, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightDirectionY, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightDirectionZ, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightDirection, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightAmbient, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightSpecular, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightDiffuse, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightShadowFraction, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aPreShadowIntensity, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightBlindData, aOutColor ) );
	CHECK_MSTATUS( attributeAffects( aLightData, aOutColor ) );

	// loading x-ray part
	xrDoubleSide  = nAttr.create( "xrayDoubleSide", "xrd",  MFnNumericData::kBoolean, 0, &status );
	MAKE_INPUT(nAttr);

	LPSTRVec lst;
	LPSTRIt it;

	xrEngineData = eAttr.create( "xrayEngineShader", "xre");
	MAKE_INPUT(eAttr);
	LoadBlenderList(lst);
	for (it=lst.begin(); it!=lst.end(); it++)
	{
		_ChangeSymbol(*it,'\\','/');
		CHECK_MSTATUS (eAttr.addField(*it,crc16_calc((u8*)*it,xr_strlen(*it))));
	}
#if MAYA_API_VERSION > 450
	CHECK_MSTATUS ( eAttr.setDefault(eAttr.fieldIndex("default")));
#else	
#endif
	ClearList(lst);

	xrCompilerData = eAttr.create( "xrayCompilerShader", "xrc");
	MAKE_INPUT(eAttr);
	LoadShaderLCList(lst);
	for (it=lst.begin(); it!=lst.end(); it++){
		_ChangeSymbol(*it,'\\','/');
		CHECK_MSTATUS (eAttr.addField(*it,crc16_calc((u8*)*it,xr_strlen(*it))));
	}
#if MAYA_API_VERSION > 450
	CHECK_MSTATUS ( eAttr.setDefault(eAttr.fieldIndex("default")));
#else	
#endif
	ClearList(lst);

	xrMaterialData = eAttr.create( "xrayGameMaterial", " ");
	MAKE_INPUT(eAttr);
	LoadGameMtlList(lst);
	for (it=lst.begin(); it!=lst.end(); it++)
	{
		_ChangeSymbol(*it,'\\','/');
		CHECK_MSTATUS (eAttr.addField(*it,crc16_calc((u8*)*it,xr_strlen(*it))));
	}
#if MAYA_API_VERSION > 450
	CHECK_MSTATUS ( eAttr.setDefault(eAttr.fieldIndex("default")));
#else	
#endif
	ClearList(lst);

	CHECK_MSTATUS ( addAttribute(xrDoubleSide) );
	CHECK_MSTATUS ( addAttribute(xrEngineData) );
	CHECK_MSTATUS ( addAttribute(xrCompilerData) );
	CHECK_MSTATUS ( addAttribute(xrMaterialData) );
	// end x-ray part

	return( MS::kSuccess );
}
开发者ID:2asoft,项目名称:xray,代码行数:101,代码来源:lambertShader.cpp


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