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


C++ MFnDependencyNode::fullPathName方法代码示例

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


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

示例1: doIt


//.........这里部分代码省略.........
  {
    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;
    }
  }

  if (argParser.isFlagSet( ReloadArtLong ) )
  {
    classTransform->LoadArt();
  }
  else if( argParser.isFlagSet( SelectEntityAssetFlagLong ) )
  {
    MFnDagNode nodeFn( classTransform->thisMObject() );
    MGlobal::executeCommand( "select -r \"" + nodeFn.fullPathName() + "\"" );
  }

  return MS::kSuccess;
}
开发者ID:,项目名称:,代码行数:101,代码来源:


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