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


C++ MFnMessageAttribute::setConnectable方法代码示例

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


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

示例1: initialize

MStatus mtmEnvLight::initialize()
{
    MFnTypedAttribute tAttr; 
    MFnNumericAttribute nAttr; 
    MFnLightDataAttribute lAttr;
	MFnEnumAttribute eAttr;
	MFnMessageAttribute mAttr;
	MStatus stat;

    //aColor = nAttr.createColor( "color", "c" );
    //CHECK_MSTATUS ( nAttr.setKeyable(true) );
    //CHECK_MSTATUS ( nAttr.setStorable(true) );
    //CHECK_MSTATUS ( nAttr.setDefault(0.0f, 0.58824f, 0.644f) );

    aLightColor = nAttr.createColor( "lightColor", "lightColor" );
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    nAttr.setDefault(0.7f, 0.58824f, 0.344f);

	aShadowColor = nAttr.createColor( "shadowColor", "sc" );
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    CHECK_MSTATUS ( nAttr.setDefault(0.0f, 0.0f, 0.0f) );

    aPosition = nAttr.createPoint( "position", "pos" );
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );

    aInputDirection = nAttr.createPoint( "inputDirection", "id" );
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    CHECK_MSTATUS ( nAttr.setDefault(-1.0f, 0.0f, 0.0f) );

    aInputAmbient = nAttr.create( "ambientOn", "an", MFnNumericData::kBoolean);
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    CHECK_MSTATUS ( nAttr.setHidden(false) );
    CHECK_MSTATUS ( nAttr.setDefault(true) );

    aInputDiffuse = nAttr.create( "emitDiffuse", "dn", MFnNumericData::kBoolean);
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    CHECK_MSTATUS ( nAttr.setHidden(false) );
    CHECK_MSTATUS ( nAttr.setDefault(true) );

    aInputSpecular = nAttr.create( "emitSpecular", "sn", MFnNumericData::kBoolean);
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    CHECK_MSTATUS ( nAttr.setHidden(false) );
    CHECK_MSTATUS ( nAttr.setDefault(true) );

    aIntensity = nAttr.create( "intensity", "i", MFnNumericData::kFloat);
    CHECK_MSTATUS ( nAttr.setKeyable(true) );
    CHECK_MSTATUS ( nAttr.setStorable(true) );
    CHECK_MSTATUS ( nAttr.setHidden(false) );
    CHECK_MSTATUS ( nAttr.setDefault(1.0f) );

	samplingquality = nAttr.create( "samplingquality", "samplingquality", MFnNumericData::kFloat, 1.0);
	envmap = tAttr.create( "envmap", "envmap", MFnNumericData::kString);
	tAttr.setUsedAsFilename(true);
	areamap = tAttr.create( "areamap", "areamap", MFnNumericData::kString);
	tAttr.setUsedAsFilename(true);
	areafullsphere = nAttr.create( "areafullsphere", "areafullsphere", MFnNumericData::kBoolean, true);
	envintensity = nAttr.createColor( "envintensity", "envintensity" );
	nAttr.setDefault(1.0f, 1.0f, 1.0f);
	raybackground = nAttr.create( "raybackground", "raybackground", MFnNumericData::kBoolean, false);
	castshadow = nAttr.create( "castshadow", "castshadow", MFnNumericData::kBoolean, true);
	envtype = eAttr.create( "envtype", "envtype", 0, &stat);
	stat = eAttr.addField( "Direct Lighting", 0 );
	stat = eAttr.addField( "Ambient Occlusion", 1 );
	stat = eAttr.addField( "Full Irradiance", 2 );
	stat = eAttr.addField( "Raytrace Background", 3 );
	eAttr.setDefault(0);		
	doraysamples = nAttr.create( "doraysamples", "doraysamples", MFnNumericData::kBoolean, false);
	doadaptive = nAttr.create( "doadaptive", "doadaptive", MFnNumericData::kBoolean, false);
	domaxdist = nAttr.create( "domaxdist", "domaxdist", MFnNumericData::kBoolean, false);
	maxdist = nAttr.create( "maxdist", "maxdist", MFnNumericData::kFloat, 10.0);
	coneangle = nAttr.create( "coneangle", "coneangle", MFnNumericData::kFloat, 45.0);
	envtint = nAttr.createColor( "envtint", "envtint" );
	nAttr.setDefault(1.0f, 1.0f, 1.0f);
	shadowI = nAttr.create( "shadowI", "shadowI", MFnNumericData::kFloat, 1.0);
	samples = nAttr.create( "samples", "samples", MFnNumericData::kInt, 32);
	MFnStringData fnStringData;
	MObject defaultObjectMask;
	defaultObjectMask = fnStringData.create( "*" );
	objectmask = tAttr.create( "objectmask", "objectmask", MFnNumericData::kString, defaultObjectMask);
	usePortalGeometry = nAttr.create( "usePortalGeometry", "usePortalGeometry", MFnNumericData::kBoolean, false);
	portalGeometry = mAttr.create( "portalGeometry", "portalGeometry");
	mAttr.setConnectable(true);
	mAttr.accepts(MFnData::kAny);
	
// Outputs

    aLightDirection = nAttr.createPoint( "lightDirection", "ld" );
    CHECK_MSTATUS ( nAttr.setStorable(false) );
    CHECK_MSTATUS ( nAttr.setHidden(true) );
    CHECK_MSTATUS ( nAttr.setReadable(true) );
    CHECK_MSTATUS ( nAttr.setWritable(false) );
    CHECK_MSTATUS ( nAttr.setDefault(-1.0f, 0.0f, 0.0f) );

//.........这里部分代码省略.........
开发者ID:MassW,项目名称:OpenMaya,代码行数:101,代码来源:mtm_envlight.cpp


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