本文整理汇总了C++中MFnDependencyNode::typeId方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnDependencyNode::typeId方法的具体用法?C++ MFnDependencyNode::typeId怎么用?C++ MFnDependencyNode::typeId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnDependencyNode
的用法示例。
在下文中一共展示了MFnDependencyNode::typeId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exportCustomHwShaderNode
//---------------------------------------
void MaterialExporter::exportCustomHwShaderNode(
COLLADASW::InstanceEffect &effectInstance,
MObject shader )
{
MFnDependencyNode fnNode ( shader );
if ( fnNode.typeId() == cgfxShaderNode::sId )
{
// Add the technique hint and the effect attributes to the collada document.
exportCgfxShaderNode ( effectInstance, (cgfxShaderNode*) fnNode.userNode () );
}
}
示例2: EntityNodeParent
static MObject EntityNodeParent( MDagPath& path )
{
if( path.hasFn( MFn::kDagNode ) )
{
MDagPath parentPath;
MFnDependencyNode nodeFn;
while( path.pop( 1 ) != MS::kInvalidParameter )
{
nodeFn.setObject( path.node() );
if( nodeFn.typeId() == EntityInstanceNode::s_TypeID )
{
return nodeFn.object();
}
}
}
return MObject::kNullObj;
}
示例3: doIt
//-----------------------------------------------------------------------------
// EntityInstanceNodeCmd::doIt
// execution of the command
//-----------------------------------------------------------------------------
MStatus EntityInstanceNodeCmd::doIt( const MArgList & args )
{
MStatus stat;
// parse the command line arguments using the declared syntax
MArgDatabase argParser( syntax(), args, &stat );
if( argParser.isFlagSet( ReloadAllArtFlagLong ) )
{
EntityNode::UnloadAllArt();
EntityNode::LoadAllArt();
return MS::kSuccess;
}
else if( argParser.isFlagSet( UnloadAllArtFlagLong ) )
{
EntityNode::UnloadAllArt();
return MS::kSuccess;
}
else if( argParser.isFlagSet( UnselectFlag ) )
{
MGlobal::executeCommand( "select -all" );
MSelectionList list;
MGlobal::getActiveSelectionList( list );
EntityNode::UnselectAll( list );
MGlobal::setActiveSelectionList( list );
return MS::kSuccess;
}
else if( argParser.isFlagSet( CreateInstanceFlag ) )
{
HELIUM_BREAK();
#pragma TODO( "Reimplement to use the Vault" )
//File::FileBrowser browserDlg( NULL, -1, "Create Instance" );
//browserDlg.AddFilter( FinderSpecs::Asset::ENTITY_DECORATION );
//browserDlg.SetFilterIndex( FinderSpecs::Asset::ENTITY_DECORATION );
//if ( browserDlg.ShowModal() == wxID_OK )
//{
// tstring fullPath = browserDlg.GetPath();
// if ( FileSystem::Exists( fullPath ) )
// {
// if ( FileSystem::HasExtension( fullPath, FinderSpecs::Asset::ENTITY_DECORATION.GetDecoration() ) )
// {
// Asset::EntityPtr instance = new Asset::Entity( fullPath );
// std::pair< EntityNode*, EntityInstanceNode* >result = EntityNode::CreateInstance( instance );
// MFnDependencyNode nodeFn( result.second->thisMObject() );
// }
// }
//}
return MS::kSuccess;
}
else if( argParser.isFlagSet( FlattenLong ) )
{
EntityNode::FlattenInstances();
return MS::kSuccess;
}
//
// the following flags need an EntityNode object to proceed
//
MSelectionList selection;
argParser.getObjects( selection );
MObject selectedNode;
selection.getDependNode( 0, selectedNode );
MFnDependencyNode nodeFn;
nodeFn.setObject( selectedNode );
EntityNode* classTransform = NULL;
if( nodeFn.typeId() == EntityInstanceNode::s_TypeID )
{
EntityInstanceNode* node = static_cast< EntityInstanceNode* >( nodeFn.userNode( &stat ) );
if( !node )
{
return MS::kFailure;
}
classTransform = &EntityNode::Get( node->GetBackingEntity()->GetEntity()->GetPath() );
if( *classTransform == EntityNode::Null )
{
return MS::kFailure;
}
}
else if ( nodeFn.typeId() == EntityNode::s_TypeID )
{
classTransform = static_cast< EntityNode* >( nodeFn.userNode( &stat ) );
if( !classTransform )
{
return MS::kFailure;
}
}
//.........这里部分代码省略.........
示例4: if
//.........这里部分代码省略.........
status = MS::kNotFound;
return status;
}
// Get the name of the node into fNodeName so that it can
// be saved for undo/redo
//
MStringArray tmpList;
selList.getSelectionStrings(tmpList);
fNodeName = tmpList[0];
if ( fNodeName.length() )
{
sWho += " \"";
sWho += fNodeName;
sWho += "\"";
}
status = selList.getDependNode(0, oNode);
if (!status)
{
return status;
}
status = fnNode.setObject( oNode );
if (!status)
{
sFeedback = sWho;
sFeedback += " is not a cgfxShader node.";
MGlobal::displayError( sFeedback );
return status;
}
if (fnNode.typeId() != cgfxShaderNode::sId)
{
status = MS::kInvalidParameter;
sFeedback = sWho;
sFeedback += " is not a cgfxShader node.";
MGlobal::displayError( sFeedback );
return status;
}
pNode = (cgfxShaderNode*)fnNode.userNode();
if (!pNode)
{
status = MS::kInvalidParameter;
sFeedback = sWho;
sFeedback += " is not cgfxShader node.";
MGlobal::displayError( sFeedback );
return status;
}
}
if ( fIsQuery ) {
// -fx / -fxFile
// Returns the shader file name.
if ( fFxFile )
{
MString path = pNode->shaderFxFile();
setResult( path );
return MS::kSuccess;
}
// -fxp / -fxPath
// Returns the path of the fx file. The path name is in Maya