コード例 #1
0
//*********************************************************
// Name: isBooleanDataType
// Desc: 
//*********************************************************
bool BreakdownCommand::isBooleanDataType( const MPlug &connection )
{
    MFnNumericAttribute fnNumAttr;
    MObject attrObj;

    bool isBool = false;

    attrObj = connection.attribute( &status );
    if( attrObj.apiType() == MFn::kNumericAttribute ) {

        status = fnNumAttr.setObject( attrObj );
        if( fnNumAttr.unitType() == MFnNumericData::kBoolean )
            isBool = true;
    }

    return isBool;
}